Colour segmentation on resistor color band and calculate the value

6 ビュー (過去 30 日間)
Ng
Ng 2012 年 12 月 11 日
編集済み: Stephen23 2023 年 2 月 12 日
I'm a beginner to Matlab. I need to do a color segmentation on a resistor color band, identify the color and do a calculation based on the color. Any guideline for this?
  6 件のコメント
vv_art
vv_art 2018 年 7 月 22 日
me too
Image Analyst
Image Analyst 2018 年 7 月 22 日
Exactly which code are you two having trouble understanding?

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

採用された回答

Image Analyst
Image Analyst 2012 年 12 月 11 日
I have color segmentation tutorials here if you're interested: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. Basically you need to find the regions of interest first - the bands. You might use a variety of techniques depending on how repeatable the lighting and positioning are from image to image. Then you can look at the mean RGB value of each band and see which "master" color it's closest to. If the band is closer red color than any other, then assume it's red.
  17 件のコメント
Image Analyst
Image Analyst 2012 年 12 月 30 日
編集済み: Image Analyst 2013 年 3 月 11 日
Good. Sounds like I helped you solve it.
Ng
Ng 2012 年 12 月 30 日
Thanks alot for your help. >.<

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

その他の回答 (1 件)

reginald kwenda
reginald kwenda 2015 年 2 月 19 日
編集済み: Image Analyst 2015 年 2 月 19 日
Hello guys, I am working on the same problem. I have managed to detect Red, Green, and Blue following an example that was given by Image Analyst ( http://www.mathworks.com/matlabcentral/answers/57356#comment_119461)
I have detected these colors off a resistor, but I don't know how to detect other colors such as yellow or brown.
  16 件のコメント
reginald kwenda
reginald kwenda 2015 年 3 月 24 日
移動済み: DGM 2023 年 2 月 12 日
i am getting errors with the if statements
Image Analyst
Image Analyst 2015 年 3 月 24 日
移動済み: DGM 2023 年 2 月 12 日
redMask is an image, so why is it the expression of an "if" statement - that doesn't make sense.
Also, you got the wrong values for green and blue - you swapped the values. Green should be 5 and blue is 6.

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

Community Treasure Hunt

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

Start Hunting!

Translated by