how to get the image after using impixel() ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Manoj Kumar
el 24 de Dic. de 2014
Comentada: Manoj Kumar
el 26 de En. de 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 comentarios
Respuesta aceptada
Image Analyst
el 24 de Dic. de 2014
They already are in the image. You can't even use impixel() if you don't already have an image.
7 comentarios
Image Analyst
el 26 de En. de 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.
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!