data = imread('C:\Users\home\Desktop\project\identi\abc.jpg');diff_im = imsubtract(data(:,:,3), rgb2gray(data));%Use a median filter to filter out noise
diff_im = medfilt2(diff_im, [3 3]);diff_im = im2bw(diff_im,0.18);diff_im = bwareaopen(diff_im,300); bw = bwlabel(diff_im, 8); stats = regionprops(bw, 'BoundingBox', 'Centroid'); % Display the image
imshow(data)hold onfor object = 1:length(stats)bb = stats(object).BoundingBox; bc = stats(object).Centroid;rectangle('Position',bb,'EdgeColor','r','LineWidth',2) plot(bc(1),bc(2), '-m+') a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2))))); set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'black');end hold off
MATLAB: This is the matlab code for detect blue color , by using this equation is it possible to find yellow color??…please help me to find an yellow color in rgb
color segmentationdetect yellow color in an imageImage Processing Toolboxyellow
Best Answer