Conversion_AdaptThresh
Using of command
Command is use for apply treshold value to selected image.Threshold is calculated individually for each pixel according adaptive method. Adaptive method is explained in command parameters. Source picture must be grayscale.Destination pixture is binary.
Commands parameters
Command has 8 parameters:
- Source picture: You need select source picture.Source picture must be single channel and must be activated before use of this function. You can select Picture_0 to Picture_19.
- Destination picture:You need select destination picture where result of threshold function will be stored.Destination picture must be single channel and must be activated before use of this function.Dimension of destination picture (width, height) must be same as in source picture.You can select Picture_0 to Picture_19. Destination picture can be same as source picture
- Adaptive method:You need select adaptive threshold algoritm.
- ADAPTIVE_THRESH_MEAN_C: Threshold value T(x,y) is calculated:
T(x,y) is the mean of blockSize x blockSize neighborhood of (x, y) , minus C constant
- ADAPTIVE_THRESH_GAUSSIAN_C: Threshold value T(x,y) is calculated:
T(x,y) is the weighted sum (i.e. cross-correlation with a Gaussian window) of of blockSize x blockSize neighborhood of (x, y) , minus C constant
- Threshold type: You need select threshold type:
- THRESH_BINARY: destination pixels dest(x,y) are calculated:
if(src(x,y)>T(x,y)) dest(x,y)=255
else dest(x,y)=0
- THRESH_BINARY_INV: destination pixels dest(x,y) are calculated:
if(src(x,y)>T(x,y)) dest(x,y)=0
else dest(x,y)=255
- Block size from: You can select from where you will read block size number. You can select Variable_0 to Variable_99 (in this case Block size number will be read from selected variable) or Number. If you select option "Number" you will select Block size number in the next parameter.
- Block size number: This parameter is active only when you select onption "Number" in previous command. You can set Block size number to this line
- C constant from: You can select from where you will read C constant number. You can select Variable_0 to Variable_99 (in this case C constant number will be read from selected variable) or Number. If you select option "Number" you will select C constant number in the next parameter.
- C constant number: This parameter is active only when you select onption "Number" in previous command.You can set C constant number to this line.
Error codes
- Error code -11: Bad position in variable array in block size or c constant value variable. Error means that variable for BlockSize number or c constant is not from range 0 to 99. Check command format in test program file.
- Error code -12:Bad position of source picture in picture array.Error means that source picture is not from range 0 to 19. Check command format in test program file.
- Error code -13:Bad position of destination picture in picture array. Error means that destination picture is not from range 0 to 19. Check command format in the test program file.
- Error code -14:Source image is not alocated. Source image must be alocated before this command.
- Error code -15:Destination image is not alocated. Destination image must be alocated before this command.
- Error code -16:Bad channel number in source image. Source image must be single channel.
- Error code -17: Bad channel number in destination image.DEstination image must be single channel.
- Error code -100: OpenCV error. Explanation of this error will be displayed in result window.OpenCV error is reported also when width or height of source or destination picture are not same.