How do I find the pixel size of connected components in an image and then compare pixel size of each connected component with the pixel size of connected components of the next frame and choose the approximately similar size connected components?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Prachi Sharma
am 22 Okt. 2016
Bearbeitet: Prachi Sharma
am 25 Okt. 2016
So,I am reading a video and then saving its frames and in each frame I am finding the connected components and then labelling them.Now lets say I have the image below.In this the pixel size of green cloud on left will be compared with pixel size of both green and red cloud in the second image.If the pixel size of red cloud in second image matches with the pixel size of green cloud in first image then they should save as a pair.Similar procedure needs to be followed for the red cloud in first frame.I have saved these frames but I don't know how to find the pixel size of these green and red clouds separately and then compare them with the next frame's clouds.How can I do that?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 22 Okt. 2016
It looks like you've already segmented the image into regions and then have labeled the image with bwconncomp() or bwlabel() already, and then are displaying with a color map or perhaps created an RGB image with
% Let's assign each blob a different color to visually show the user the distinct blobs.
coloredLabels = label2rgb (labeledImage, 'hsv', 'k', 'shuffle'); % pseudo random color labels
So, just put your labeled image into regionprops(), and get the areas
props = regionprops(labeledImage, 'Area');
allAreas = [props.Area];
Now that is just the areas. You don't know what area it corresponds to because as the blobs move around, what was blob #1 in one frame might suddenly become blob #2 or #9 or some other ID number. This is because of how the blobs are found. So you're going to have to do tracking if your blobs move around. You can do this if you also find the centroids and if the blob doesn't move very much from one frame to the next so you can just assign the blob numbers to the closest blob from the prior frame.
13 Kommentare
Image Analyst
am 25 Okt. 2016
Attach your lab array in a .mat file and I'll see what I can do later today with it to figure it out.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Computer Vision Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!