フィルターのクリア

spot red object in a image

1 回表示 (過去 30 日間)
Emmanuel
Emmanuel 2014 年 5 月 13 日
回答済み: Image Analyst 2014 年 5 月 13 日
Hello!
Can You please tell me as to how to spot red markers in an image. here is my code:
I = imread('pic', 'png'),
data = imsubtract((:,:,1) , rgb2gray(I));
I am getting an array cause image is a 2D array. How do I change this code?
  1 件のコメント
Walter Roberson
Walter Roberson 2014 年 5 月 13 日
What were you hoping for instead of an array ?

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2014 年 5 月 13 日
Your first argument to imsubtract is nonsense. It's not even an image, it's just (:,:,1). I'm surprised it didn't throw an error. Even if it were an image, subtracting it from the gray scale version of the image will not be very good or robust except for high contrast images.
That's from the Delta E method where I found red, but you'll probably want to use the HSV method: http://www.mathworks.com/matlabcentral/fileexchange/28512-simple-color-detection-by-hue

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by