hi, i want to ask how to detect red color for the circlar shape(blue color) in this image. can someone tell me the step? thanks. how to separate the color band? i dont underrstand how to declare the arrays?
http://www.flickr.com/photos/77154085@N06/?saved=1 I want to know how to get the shape circle with white color and the background is in black color. it means the arrow in the circle will be black color but the circle will be white color. the other background is black.how to do blue segmentation to get threshold image?i mean color threshold. can u tell me the step. i need it absolutely. plz help me!

 채택된 답변

Sukuchha
Sukuchha 2012년 2월 21일

1 개 추천

A = imread('http://farm8.staticflickr.com/7192/6915806857_cfb9d98996_m.jpg');
imshow(A,[])
B= A(:,:,3); % your blue band!
you can do morphological operation to get the circle !

댓글 수: 3

Tulips
Tulips 2012년 2월 21일
no..i mean how to detect the only circle shape of binary in white color but the background is in black color
Sukuchha
Sukuchha 2012년 2월 21일
use regionprops with eccentricity property.
circles have close to 0 eccentricity
Tulips
Tulips 2012년 2월 21일
can u show the code as im a newbie in matlab:(. do i need to separate the color band using looping?

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

Image Analyst
Image Analyst 2012년 2월 21일

1 개 추천

Looks like you already marked the situation as solved. If you have any additional questions, other than this, just ask again.

댓글 수: 9

Tulips
Tulips 2012년 2월 22일
hi,sir cud u pls explain how to set the array to detect the circle?im totally new in matlab.thx
Image Analyst
Image Analyst 2012년 2월 22일
I think I did that in my color segmentation demos. Did you try to run or adapt any of them? They will give you a much, much more thorough explanation than I can give here. I can tell you that you basically have to do color segmentation to get the blue, then you'll have a binary image. Then you might need to filter out small blue things and keep just the largest.
Tulips
Tulips 2012년 2월 23일
sir, i been tried the demos. but it seems tough for a beginner like me. cud u explain how to filter out the blue pixels?how to check it using matlab?
Image Analyst
Image Analyst 2012년 2월 23일
But it looks like you already marked this as solved by Sukuchha. Can you tell my why running the delta E program didn't work for you? Are you sure you drew somewhere in the blue area? It should work.
Tulips
Tulips 2012년 2월 23일
actually i didnt understand the code by image analysist.it looks complicated for a newbie like me.cud u explain me the step. i dont know to arrange the array/pixel for blue area so that I can threshold that area
Tulips
Tulips 2012년 2월 23일
A=imread('circleroad.jpg');
l=size(A);
for i=1:l(1)
for j=1:l(2)
for k=1:3
if (A(i,j,k) > 50)
A(i,j,k) = 0;
else
A(i,j,k) = 255;
end
end
end
end
image(A);
Jan
Jan 2012년 2월 23일
Shorter: A = 255 * (A > 50)
Tulips
Tulips 2012년 2월 23일
i just want to detect the shape only in white color . the background will be white.thats all.which part shud I re-edit
Image Analyst
Image Analyst 2012년 2월 23일
That code you posted is, well, let's say naive and not very robust or flexible, at best. Rose, you don't need to understand the code just to run it. Once you see that it works, you can take it line by line. It's not that hard. I just explained it to a chemist a half hour ago and she totally got it. A smart engineer like you should have no problem with well commented demo code like I always write.

댓글을 달려면 로그인하십시오.

Tulips
Tulips 2012년 2월 21일

0 개 추천

im sorry abt the question i have asked. i am asked to detect the blue color. i mean the circle shape.

댓글 수: 2

Jan
Jan 2012년 2월 21일
You can edit the question. This is much better than appending an "answer", which is no answer.
Tulips
Tulips 2012년 2월 21일
Simon do have any idea?

댓글을 달려면 로그인하십시오.

Image Analyst
Image Analyst 2012년 2월 25일

0 개 추천

Rose, let me ask you again to run my delta E app on your image. I just did right now and it did a nearly perfect job of getting the blue sign. You just need to do a hole fill to fill in some of the little white glints and tears on the sign. Why are you being so reluctant to run it? It's very simple. It just asks you to open your image and draw some part of the image that has the color you want to find. It doesn't even have to be all of the color, just some of the pixels with that color. Then it asks you for a number to say how close to that color do you want to find. It even suggests a good tolerance number for you. Then it finds them all. It can't get much easier. I don't know what else to suggest when something like I've already provided works so perfectly, unlike the other answer you accepted. Again, try it and you'll see.

댓글 수: 5

Tulips
Tulips 2012년 2월 28일
sir, thx, i already been find the answer. however, instead of RGB color, can I know how to detect the yellow band color. as far as i am corcerned, the RGB band color can be used to separate the respectively red, green, blue of threshold segmentation color. i just want to know how to separate the yellow band color. is there any idea. thank you!!
Image Analyst
Image Analyst 2012년 2월 28일
Same answer. Please reread it. My delta E app can detect any color, yellow, purple, orange, chartreuse, Singapore sunset saffron, blanched almond, papaya whip, whatever. http://www.w3.org/TR/css3-color/#svg-color
Tulips
Tulips 2012년 2월 29일
thank you sir, u really help. need to study the algortihm more. and i want to know, to detect either red , blue or yellow color , the threshold range for hue, saturation and value must be set after we did RGB2HSV conversion. in ur code that u hv showed u just only did yellow color detection. so i want to know what is the range of hue,saturate and value of threshold in order to detect either red or blue. is it same with ur coding or not?
Tulips
Tulips 2012년 2월 29일
i simply didnot understand the deltaE app coding to detect blue color? can u help by giving me explanation?
Tulips
Tulips 2012년 2월 29일
based on delta E app. it need Lab . instead of using Lab channel color, can i rgb2hsv conversion to detect blue or red color? im sorry if i have asked u multiple question:(

댓글을 달려면 로그인하십시오.

Elijah Tapiwa Chipato
Elijah Tapiwa Chipato 2018년 5월 9일

0 개 추천

How do I detect yellow?

태그

질문:

2012년 2월 21일

답변:

2018년 5월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by