Hi, since the image link isn't valid, I'll make the assumption that your task involves the following:
- Detecting the yellow color (the particular shade) correctly.
- Figuring out the location (of all the pixels that are yellow)
I'll also make the assumption that you aren't aware of the RGB range your particular shade of yellow lies in and first you would like to find out what the min,max values of R,G,B are for your color. In case you already know, then you can just skip the part and directly use the min,max values.
TestImg = imread('yourImage.jpg');
TestImg_R = TestImg(:,:,1);
TestImg_G = TestImg(:,:,2);
TestImg_B = TestImg(:,:,3);
chosen_points = impixel(TestImg);
MAXC = max(chosen_points);
MINC = min(chosen_points);
r_max = MAXC(1) + 1;
r_min = MINC(1) - 1;
g_max = MAXC(2) + 1;
g_min = MINC(2) - 1;
b_max = MAXC(3) + 1;
b_min = MINC(3) - 1;
OutImg = TestImg_R<r_max & TestImg_R>r_min & ...
TestImg_G<g_max & TestImg_G>g_min & ...
TestImg_B<b_max & TestImg_B>b_min;
subplot(1,2,1);
imshow(TestImg);
subplot(1,2,2);
imshow(OutImg);
OutImg is exactly your location map of all the yellow pixels. It has 1's for all yellow pixels and 0's for everything else. You can now use the indices of 1's as locations of the yellow color in the image.
Here's a sample output for when I chose green colored pixels in my image: