I am getting an error while running regionprops. How?

5 visualizaciones (últimos 30 días)
Ad
Ad el 19 de Abr. de 2017
Comentada: Ad el 23 de Abr. de 2017
[L,N] = superpixels(I,50);% superpixels=44
props = regionprops(L,'MeanIntensity','PixelValues','PixelList','PixelIdxList');
I am getting this error."REGIONPROPS needs I as an input to calculate 'MeanIntensity'".
Thankyou

Respuestas (2)

Image Analyst
Image Analyst el 19 de Abr. de 2017
You need to pass in the original image. You can't just pass in the labeled image. If you want the mean intensity of regions in an image, of course you need to pass in the image itself. The labeled image L merely tells where the regions are in the original image. You have to pass in the image itself as the second argument if you want to measure its intensities in those regions.
  13 comentarios
Walter Roberson
Walter Roberson el 23 de Abr. de 2017
If the color distance between P1 and P2 is "low", and the color distance between P2 and P3 is "low", but the color distance between P1 and P3 is not "low", then how do you want to handle the situation?
Ad
Ad el 23 de Abr. de 2017
@walter Roberson sir,
Do you mean pixel or superpixel by P1? If P1 means pixel, that is why I want to convert superpixel properties to all pixels within that superpixel region.
Thank you so much for pointing that out.
How do know what are the superpixels connected to each other ?

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 19 de Abr. de 2017
You are passing in a label matrix but asking for mean intensity. In order to do both at the same time you need to pass the intensity matrix as well. If I recall correctly you would pass it as the second argument.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by