inrangecv

Gets the handle Rto a binary image specifying which pixels are within the specified range.

Syntax

R = inrangecv(cvhandle, lower, upper)

Inputs

cvhandle
Handle of the image from a imreadcv command.
Type: integer
lower
Real vector or scalar containing lower bound element(s). Size of lower must be equal to the number of channels in the image represented by cvhandle.
Type: double | vector
upper
Real vector or scalar containing upper bound element(s). Size of upper must be equal to the number of channels in the image represented by cvhandle.
Type: double | vector

Outputs

R
Handle of the binary image showing specifying which pixels are in range. The output will be the same size as the image represented by cvhandle. Pixels in R will be 0 if they are not in the range and 255 otherwise.
Type: integer

Examples

Checks if image is in range with scalar bounds :

cvhandle = imreadcv('image1.jpg');
R = inrangecv(cvhandle, 0, 255);
Checks if image is in range with vector bounds :

cvhandle = imreadcv('image1.jpg');
R = inrangecv(cvhandle, [0 100 0], [255 255 255]);