Invention content
The present invention provides a kind of image exposure processing system for capsule endoscope system aiming at above-mentioned technical problemSystem and method, it is real to shooting the brightness of image when which can make capsule endoscope carry out controlled shooting in alimentary canalWhen control, automatically process the excessively bright or excessively dark image occurred in shooting process, keep checking process more efficient.
To achieve the above object, a kind of image exposure processing system for capsule endoscope system designed by the present inventionSystem, it includes surveying optical module, exposure judgment module, brightness judgment module, gear computing module and parameter adjustment module, the surveyThe signal input part of optical module is used for incoming image, surveys the signal input of the signal output end connection exposure judgment module of optical moduleEnd, exposes the signal input part of the signal output end connection brightness judgment module of judgment module, and the signal of brightness judgment module is defeatedOutlet connects the first signal input part of gear computing module, and the signal output end Connecting quantity of gear computing module adjusts moduleSignal input part, image sensor signal acquisition gain amplifier and the image exposuring time value output end of parameter adjustment module are usedIn being conveyed to lighting device and photographic device, image sensor signal acquires gain amplifier and figure after the adjustment of parameter adjustment moduleAs time for exposure gear value output end connects the second signal input terminal of gear computing module.
A kind of image exposure processing method using above system, which is characterized in that it includes the following steps:
Step 1:The signal input part for surveying optical module receives the present image of input, and calculates the brightness evaluation of present imageParameter, the brightness evaluation parameter include image saturation value Z and image non-saturated pixel mean value Y;
Step 2:It surveys optical module and image saturation value Z and image non-saturated pixel mean value Y is transferred to exposure judgment module, exposeLight judgment module is transferred to brightness judgment module by the image non-saturated pixel mean value Y that optical module transmission comes is surveyed, and exposure judges mouldBlock judges whether present image brightness is excessively bright or excessively dark using image saturation value Z, and specific judgment method is:If image is saturatedThe absolute value of value Z | Z | when being more than saturation value predetermined threshold value T1, then present image is excessively bright or excessively dark, i.e. exposure is abnormal;Otherwise,Exposure is normal;The result that current image exposure judges is transferred to gear by brightness judgment module and calculates mould by exposure judgment moduleBlock;
Step 3:Brightness judgment module be used for according to image non-saturated pixel mean value Y judge present image brightness whetherIn brightness predetermined threshold value T2, specific judgment formula is:
|Y-Ym| < T2 (3)
Wherein, YmFor human eye observed image when comfortable brightness, YmFor manually determining empirical parameter;When image unsaturationWhen pixel mean value Y meets formula (3), brightness of image is normal, and otherwise brightness of image is abnormal;When Y is more than YmWhen+T2, image be compared withBright image;When Y is less than YmWhen-T2, image is dark image;
The result that present image brightness judges is transferred to gear computing module by brightness judgment module;
Step 4:It is that the result and present image brightness that gear computing module judges according to current image exposure judge as a result,Image sensor signal acquires gain amplifier and image exposuring time gear value D after calculating adjustmentn;
If present image is initial pictures, it is specifically divided into following four kinds of processing:
Situation one adjusts exposure normal picture if brightness judgment module judges that present image belongs to dark imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=(D0*Ym/Y)*a0/100
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter, a0For initial pictures gearRegulation coefficient, the initial pictures gear regulation coefficient are preset value, YmFor human eye observed image when comfortable brightness;
Situation two:For exposing normal picture, if brightness judgment module judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=D0*Ym/Y
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter;
Situation three:Exposure abnormal image is adjusted if brightness judgment module judges that present image belongs to dark imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=(D0*Ym/Ya)*a0/100
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter, a0For initial pictures gearRegulation coefficient, the initial pictures gear regulation coefficient are preset value, YaFor the pixel grey scale mean value of present image;
Situation four:Exposure abnormal image is adjusted if brightness judgment module judges that present image belongs to brighter imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=D0*Ym/Ya
If present image is non-initial image, it is specifically divided into following four kinds of processing:
Situation one adjusts exposure normal picture if brightness judgment module judges that present image belongs to dark imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=(Dc*Ym/Y)*a/100
Wherein, DcGain amplifier and image exposuring time are acquired for the image sensor signal of piece image before present imageGear value, a are image gear regulation coefficient, YmFor human eye observed image when comfortable brightness, Y be present image non-saturated pixelMean value;
Situation two:For exposing normal picture, if brightness judgment module judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=Dc*Ym/Y
Situation three:Exposure abnormal image is adjusted if brightness judgment module judges that present image belongs to dark imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=(Dc*Ym/Ya)*a/100
Situation four:Exposure abnormal image is adjusted if brightness judgment module judges that present image belongs to brighter imageImage sensor signal acquisition gain amplifier and image exposuring time gear value D after wholenFor:
Dn=Dc*Ym/Ya
Above-mentioned image gear regulation coefficient a is calculated by following formula:
Wherein, Y1For the non-saturated pixel mean value of piece image before present image, DcFor the figure of piece image before present imageAs collecting sensor signal gain amplifier and image exposuring time gear value, Y is the non-saturated pixel mean value of present image, and D2 isThe image sensor signal acquisition gain amplifier and image exposuring time gear value of present image
Step 5:Image sensor signal acquisition is amplified after the adjustment that parameter adjustment module is obtained according to gear computing moduleGain and image exposuring time gear value, when acquiring gain amplifier and image exposure by inquiring the image sensor signal to prestoreBetween gear table, find image sensor signal acquisition gain amplifier and image exposuring time gear table in image sensing after adjustmentDevice signal acquisition gain amplifier and the close A gear number of image exposuring time gear value, then select above-mentioned A gear volumeImage sensor signal acquisition gain amplifier value is minimum in number numbers as new gear, which numbers corresponding image and passSensor signal acquires gain amplifier value and is conveyed to lighting device and photographic device with image exposuring time value, carries out the brightness of imageAdjustment;In addition, image sensor signal acquisition gain amplifier and image exposuring time gear value return to gear calculating after adjustmentThe exposure-processed that module carries out subsequent image uses.
Beneficial effects of the present invention are:
1, the present invention can handle the exposure image in capsule shooting process in real time;
2, the present invention can be directed to entire alimentary system image do in real time adjustment (i.e. every image be both needed to it is real-time with it is previousIt opens image and does exposure-processed adjustment);
3, the present invention can at any time manual adjustment with calibrate image brightness (each predetermined threshold value i.e. in system can be artificialModification setting);
4, the present invention can be done for different application scenarios image light filling (such as the different position of alimentary canal, as stomach,The environment difference such as small intestine does real-time image procossing, and light filling does delustring processing just for dark scene, brighter scene), fromAnd it is optimal image effect;
5, the present invention is acquired using image sensor signal and is amplified in the case where not changing existing capsule endoscope structureGain and image exposuring time are as the factor for adjusting image light and shade, to improve image taking effect;
6, the brightness for shooting image is controlled in real time when the present invention can make capsule endoscope carry out controlled shooting in alimentary canalSystem, automatically processes the excessively bright or excessively dark image occurred in shooting process, keeps checking process more efficient.
Specific implementation mode
The following further describes the present invention in detail with reference to the accompanying drawings and specific embodiments.
A kind of image exposure processing system for capsule endoscope system that the present invention designs, as shown in Figure 1, it includesSurvey optical module 1, exposure judgment module 2, brightness judgment module 3, gear computing module 4 and parameter adjustment module 5, the survey optical modeThe signal input part of block 1 is used for incoming image (image that capsule endoscope is shot in alimentary canal), and the signal for surveying optical module 1 is defeatedThe signal input part of outlet connection exposure judgment module 2, the signal output end connection brightness judgment module 3 of exposure judgment module 2Signal input part, the first signal input part of the signal output end connection gear computing module 4 of brightness judgment module 3, gearThe signal input part of the signal output end Connecting quantity adjustment module 5 of computing module 4, the imaging sensor of parameter adjustment module 5Signal acquisition gain amplifier is with image exposuring time value output end for being conveyed to lighting device and photographic device, parameter adjustment mouldImage sensor signal acquisition gain amplifier and the output of image exposuring time (i.e. LED polishings time) gear value after the adjustment of block 5The second signal input terminal of end connection gear computing module 4.
In above-mentioned technical proposal, the brightness evaluation parameter surveyed optical module 1 and be used to calculate present image;
It is described exposure judgment module 2 be used for using present image brightness evaluation parameter judge present image brightness whether mistakeIt is bright or excessively dark;
Whether the brightness judgment module 3 is used to judge the brightness of present image in preset threshold range;
The gear computing module 4 is used for the brightness according to present image, and image sensor signal acquires after calculating adjustmentGain amplifier and image exposuring time gear value;
Image sensor signal acquisition amplification after the adjustment that parameter adjustment module 5 is used to be obtained according to gear computing module 4Gain and image exposuring time gear value, when acquiring gain amplifier and image exposure by inquiring the image sensor signal to prestoreBetween gear table, find image sensor signal acquisition gain amplifier and image exposuring time gear table in image sensing after adjustmentDevice signal acquisition gain amplifier and image exposuring time gear value close A (preferably 5) gears number, then in selectionIt states image sensor signal in A gear number and acquires being numbered as new gear for gain amplifier value minimum, gear numberCorresponding image sensor signal acquisition gain amplifier value is conveyed to lighting device and photographic device with image exposuring time value, adjustsImage sensor signal acquisition gain amplifier and image exposuring time gear value return to gear computing module 4 and carry out subsequently after wholeThe exposure-processed of image uses.
In above-mentioned technical proposal, the brightness evaluation parameter includes image saturation value Z and image non-saturated pixel mean value Y.
A kind of image exposure processing method using above system, it includes the following steps:
Step 1:The signal input part for surveying optical module 1 receives the present image of input, and the brightness for calculating present image is commentedValence parameter, the brightness evaluation parameter include image saturation value Z and image non-saturated pixel mean value Y;
Step 2:It surveys optical module 1 and image saturation value Z and image non-saturated pixel mean value Y is transferred to exposure judgment module 2,Exposure judgment module 2 is transferred to brightness judgment module 3 by the image non-saturated pixel mean value Y that the transmission of optical module 1 comes is surveyed, and exposure is sentencedDisconnected module 2 judges whether present image brightness is excessively bright or excessively dark using image saturation value Z, and specific judgment method is:If figureAs the absolute value of saturation value Z | Z | be more than saturation value predetermined threshold value T1 (preferably T1=30000) when, then present image it is excessively bright orIt crosses secretly, i.e. exposure is abnormal;Otherwise, exposure is normal;Exposure judgment module 2 sentences the result that current image exposure judges by brightnessDisconnected module 3 is transferred to gear computing module 4;
Step 3:Brightness judgment module 3 be used for according to image non-saturated pixel mean value Y judge present image brightness whetherIn brightness predetermined threshold value T2 (preferably T2=32), specific judgment formula is:
|Y-Ym| < T2 (3)
Wherein, YmFor human eye observed image when comfortable brightness (preferably Ym=134), YmFor manually determining empirical parameter;When image non-saturated pixel mean value Y meets formula (3), brightness of image is normal, and otherwise brightness of image is abnormal;When Y is more than Ym+T2When, image is brighter image;When Y is less than YmWhen-T2, image is dark image;
The result that present image brightness judges is transferred to gear computing module 4 by brightness judgment module 3;
Step 4:The knot that the result and present image brightness that gear computing module 4 judges according to current image exposure judgeFruit calculates image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentn;
If present image is initial pictures, it is specifically divided into following four kinds of processing:
Situation one, for expose normal picture, if brightness judgment module 3 judges that present image belongs to dark image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=(D0*Ym/Y)*a0/100
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter, a0For initial pictures gearRegulation coefficient, the initial pictures gear regulation coefficient are preset value, YmFor human eye observed image when comfortable brightness;
Situation two:For exposing normal picture, if brightness judgment module 3 judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after then adjustingnFor:
Dn=D0*Ym/Y
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter;
Situation three:For exposing abnormal image, if brightness judgment module 3 judges that present image belongs to dark image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=(D0*Ym/Ya)*a0/100
Wherein, D0For initial pictures collecting sensor signal gain amplifier and image exposuring time gear value, the initial graphAs collecting sensor signal gain amplifier and image exposuring time gear value are preset empirical parameter, a0For initial pictures gearRegulation coefficient, the initial pictures gear regulation coefficient are preset value (initial pictures gear regulation coefficient a0Preferably 100), YaForThe pixel grey scale mean value of present image;
Situation four:For exposing abnormal image, if brightness judgment module 3 judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=D0*Ym/Ya
If present image is non-initial image, it is specifically divided into following four kinds of processing:
Situation one, for expose normal picture, if brightness judgment module 3 judges that present image belongs to dark image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=(Dc*Ym/Y)*a/100
Wherein, DcImage for piece image before present image (sortord of image is to sort according to time sequencing) passesSensor signal acquires gain amplifier and image exposuring time gear value, and a is image gear regulation coefficient, YmFor human eye observed imageWhen comfortable brightness, Y be present image non-saturated pixel mean value;
Situation two:For exposing normal picture, if brightness judgment module 3 judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after then adjustingnFor:
Dn=Dc*Ym/Y
Situation three:For exposing abnormal image, if brightness judgment module 3 judges that present image belongs to dark image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=(Dc*Ym/Ya)*a/100
Situation four:For exposing abnormal image, if brightness judgment module 3 judges that present image belongs to brighter image,Image sensor signal acquisition gain amplifier and image exposuring time gear value D after adjustmentnFor:
Dn=Dc*Ym/Ya
Above-mentioned image gear regulation coefficient a is calculated by following formula:
Wherein, Y1For the non-saturated pixel mean value of piece image before present image, DcFor the figure of piece image before present imageAs collecting sensor signal gain amplifier and image exposuring time gear value, Y is the non-saturated pixel mean value of present image, and D2 isThe image sensor signal acquisition gain amplifier and image exposuring time gear value of present image
Step 5:Image sensor signal acquisition is put after the adjustment that parameter adjustment module 5 is obtained according to gear computing module 4Large gain and image exposuring time gear value acquire gain amplifier and image exposure by inquiring the image sensor signal to prestoreTime gear table finds in image sensor signal acquisition gain amplifier and image exposuring time gear table and is passed with image after adjustmentSensor signal acquires gain amplifier and the close A gear of image exposuring time gear value is numbered, and then selects above-mentioned A gearImage sensor signal acquisition gain amplifier value is minimum in number numbers as new gear, which numbers corresponding imageCollecting sensor signal gain amplifier value is conveyed to lighting device and photographic device with image exposuring time value, carries out the bright of imageDegree adjustment (for example image is excessively dark, then will increase the time for exposure, carries out light filling processing, and if excessively bright, delustring processing);SeparatelyOutside, after adjustment image sensor signal acquisition gain amplifier and image exposuring time gear value return to gear computing module 4 intoThe exposure-processed of row subsequent image uses.
In above-mentioned technical proposal, each gear value of gear table corresponds to an image sensor signal and acquires gain amplifierAnd image exposuring time, the image sensor signal acquisition gain amplifier and image exposuring time gear table to prestore is mould in vitroWhat quasi- digestive tract environment obtained.
Image saturation value Z and image in the step 1 of above-mentioned technical proposal in the brightness evaluation parameter of present image is non-fullCircular with pixel mean value Y is:
Image saturation value Z is to measure that image is excessively bright or the parameter of excessively dark degree, calculation formula are:
Z=-ZL+w×ZH
Wherein, ZLFor the number of pixel of the gray scale in [0,14] range, ZHFor picture of the gray scale in [241,255] rangeThe number of element, w are that image is saturated regulation coefficient, which is manually determining empirical parameter, preferably 1.2;
Image non-saturated pixel mean value Y is the mean value of all pixels in pixel value [15,240] range, and calculation formula is:
Wherein, N is the number of all pixels of the gray scale in [15,240] range, and I (n) is gray scale in [15,240] rangeThe gray scale of interior pixel.
In above-mentioned technical proposal, described image is the corresponding maximum inscribed square region of border circular areas among endoscopic imagesDomain, as shown in Figure 2.In this way using central metering mode, it is avoided that inactive area influences.
The present invention for same type (imaging sensor photoperceptivity, LED luminous intensities are identical with spectrum) capsule,Environment in vitro digestion road acquires the image under different parameters, finds different parameters and the correspondence of brightness of image, buildVertical brightness regulation gear table.When it is excessively bright or excessively dark to judge the brightness of current captured image, by the ash for judging imageIt is final to obtain image by searching for gear table for the relationship of the threshold value of angle value and actual set, the new gear value that image is calculatedYield value and flash time value, to re-shoot the clear image with high shooting condition;The image captured by the judgement is brightWhen degree is in normal range (NR), then judge that gray value of image whether in set threshold range, if in threshold range, is recognizedImage belongs to normal clearly image thus, need not carry out brightness adjustment, continue the processing of next image;If noIn threshold range, then judging that gray value is excessively high or too low at this time, new gear value at this time is obtained by calculation, by looking intoGear table is looked for, the final yield value of image and flash time value are obtained, to re-shoot the clear figure with high shooting conditionPicture;When image data generates video file and reviews, multiple neighbouring images are read on backstage in advance, execute luminance proportionProcess so that bright dark alternating changes apparent brightness of image and keeps almost the same.
The content that this specification is not described in detail belongs to the prior art well known to professional and technical personnel in the field.