I suppose "polygon" and "inpolygon" can be used to achieve the goal.
How to select the desired object in a certain region in an image?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all,
I have plenty images to process and calculate the frost area/ volume on a heat exchanger. First, I have some local images and I used matlab to crop them to a certain size that I have only two fins. Then, I want to calculte the triangle area between fins and tubes because I want to calculate the frost area = the difference of this trangle area between images. Thanks to this forum, I've been able to crop the images, deblur the images, covert them to binary image, find the closed area/ objects in the image, label the objects and calculate the areas.
However, there are about 30 objects in each image and I just need two of them in the central part (The green and yellow triangles, for example). How can I select and output the information, like shape, areas, centroids of those two objects? Can I achieve this based on the boundary limitation of the initial triangle region? Also, How can I plot the difference of image 1 and 2, so that I can show the frost thickness?
Thank you in advance!
0 commentaires
Réponses (2)
Image Analyst
le 4 Juil 2020
Just check the area and centroid and throw out those that aren't close enough to the middle and large enough
labeledImage = bwlabel(binaryImage);
props = regionprops(labeledImage, 'Area', 'Centroid');
allAreas = [props.Area];
xy = vertcat(props.Centroid);
y = xy(:, 2);
[rows, columns] = size(binaryImage);
keepers = (area >= minimumAcceptableSize) & (abs(y - rows/2) > rows/8)) % Find big blobs in the middle quarter of the image.
% Get new binary image
binaryImage = ismember(labeledImage, find(keepers));
% Get new properties
props = regionprops(binaryImage, 'Area')
6 commentaires
Image Analyst
le 4 Juil 2020
I don't see a problem. When the frost grows and the ice blobs merge, of course they will eventually merge into a giant blob, and your measurements will reflect that. Why not just subtract the time zero image from all the others to find out what pixels are now icy? The total area of all ice blobs would be a good metric for how much frost accumulation there is. Why do you need anything beyond that?
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!