Prev: Roc and cross-validation
Next: gui help plzz....
From: Ng on 6 Apr 2010 04:40 Cool thanks. I've studied it and i was wondering what does greythresh() does? I tried to google it but i don't understand it. ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <8986c18e-12ad-472f-acd2-b8be7d754c81(a)q15g2000yqj.googlegroups.com>... > 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
From: ImageAnalyst on 6 Apr 2010 06:19 It's in the help: graythresh Global image threshold using Otsu's method Syntax level = graythresh(I) [level EM] = graythresh(I) Description level = graythresh(I) computes a global threshold (level) that can be used to convert an intensity image to a binary image with im2bw. level is a normalized intensity value that lies in the range [0, 1]. The graythresh function uses Otsu's method, which chooses the threshold to minimize the intraclass variance of the black and white pixels. Multidimensional arrays are converted automatically to 2-D arrays using reshape. The graythresh function ignores any nonzero imaginary part of I. [level EM] = graythresh(I) returns the effectiveness metric, EM, as the second output argument. The effectiveness metric is a value in the range [0 1] that indicates the effectiveness of the thresholding of the input image. The lower bound is attainable only by images having a single gray level, and the upper bound is attainable only by two- valued images. Class Support The input image I can be of class uint8, uint16, int16, single,or double and it must be nonsparse. The return value level is a double scalar. The effectiveness metric EM is a double scalar. Examples I = imread('coins.png'); level = graythresh(I); BW = im2bw(I,level); imshow(BW) See Also im2bw Reference [1] Otsu, N., "A Threshold Selection Method from Gray-Level Histograms," IEEE Transactions on Systems, Man, and Cybernetics, Vol. 9, No. 1, 1979, pp. 62-66.
From: Ng on 13 Apr 2010 10:43
I am now able to find the RGB values of gold in the picture, i can set the range , filter them out and count them but i want to make the finding of the RGB values of gold easier. By using imtool i am able to get the RGB values, but i want to be able to somehow by clicking onto different parts of a picture , their RGB values will be saved into a variable( or something else ). And thus use a program to find the largest and smallest values in the variable so that i can set the range. How do i do this? |