Prev: Roc and cross-validation
Next: gui help plzz....
From: Ng on 29 Mar 2010 09:13 Hi, basically i want to count the number of gold pixels in a picture. But since different pictures that i used have different gold colours, i need to be able to somehow select that object and matlab will tell me the RGB of the gold colour. Then i can count the gold pixels. So i want to know if there is any way for me to just click the object and matlab will tell me the RGB of the gold selected. Thanks in advance.
From: Ng on 29 Mar 2010 09:19 Or is there any simpler way?
From: ImageAnalyst on 29 Mar 2010 09:40 Try imtool, like this: imtool('board.tif') you can mouse around and it will tell you the RGB values in the status bar at the bottom of the window.
From: Ng on 29 Mar 2010 11:18 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <55f04db8-5323-4b2d-8f5d-233565812dd4(a)t23g2000yqt.googlegroups.com>... > Try imtool, like this: > imtool('board.tif') > you can mouse around and it will tell you the RGB values in the status > bar at the bottom of the window. Thanks ! Now i got a problem, even different parts of my gold have different RGB values. So it possible to eliminate colours that i don't want in a picture? I have tried it using greyscale ( Pic1 = Pic < 20) but it couldn't work for RGB.
From: ImageAnalyst on 29 Mar 2010 11:30
Perhaps you'd like to study this demo/tutorial: http://www.mathworks.com/matlabcentral/fileexchange/26420-simplecolordetection Description This script is a demo that shows you how to find objects of a certain color in an image. For this example I'm using the standard onion, peppers, or canoe image that ships with the Image Processing Toolbox. You can also select one of your own color images instead if you wish. Then I separate the image into its component red, green, and blue color bands. I compute thresholds, and ultimately find a mask for the red objects. Prompts will guide you through the demo step by step. I multiply this mask by the original image to show the image with only the red objects showing and everything else blacked out. This script can be adapted to find other colors (white, green, blue, yellow, etc.) If you want to do any measurements of the red objects, I refer you to my blob measurement demo file at http://www.mathworks.com/matlabcentral/fileexchange/25157 Requires the Image Processing Toolbox. Tested with R2008b and R2010a. Acknowledgements This submission has inspired the following: Extract Red Objects from Aerial Image Required Products Image Processing Toolbox |