how to get the image after using impixel() ?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Image Analyst
2014-12-24
They already are in the image. You can't even use impixel() if you don't already have an image.
7 个评论
Image Analyst
2015-1-26
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!