The RGB vectors for white and red color are same for this image (Matlab)

3 ビュー (過去 30 日間)
Zabir Al Nazi Nabil
Zabir Al Nazi Nabil 2017 年 4 月 4 日
コメント済み: Image Analyst 2017 年 4 月 5 日
I was working with this picture in Matlab to detect color of the circles. This is a 512 by 512 jpeg image.
I am finding the centers of circles using imfindcircles, then I am taking the R,G,B components of some points near center of each circle to detect color.
But, I am confused because for both the red and white circles, I find that the R, G, B components are same [239 227 175].
I am new to image processing, so can anyone explain what's actually happening here.

採用された回答

Jan
Jan 2017 年 4 月 4 日
編集済み: Jan 2017 年 4 月 4 日
[239, 227, 175] is the color of the background. I guess boldly that you have confused X and Y components of the coordinates.
The red dot has the color [237, 27, 36], the black dot [0, 0, 0] and the white dot is [255, 255, 255].
The problem might get clear, if you post the relevant part of your code.
  4 件のコメント
Zabir Al Nazi Nabil
Zabir Al Nazi Nabil 2017 年 4 月 4 日
I have found the problem, I was rounding the center coordinates using uint8 which was causing an overflow.
Image Analyst
Image Analyst 2017 年 4 月 5 日
If the image has more than 255 rows or columns, it will clip it to 255 so you couldn't examine any pixels further out. You should have used round() instead of uint8() and then it would be a double but still an integer and you would not have had the problem.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by