From: Kris zenitis on
Hello there, I ve got a small problem. I ve a black picture with white spots. I want to find the coordinates of the white spots. One spot could be a rectangular 2x2. I want to find and keep the first coordinates of the rectangular and in the case of one spot 1x1 just the coordinate. Any help??
From: Wayne King on
"Kris zenitis" <gio.1988(a)hotmai.com> wrote in message <i131k4$hle$1(a)fred.mathworks.com>...
> Hello there, I ve got a small problem. I ve a black picture with white spots. I want to find the coordinates of the white spots. One spot could be a rectangular 2x2. I want to find and keep the first coordinates of the rectangular and in the case of one spot 1x1 just the coordinate. Any help??

Hi Kris, is the matrix comprised of 0s and 1s? Is that what you mean by a black picture with white spots? In that case see the documentation for find()

>>doc find

You can locate the coordinates with that function.

Wayne
From: Image Analyst on
Kris zenitis:
Check out my demo - it does this:
http://www.mathworks.com/matlabcentral/fileexchange/25157
Essentially it's the same as almost all image processing apps:
1. Process to a point where you can threshold (you are most likely already at this point).
2. Threshold the image.
3. Call bwlabel()
4. Call regionprops()
Look at the "PixelList" measurement from regionprops():
" 'PixelList' &#8212; p-by-Q matrix specifying the locations of pixels in the region. Each row of the matrix has the form [x y z ...] and specifies the coordinates of one pixel in the region."
From: Kris zenitis on
Ok to be more precise. I have a picture img of 45x61. Every pixel of picture img is black
except some 10-20 points that have a price around one. I want with a mask 5x5 to find
the max prices every time in neighborhood of 5x5 and to paint the rest window black except the max point. What i try to do is that: i use col2im function. Now i have a matrix of 117 vectors of 25 dimensions. It is easy now to find the maximum of a vector. So I must re -paint the image with the maximum points now I cant find something with that

ImageAnalyst thank for your demo but i cant find how to use it in my problem.
From: Image Analyst on
Kris zenitis:
Then post your image because I can't understand why the standard threshold/label/regionprops method won't work for you. You can post it to http://drop.io
 | 
Pages: 1
Prev: Reassign values
Next: dicomwrite