how to get the image after using impixel() ?
2 views (last 30 days)
Show older comments
Manoj Kumar
on 24 Dec 2014
Commented: Manoj Kumar
on 26 Jan 2015
hi,
I used impixel() to select the particular pixels in an image.
pixelValues = impixel();
My problem is in displaying the selected pixels in the form of a image.
Can any one help me.
Thanks...
0 Comments
Accepted Answer
Image Analyst
on 24 Dec 2014
They already are in the image. You can't even use impixel() if you don't already have an image.
7 Comments
Image Analyst
on 26 Jan 2015
If you're using ginput() to have the user click on a blob, then you'll have to get the distances of that point to the centroids of all other blobs. This will work as long as the blobs are about the same diameter, but not, for example, if you click on the outer edge of a huge blob that is closer to the center of a nearby small blob than it is to the center of the huge blob. Another way is to use that point to create a binary image with just the pixel set where the user clicked on. Then use imreconstruct() to extract just the blob they clicked in. However if they actually missed and clicked in the black space, it won't get anything. If you want the nearest blob even if they didn't click inside one, then you'll have to call regionprops and get the PixelIdxList of all the pixels in all blobs and then see which labeled pixel is closest.
It really depends on how you define closest and what you want to do if the user "misses" and clicks outside a blob.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!