determine pixel length and width of the body

5 次查看(过去 30 天)
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?

回答(2 个)

Image Analyst
Image Analyst 2021-12-28
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 个评论
Image Analyst
Image Analyst 2021-12-29
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
yanqi liu 2021-12-28
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 个评论
yanqi liu
yanqi liu 2021-12-29
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
Image Analyst 2021-12-29
编辑:Image Analyst 2021-12-29
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.

请先登录,再进行评论。

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by