Documentation

Blemish INI Reference

Blemish Detect detects visible sensor defects (typically blurred spots caused by dust in front of the image sensor) using a tunable filter based on the human visual system. Because it is included in Imatest IT/EXE and DLL, users may need to examine or edit the INI file used to control IT versions of Blemish Detect.

Most of the settings in the [blemish] section are set by the Blemish Settings window or Uniformity settings window (which can be opened by pressing the Uniformity button near the top of the Blemish settings window). A few are set by responses to other windows or user actions.

Blemish_input_dialogBlemish settings window

Uniformity Settings for Blemish Detect. Histograms and Noise detail are omitted

INI file settings that affect several modules are described in Imatest INI Reference.

Notes
(-IT) Not used in Imatest IT
(gr) Affects graphics (figures). May not be of interest for Imatest IT, where graphics is often suppressed.
(index) Setting is equal to the index of the popup menu. You’ll need to open the Settings window to see these: Never used for important IT settings.
(index-1) Setting is equal to the index of the popup menu – 1 (0 – (index-1)). Keeps backwards compatibility for some settings that were originally 0 (off) or 1 (on), but had options added.

Set in Blemish detect settings window
ρ
Set during image read or region selection
σ Set in Save results window

Set in other window

Two methods of selecting the Region of Interest (ROI; region to be analyzed)

The region to be analyzed is normally selected by roi, which is set in the coarse and fine region adjust windows. roi contains several groups of four values, each corresponding to the nth value of image width nwid_save and height nht_save. Each group of four roi values consists of [x1 y1 x2 y2]: the Left, Top, Right, and Bottom pixels that define the Region of Interest, defined relative to the upper-left corner, not to each of the edges. So if you want a constant margin for several images (for example, you want the ROI boundaries to be 4 pixels from the borders), roi must be set individually for each image size.

Blemish Detect offers an alternative method of specifying the ROI relative to the image boundaries: crop_borders, which is set near the bottom of the Blemish (or Uniformity) window. crop_borders contains five values: 1-4 are the margins (in pixels) relative to the L R T and B boundaries. The fifth value turns crop_borders on (1) or off (0). crop_borders is enabled when blemcrop==1 and crop_borders(5)==1. If blemcrop>1 or crop_borders(5)==0, crop_borders is ignored and roi is used for the ROI.

Table of [blemish] settings

Parameter Settings window
Blemish settings; Other;
ρ Read; σ Save
Typical values
[default]
Description Notes
addconts Summary plot (Blemish plot
(spot emphasis) shown above
1-4 [4] (index) Main Blemish results plot (gr)
addhist Summary plot options (Add results at bottom…) shown above 1-3 [1] (index-1) Include results and/or histogram at bottom of summary plot (slows computations!) (gr)
bayeraw (Set by several buttons in the Monochrome image settings window) 0-5 [0] If > 0, monochrome files contains Bayer RAW data. 1-4, indicates primary color to analyze (R, Gr, B, Gb). 5 indicates Demosaic.  
blemc_maxn (unused) 1 1 1    
blemc_minsz (unused) 10    
blemc_run Blemish count plot (checkbox)
0 or 1 [0] Plot Blemish count if 1 (gr)
blemc_thresh (unused) 0.2    
blemc_units (unused) 2    
blemc_zbounds (unused) 30 75    
blemcrop (Set in Options I window) 1-3 [2] (index) Cropping options: 1 disables normal region selection (roi) and enables crop_borders (if crop_borders(5)==1). 2 is recommended for normal region selection.  
blemish_analysis Blemish analysis checkbox 0 or 1 [1] Normally 1 for blemish analysis. 0 turns off blemish analysis (Uniformity and hot/dead pixel analysis is still available). Turning off blemish analysis speeds up runs tremendously.  
blemlim1 (unused) 3 4 4 4 4 4 4    
blemlim2 (unused) 3 4 4 10 20 25    
brawShift (Set by the Bit shift popup menu in the Monochrome image settings window) 1-6 [1] (index) Bayer raw bit shift
 
calcluster Can be entered as options in the dropdown menus in the Defective pixels section (in Detect hot/dead pixels)
0 0 Detect hot and dead pixel clusters (calcluster(1) and (2), respectively), where a cluster is defined as 2 or more adjacent defects. Example: Enter calcluster = 0 1 to detect dead pixel clusters. calcluster(2) is set if Dead_pixel_clusters_max has been entered into the pass/fail ini file.
 
closefigs σ Set by the Close figures after save checkbox in the Save window. 0 or 1 [0] 1 recommended for IT (closes figures after save).  
corner_HD_block (Corners box in Defective pixels area)
integer [0] If n = corner_HD_block > 0, reduces sensitivity to Hot, Dead pixels by a factor of 2 in nxn pixel corner regions.  
crop_borders Alternative way of specifying Regions of Interest, relative to the image boundaries. Set in the Crop pixels near borders section (lower-left). 0 0 0 0 0 Values 1-4 are the margins relative to the L R T and B boundaries that define the Region of Interest. The fifth value turns crop_borders on (1) or off (0). blemcrop must be set to 1 to enable crop_borders.
 
dark_field_
absolute
       
deadp Dead pixels popup menu (lower-left) 1-3 [1] (formerly Min, Max)
If 2 or 3, same as hotpx.
1 = No dead or dark pixels
2 = Display dead pixels (o): Abs. pxl threshold
3 = Display dark pixels (o): Rel. % threshold
 
deadthr Dead pixels slider [4 8] Thresholds for detecting dead pixels: absolute value in pixels and relative % below neighbors for deadp = 2, 3.  
defect_pixel_
analysis
  [1] Used in override to disable Hot/Dead analysis if set to 0.  
downsample (checkbox in Filter section) 0 or 1 [0] Downsample the image (4:1 pixels) used for blemish detection only (does not affect other calculations like hot/dead pixels) for images > 5Mpxls. Image and pixels are upsampled after the calculation. Used to speed calculations & conserve memory, Primarily for ≥13MPxl cameras.  
figsave σ Set in Save figures as PNG or FIG dropdown menu in Save window 1 or 2 [1 recommended] Type of figure to save (PNG or FIG). FIG files not recommended because they require much more storage. (gr)
filecomb ρ Set when multiple files are selected for analysis 0 or 1 [0] 0: Read and analyze files as a batch, 1: Combine files (signal-average) (-IT)
filtype Popup menus to the right of Lowpass & Highpass [2 1] Highpass and lowpass filter rolloffs:
1: Exponential (e^(-x)),
2: Gaussian (e^(-x^2)),
3: Exponential-3 (e^(-x^3))
 
folder Set during image file read (Path name) Folder for last input image (-IT)
gamma (Settings area) [0.5] Used to linearize image prior to filtering.  
hdchan Channel popup menu below Hot/Dead pixels menus 1-3 [1] Channel(s) for detecting Hot/Dead pixels: 1 = any; 2 = selected; 3 = all.  
hotpx Hot pixels popup menu (lower-left) 1-3 [1] (formerly Min, Max)
If 2 or 3, same as deadp.
1 = No hot or light pixels
2 = Display hot pixels (o): Abs. pxl threshold
3 = Display light pixels (o): Rel. % threshold
 
hotthr Hot pixels slider [251 8] Thresholds for detecting hot pixels: absolute value in pixels and relative % above neighbors for hotpx = 2, 3.  
hpf_set Highpass slider or text box [0.02] Highpass cutoff in normalized units.  
lineplot Line blemish plot checkbox 0 or 1 [0] Line blemish plot (-gr)
lpf_set Lowpass slider or text box [0.005] Lowpass cutoff in normalized units.  
nchan Channel popup menu 1-4 Channel to analyze: 1-4: R, G, B, Y (Luminance)  
nht_save ρ Set during image read 2448 … Height in pixels of recent image(s). There may be several for several image sizes. the nth value corresponds to the nth value of nwid_save and the nth group of four values of roi.
 
nwid_save ρ Set during image read 3264 … Width in pixels of most recent image(s). There may be several for several image sizes. the nth value corresponds to the nth value of nht_save and the nth group of four values of roi.
 
oc_analysis        
plot_image ρ Plot checkboxes in Settings window 1 0 0 0 0 0    
prevdisp Preview display popup menu, under the Preview image [1] (index) Display type for the Preview in the Blemish settings window (-IT)
roi ρ Set during region selection (primarily in the fine adjust window) 1 1 3264 2448 (typical) Region of interest (crop) in pixels. [x1 y1 x2 y2] There may be several groups of four for several image sizes. the nth group of 4 corresponds to the nth value of nht_save and nwid_save. See crop_borders for alternative Region selection method.
 
save_answer σ Save window— main answer (unused) Yes, No
Saved setting not used. (-IT)
save_dir σ Set in Save window (Folder name) Last folder used to save results (-IT)
saveCSV σ Save window 0 or 1 [-99 = ignore] Save CSV results. Overrides save_file_list.  
saveJSON σ Save window 0 or 1 [-99 = ignore] Save JSON results. Overrides save_file_list.  
saveXML σ Save window 0 or 1 [-99 = ignore] Save XML results. Overrides save_file_list.  
save_file_list Save window [1 1 1 0 0 0 0 0 0 0] List of results to save if element is set to 1:
1: Orig. image, 2: Image LPF, HPF, 3: Image HPF, 4: Image HPF, exag. noise, 5: Blemish summary, 6: Blemish line image, 7: CSV, 8: XML, 9: Blemish count image, 10: JSON
 
sideloc Location popup window 1-7 [1] Distance from outer ROI boundary to image border (% of image height) 1-7: 0% (border), 1%,
2%, 5%, 10%, 15%, 20%
 
sidereg Corners & sides popup menu 1-7 [2] (index) (Same as uniformity) Size of corner and side regions for Relative Illumination analysis. 1: 10×10 pixels, 2: 32×32 pixels, 3: 1% (min. 10), 4: 2% (min. 10), 5: 5%, 6: 10%, 7: 64×64 pxls.  
speedup Speedup (checkbox in Settings area) 0 if set to 1, skip several calculations related to relative illumination to speed up operation.  
thresh Threshold values for blemish detection (5 text boxes) [.02 .03 .03 .04 .01] Threshold values for blemishes in Center, (L,R), (T,B), Corner regions, and Lines.  
thumbcrop Set when Location button in Blemish settings has been pressed [1 1 300 200] Crop locations for the Preview in the Blemish settings window [x1 y1 x2 y2] (-IT)
uniformity_
analysis
       
zone_bord Zone boundaries: (text boxes) [10 10] Zone boundaries (L,R) and (T,B) in % of total Width or Height  

Sample data

[blemish]
addconts = 3
addhist = 1
bayeraw = 0
blemc_run = 0
blemcrop = 2
brawShift = 1
closefigs = 0
colorspace = 1
deadp = 2
deadthr = 24 18
figsave = 1
filecomb = 0
filtype = 2 2
folder = C:\Imatest\Data\Uniformity\Blemish\
gamma = 1
hdchan = 2
hotpx = 2
hotthr = 231 18
hpf_set = 0.007032
lastfiles = “blemish_7-synth.JPG”
lineplot = 0
lpf_set = 0.03188
nchan = 4
nht_save = 2448 808 800 2336 750 400 480 3448 1280 484 485 450
nwid_save = 3264 1296 1280 3504 1000 400 640 4592 800 644 644 600
plot_image = 1 0 0 0 0 0
prevdisp = 4
rmcn = 4
roi = 1 1 3264 2448 1 1 1296 808 1 1 1280 800 1 1 3504 2336 1 1 1000 750 1 1 400 400 1 1 640 480 1 1 4592 3448 1 1 800 1280 1 1 644 484 5 6 639 480 1 1 600 450
saveCSV = 1
saveJSON = 1
saveXML = 1
save_answer = Yes
save_dir = C:\Imatest\Data\Uniformity\Blemish\Results\
save_file_list = 1 1 1 1 1 1 1 1 1 1 0 0
sideloc = 1
sidereg = 7
speedup = 0
thresh = 0.02 0.06 0.06 0.08 0.02
thumbcrop = 1285 1103 1584 1302
zone_bord = 6 6