In this example, we will try to isolate the red-orange tips of the fence in the previous image, using manual thresholding of all channels. The ultimate goal is to acquire a binary image with only pixels belonging in the area we want, being equal to one. Let's start by using imtool
to get a better idea of what the RGB values of the pixels we want to isolate are.
First, we load the image and call
imtool
:>> img = imread('my_image_color.bmp'); >> imtool(img);
Then, we will choose Inspect Pixel Values by clicking on the second icon from the left and placing our cursor on one of the red tips to see the RGB values of its neighbor pixels. We can repeat the process for other tips and also for getting samples from other image areas.
Now that we have an idea of what the RGB values are for our ROIs, we can begin the process of thresholding. By observing the color values with the help of
imtool
, we can set a general thresholding rule for...