Get the position of pixels with specifed color

조회 수: 1 (최근 30일)
nghia nguyen
nghia nguyen 2011년 4월 19일
Hi! I have a problem.I have a picture with two circle in it.A red and a green.I want to get the postion of their centers and connecting them and how can I get the position of all red pixel in that picture.Please help me and thanks a lot

채택된 답변

Walter Roberson
Walter Roberson 2011년 4월 19일
I answered about finding the positions a moment ago in response to your earlier post.
For the matter of finding all the red pixel in an image, first you have to define what "red" means. If a pixel has red turned on as high as it can go also happens to have blue turned on to (say) 1/10th of the maximum, then is that pixel still "red" ? If so, then how far could the intensity of the red component be reduced and you would still deem the pixel to be "red" instead of "purple" ?
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 4월 20일
Start with something that is pure red. Mix more and more white in by increase the G and B. With G and B at their lowest non-zero settings, pretty much everyone would agree that the color was still "red". Okay, now bump up the G and B to make it a lighter red. At some point it starts to look pink-ish but you might still identify it as red. Keep pushing up the G and B until you get something that you say is no longer "red" but is instead "pink". How where _exactly_ is that boundary between "red" and "pink" ? And how would the boundary change if the original red was not 100% red but was (say) only 95% of the maximum strength of red? If it was 75%? 50%? 25% red to start with?
Red is not an absolute class: it is a fuzzy concept. You have to tell us exactly what *you* mean by red before we can tell you how to detect the "red" pixels apart from the ones that are (say) merely a mauvey shade of pinky-russet.
nghia nguyen
nghia nguyen 2011년 4월 20일
Thanks so much.You helped me a lot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by