Orange Color isolate from the image

Hello I am new in Image process can you help me please hoe can I isolate the orange color from the picture and show the orange component?

답변 (3개)

Walter Roberson
Walter Roberson 2016년 10월 9일

0 개 추천

댓글 수: 2

Walter Roberson
Walter Roberson 2016년 10월 10일
Display your image. Turn on the data cursor in the figure toolbar -- it is the one to the left of the paint-brush. Move the cursor to some points that you consider "orange" and notice the RGB values that are shown. Make sure that your code considers those pixels to be "orange".
Image Analyst
Image Analyst 2016년 10월 10일
Here is a site you'll find interesting. http://colorthesaurus.epfl.ch/
It lets you click on a color in a palette and gives you the various names for it in different languages. Or you can type in the name and see the color and other names for it in other languages:

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

Jakub Rysanek
Jakub Rysanek 2016년 10월 9일

0 개 추천

You can define a set of RGB codes that define "orange" color and then apply image thresholding like this:
% Load image from a file
img = imread('photo.jpg');
red_layer = img(:,:,1);
green_layer = img(:,:,2);
blue_layer = img(:,:,3);
% Define RGB code range for orange color
threshold_red = 255;
threshold_green = [130 165];
threshold_blue = 0;
% Apply thresholds
orange_pos = red_layer==threshold_red & ...
green_layer>=threshold_green(1) & ...
green_layer<=threshold_green(2) & ...
blue_layer==threshold_blue;
orange_pos gives you 0/1 indication of orange color per pixel.

댓글 수: 5

Walter Roberson
Walter Roberson 2016년 10월 9일
편집: Walter Roberson 2016년 10월 9일
Unfortunately, "Orange" is not a rectangular RGB region.
Survey says...
Arch Man
Arch Man 2016년 10월 10일
when i applied this code the result image is totally black
Walter Roberson
Walter Roberson 2016년 10월 10일
Then your idea of orange is not the same as Jakub's. If you were to define what is and is not orange and were to tell us then we could assist you with coding.
Image Analyst
Image Analyst 2016년 10월 10일
You might have forgot to use [] in imshow(), or your image is not uint8 or in the valid range after your processing.
Walter Roberson
Walter Roberson 2016년 10월 10일
Jakub's definition of "orange" relies upon Red exactly 255 and Blue exactly 0, and Green between 130 and 165. If the "orange" in Izziddin Banimenah's images happened to have Red 254 or Blue 1, then Jakub's code would not find those regions. This is not a bug in Jakub's code: it is a problem with the meaning of "orange" not being specified by Izziddin Banimenah.

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

Image Analyst
Image Analyst 2016년 10월 9일

0 개 추천

Try the color thresholder app on the Apps tab of the tool ribbon. Or else see my File Exchange for color segmentation demos. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

카테고리

도움말 센터File Exchange에서 Language Support에 대해 자세히 알아보기

제품

질문:

2016년 10월 9일

댓글:

2016년 10월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by