scan through bwconncomp PixelIdxList in another image

8 visualizaciones (últimos 30 días)
Ran Mishael
Ran Mishael el 20 de Nov. de 2020
Comentada: Ran Mishael el 24 de Nov. de 2020
Hello. I am working on an image processing project.I have generated a binary image from an image and used the bwconncomp to detect closed contours.
Next I would like to scan each Pixel group in another image and analyse the value that is in them.
gammabin = zeros(size(lens_mask)); % Creating a zero Matrix with image size
gammabin(gammafactor > 0.038) = 1; % Setting my binary limit value
CCgamma=bwconncomp(gammabin); % Generating Closed contour struct
% größte Region identifizieren - das ist die Linse
numPixels = cellfun(@numel,CCgamma.PixelIdxList); Generating %array with number of pixels for every cluster
% Looking for clusters bigger than 25
for i = 1:CCgamma.NumObjects
if numPixels(i) > 25
for j = 1 : numPixels(i)
% This is were I am kind of stuck
end
end
end
  4 comentarios
Ran Mishael
Ran Mishael el 24 de Nov. de 2020
First I would like to thank you all for responding on my question.
KALYAN ACHARJYA:
numPixels is a vector that holds the amount of pixels in a closed contour (White) whitin the binary image gammabin. I have attached the figure.
Image Analyst:
Lens_mask, This is a binary matrix that helps me masking the background around my object, please take a look at the attachment.
As you know the function bwconncomp returns a structere that holds the amount of closed contours within a binary image, and the coordinaates of these closed contours. I would like to be able to take these coordinates and scan through them on another image (That has the same size).
Ran Mishael
Ran Mishael el 24 de Nov. de 2020
Thank you all for your support. I was able to find a solution using linear indexing. apperantly every cell in the object PixelIdxList is a vector that holds all linear indexes of a certain closed contour within a picture.

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by