referring now to the drawings , wherein like reference numerals refer to like parts throughout , the present invention comprises a method for calibrating a machine vision system to use the optimal imager exposure value for current system condition . the optimal exposure value should provide an image that is uniform , with a fully saturated background , and illustrate any objects therein with fully formed or connected boundaries . there is seen in fig1 ( a )-( j ) a series of captured optical images of a 100 × 12 mm empty tube under different exposure values ( e ) from , as an example , 30 to 120 for use in connection with a machine vision system , that demonstrate the affect of different exposure values on a particular system . the imager used to capture the images seen in fig1 ( a )-( j ) may comprise any off - the - shelf optical imager capable of capturing digital images of a target that may be further processed for barcode and / or shape recognition and may optionally include on - board or separate illumination sources , such as leds . for example , honeywell imaging and mobility of skaneateles falls , n . y . sells a 5 × 80 series of imagers are capable of scanning and decoding most standard barcodes including linear , stacked linear , matrix , ocr , and postal codes . other acceptable optical imaging platforms may also include the ev12 , ev15 , ea15 , and xa21 imagers available from intermec technologies corporation of everett , wash ., or any custom imaging packaging sold commercially for incorporation into machine vision or optical imaging systems . it should be recognized by those of skill in the art that the particular model or make optical imaging platforms that may be interfaced with the present invention are not important as long the platform allows for capturing images with different exposure levels . within the range of exposure values illustrated in fig1 , there are exposure values that would adversely impact machine visions processing and other than would provide optimal machine vision processing . for example , if the exposure is set too low , as in the example of e = 30 in fig1 ( a ) or e = 40 in fig1 ( b ) , the accuracy of any machine vision processing algorithms will be adversely affected because the edge of the tube boundary in the captured image is too thick and there is a strong shadow or cloud in the background . on the contrary , if the exposure is set too high , as in e = 120 of fig1 ( i ) or e = 130 of fig1 ( j ) , the accuracy of any machine vision processing algorithms will be adversely affected because the edge of the tube boundary is too thin and potentially disconnected , the contrast between the tube and background is too small , and the tube , and especially the tube boundary , is washed out . under the conditions used to capture the images in fig1 , the optimal exposure for machine vision processing is closer to e = 60 , as seen in fig1 ( d ) , or e = 70 , as seen in fig1 ( e ) . the optimal exposure provides a uniform and fully saturated background , as well as sharp , fully connected tube boundaries . accordingly , the present invention encompasses an automatic exposure scheme to determine and implement the appropriate value for under any variety of characteristics and settings . referring to fig2 , a process 10 for determining the optimal exposure value according to the present invention begins with the step of taking a series of snapshots of a target with a predetermined range of exposure values 12 , such as e = 30 to e = 120 , that are separated or incremented equally by a fixed amount , such as 10 . process 10 is preferably implemented in a controller that is onboard and forms part of the imager being used to capture images of the target , a separate microcontroller interconnected to the optical imager , or even in a host computer that is capable of sending commands to and communicating with a remotely positioned imager . it should be recognized by those of skill in the art that process 10 may be implemented in software instruction programmed into any of these options depending on the particular needs of the machine vision application . preferably , this process is installed as a calibration routine that can be performed upon the issuance of a designated calibration command that can be run independently or in combination with other routines , such as decoding or machine vision processing . the range of exposure values , and distance between the values , may be selected based on an estimate or determination as to the widest possible optimal exposure values . for example , the range may be determined experimentally from a large quantity of the same cameras , or even different types of cameras , in advance of the first implementation of the machine vision system that will be programmed to implement the present invention . the range of exposure values is preferably selected to be large enough to handle all possible varieties and to account to potential degradation of the system during its expected lifespan . the next step in process 10 is to , using a predetermined one of the high exposure value images ( such as e = 90 ), determine certain boundaries in the image 14 . the preferred boundaries comprise a region of interest 20 that includes at least a portion of a background region 22 , such as the retro - reflective background seen in fig3 , as well as the boundaries for a target 24 , such as the exemplary test tube of fig3 . a retro - reflective background system for improving machine vision processing is described in detailed in u . s . pat . no . 8 , 170 , 322 , hereby incorporate by reference in its entirety . the boundaries of region of interest 20 , background 22 , and target 24 are preferably saved in local memory for later use , as explained below . the high exposure value to be used in this step is selected to ensure a crisp delineation between background 22 and target 24 so that the boundaries can be more easily determined through conventional processes , such as a histogram analysis or edge detection algorithms . by using a high exposure image , the pixels of the background area in the region of interest pixels are more clearly defined as the pixels falling between the region of interest area and the boundary of the region of interest , thereby making the analysis easier . next , the percentage of saturated pixels to all of the background pixels in the region of interest is calculated 16 . a pixel is deemed to be saturated if its pixel intensity value is above a certain threshold value , such as 250 . the threshold value may be stored in memory prior to system implementation and automatically retrieved for use on a period basis or according to a schedule , or possibly input by a user in connection with field servicing of the machine vision system implementing process 10 . the percentage may be algorithmically calculated based on the pixel data for the image by applying the threshold and simply dividing the number of pixels that satisfy the threshold by the total number of pixels in the region of interest . the same percentage saturation computation is then performed on all exposure values from the minimum to maximum and stored in local memory . once the percentage of saturated pixels for all pixels in each of the exposure values have been calculated and stored in step 16 , the percentages may then be plotted to generate a saturation percentage curve 18 , as seen in fig4 . the optimal exposure value may then be determined based on the exposure value whose background saturation percentage is converged . the converged exposure value is defined as the exposure value where the background saturation percentages do not change materially in the preceding or following exposure value . convergence may be determined by programming the processor implementing process 10 to calculate the exposure value having the least amount of variance in its saturation percentage with respect to the saturation percentages of adjacent exposure values . those of skill in the art will appreciate that the plotting and calculating of convergence may be performed automatically and without the need to provide a visual representation of the plot to a user . referring to fig4 , the optimal exposure value would be e = 70 , as the saturation value of e = 70 does not change materially with respect to e = 60 or e = 50 . notably , in this example , the background saturation percentage exposure values do not change materially up to e = 120 , so this particular example provides a range of optimal exposure values . as the characteristics of the imaging system change , the number of optimal exposure values may change dramatically . accordingly , process 10 may be configured to pick the best exposure value each time or select randomly from any value that provide equal convergent saturation percentages . thus , a machine vision system 10 may implement process 10 on a regular or period basis and adjust the optimum exposure value to maintain the quality of machine vision processing regarding of changes to the system , variations in the components , or the degradation of components over time . once the optimal exposure value is determined , that exposure value may be used to configure , or reconfigure , the exposure value in use by the associated imager to ensure the highest quality image possible and maximize the effectiveness of subsequent machine vision processing on acquired images . alternatively , process 10 may be performed more rapidly by obtaining a high exposure image , such as e = 90 , and the computing the boundaries for region of interest 20 . next , a low exposure image , such as e = 20 , is captured capture the image and the saturation ratio is calculated . the exposure value is then incremented and the saturation ratio is then calculated . the saturation ratios are then tracked and monitored until a converged point is reached . as explained above , process 10 is preferably implemented as a calibration process . when it is difficult to perform process 10 on a regular basis , there may be need for an adaptive routine that can be performed without user intervention . this adaptive routine may be used to reset the exposure value or simply as a test to determine whether recalibration according to process 10 is necessary . for example , an adaptive routine may be used as a check to see if there some strong external lighting change or whether the illumination that is too dark or too bright . referring to fig5 , the present invention therefore also includes an adaptive exposure process 30 that may be performed on each captured image to adjust the exposure value on a continuing basis , thereby avoiding the need to implement process 10 on a periodic basis . as seen in fig5 , the captured image of fig4 further includes a region of interest identified as exposure window 32 and falling within a calibration label 34 . label 34 is selected to best reflect the intensity change from various external lighting conditions and is preferably yellow in color . window 32 is positioned to obtain a sample range of intensity pixels of label 34 from which the median value may be calculated mathematically . adaptive exposure process 30 according to the present invention is based on the setting of a target median , which is initially determined by capturing a series of images at a low exposure value , such as 60 , with various illumination power levels , such as 20 to 100 . next , a second set of images is captured using a high exposure value , such as 90 , along with the same various illumination levels . as seen in fig6 , which shows decreasing illumination to simulate degradation of the illumination source ( such as leds ) over time , the computed median at every power level for both series of images may then be plotted to determine how the median decreases as illumination power levels decrease for each exposure value . notably , the difference between the medians of the low and high exposure values decreases as the illumination level decreases . as fig6 alone does not give a clear relationship between the changes of the exposure level with respect to the median at different power levels , another set of images are taken at different exposure levels from 60 to 140 at different illumination power levels from 20 to 90 . fig7 combines eight plots of these captured images to illustrate the relationship between the exposure value and the median value at different illumination power levels . fig7 shows that the median value is linearly increased with the exposure value on the same illumination power level . it has thus been established that there is a linear relationship between the exposure and median value of the exposure window if the window is not contaminated . since the illumination power level changes minimally between two consecutive captures of a target , this relationship may be used compute an exposure value that will achieve the target median by using any pair of images that are taken at different exposure level . referring to fig8 , adaptive exposure process 30 is implemented by capturing two images 36 , image image_h captured at a current high exposure value exp_high , and image image_l captured using a current low exposure value exp_low . the current low and high exposure values may be initially selected to represent the acceptable range of exposures that will currently provide the highest quality image . for example , for a newly installed system , the low and high current exposure values may be set at 60 and 90 , respectively , such as in default memory 38 . in addition , a target median for window 32 of , for example 45 , may be also be set as a default . once default values are set , process 30 may be implemented at any point in the future , or on a regular basis , starting with the default current values as further modified via process 30 . thus , image_h and image_l are captured using the then - current high exposure value exp_high and low exposure value exp_low as the first step in process 30 . after capturing one image at the current low and high exposure values 36 , median values of window 32 are then computed for that region of interest in both image image_h and image image_l 40 , thus resulting in median value of median_h from image image_h and median value of median_l for image image_l . median values median_h and median_l may then be evaluated 42 to determine : ( i ) whether median_h and median_l are too low or ( ii ) whether median_h and median_l are too close to each other . if the tests are passed , then the current exposure value in use is maintained 44 and the images captured at the initial exposure values may be interpreted according to the needs of the particular system . if either test fails , however , then a failure is noted and a new exposure value must be computed 46 for capturing images that will be of sufficient quality to be processed according to the needs of the particular system . the new low exposure value exp_lownew is calculated as follows : if the difference between the newly calculated low exposure value exp_lownew and the current low exposure value exp_low is greater than the maximum tolerance 48 ( for example 30 ), however , then the new low exposure exp_lownew is immediately set as low exposure value exp_low and a new high exposure value exp_high is set as exp_low plus 30 and a pair of new images may then be taken immediately with the new exposure settings 50 . image analysis may then be performed in the newly captured images as the variation from the values used to capture the previously captured images is significant enough that the previously captured images are not likely usable for machine vision processing . if the difference between the new low exposure value exp_lownew and the original low exposure value exp_low is greater than a minimal tolerance ( for example 5 ) but less than the maximum tolerance 52 , then the new exposure value exp_lownew is set in memory as the low exposure value exp_low and a new high exposure value exp_highnew is calculated as from the original low exposure value exp_low plus 30 and set in memory as a high exposure value exp_high , and the new exposure settings are then used for the next image capture 46 . image processing analysis on the current images can proceed as the variation was likely not significant enough that the images captured with the old values will be unusable for machine vision processing . if the difference between the new low exposure value exp_lownew and the original low exposure value exp_low is less than the minimal tolerance ( for example 5 ), then the current exposure values are maintained and the captured images may be processed 44 . during the calibration process 10 , it is possible to record the value median_l and median_h as initial target values . for each test image captured thereafter , the target values may be compared to the current values , and if the difference exceed as threshold ( such as 10 ), a flag may be set to adjust the exposure values so that the results will be very close to the target values . this flag may be determined using process 30 , by a bisect search , or even by a more exhaustive search algorithm like process 10 to determine new exposure values whose median_l and median_h are as close as possible to the target values . process 30 was tested using sequentially lower illumination to simulate the degradation of leds over time . as seen in table 1 below , as the led power decreased , low exposure value exp_low was first adjusted for minor deviations and then major deviations until the led power reached such a low level , i . e ., zero , that adjustment was no longer possible . default values were as follows : target median 45 , minimum tolerance 5 ( minor in table 1 ), and a maximum tolerance 30 ( major in table 1 ).