determine pixel length and width of the body
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello master,
I have an image that has been processed using canny edge and want to count the number of pixels in each area, what command should i use?

0 commentaires
Réponses (2)
Image Analyst
le 28 Déc 2021
You do not have many closed areas. It looks like, for some reason, you did edge detection on a cow. I think you should probably use SegNet instead since Canny will not give you a closed contour around the outermost perimeter of the cow.
10 commentaires
Image Analyst
le 29 Déc 2021
Yes. Once you have the area of interest, the area of the cow from a side view, you'll have to calibrate it to real world units like centimeters. So you'll need to have an object of known size, at the same distance as the cow, in the field of view, like a meter stick or piece of photocopy paper or something like that. Then you measure that and compute the calibration scale factor in cm/pixel. See attached demo.
yanqi liu
le 28 Déc 2021
yes,sir,may be use bwlabel and regionprops to get the area information
may be upload your origin image,then we can do some analysis
5 commentaires
yanqi liu
le 29 Déc 2021
yes,sir,this method can not use in common,it use some stat segment method,so it is just a discuss demo
if meet other image,may be use DeepLearning model,such as segnet、unet to make some auto segment,but it aslo can not use to every other image
Image Analyst
le 29 Déc 2021
Modifié(e) : Image Analyst
le 29 Déc 2021
Correct, just to build on that (for other people - I'm sure you know) with an example: for example if you trained only with side views of cows then came along with a front or rear view, then segnet might not find the accurate shape and of course the area wouldn't be right and thus the volume of the cow wouldn't be right.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


