|
|
Subject:
Image processing
Category: Computers > Graphics Asked by: sailr-ga List Price: $20.00 |
Posted:
15 Jan 2005 01:12 PST
Expires: 19 Jan 2005 15:56 PST Question ID: 457564 |
Hi, I got a picture that has different coloured areas in it. i would like to output only certain(green in my case) coloured areas in my final picture. to put in steps: 1) read the image 2) find the color at every pixel 3) write only those pixels whose color is green. 4) write the image it doesn't matter which procedure(steps) you use. all that is needed is my final picture should have only green coloured areas, all the other areas should be deleted(either made black or white) i would like to have the program written either in C/C++ or matlab. I would really appreciate your help. Thank you! | |
| |
| |
| |
| |
| |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: Image processing
From: puripant-ga on 19 Jan 2005 09:00 PST |
Frankly, I think that you can do what you want easily by using Photoshop, if I understand your question correctly. However, I create a short piece of code in Matlab that can do your job well. Firstly, point Current Directoty in Matlab to your desired folder (where it contains your image file.) In this code, I will point to your attached filename. I = imread('sai.jpg'); threshold = 150; J = I(:,:,2) > threshold; figure, imshow(I); figure, imshow(J); J is the result image whose active pixel is the pixel whose green value in I is more than the threshold. You can change the threshold as you want. I found that 150 works well for your image. If you want more information about Matlab programming or Image Processing, I am very pleased to clarify my answer. |
Subject:
Re: Image processing
From: puripant-ga on 19 Jan 2005 09:36 PST |
I have revised my code now. Here it is. [filename,pathname] = uigetfile({'*.*','All Files'},'Select the image file'); I = imread([pathname,filename]); thresholdArray = inputdlg({'Red: low threshold', 'Red: high threshold', ... 'Green: low threshold', 'Green: high threshold', ... 'Blue: low threshold', 'Blue: high threshold'}, ... 'Enter the threshold values', ... 1, ... {'0', '255', '150', '255', '0', '255'}); J = (I(:,:,1) >= str2num(thresholdArray{1})) .* (I(:,:,1) <= str2num(thresholdArray{2})) .* ... (I(:,:,2) >= str2num(thresholdArray{3})) .* (I(:,:,2) <= str2num(thresholdArray{4})) .* ... (I(:,:,3) >= str2num(thresholdArray{5})) .* (I(:,:,3) <= str2num(thresholdArray{6})); figure, imshow(I); figure, imshow(J); |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |