MATLAB Answers

Find the diameter of the parts in an image processing?

조회 수: 9(최근 30일)
Torkan
Torkan 10 Jan 2020
댓글: Guillaume 10 Jan 2020
Hello,
Does anybody have any idea how can I calculate the average diameter of the parts attached here? The white parts ar cylinders actually with diameters in Nano size.
Would you please help me to write a code such that I can catch the diameters?
12.PNG
Thanks

  댓글 수: 0

로그인 to comment.

답변(1개)

Alex Mcaulley
Alex Mcaulley 10 Jan 2020
One approach would be:
  1. First, you need to segment the objects you want using any segmentation function, for example imbinarize, or a manual threshold.
  2. Then, Using regionprops you can obtain the perimeter of each segmented object
  3. Finally, to obtain the diameters is just:
diameter = perimeter/pi

  댓글 수: 6

표시 이전 댓글 수: 3
Torkan
Torkan 10 Jan 2020
Thank u
The scale is actual actually in the figure!
How can I see the pixels?
Matt J
Matt J 10 Jan 2020
Torkan's answer converted to comment:
I used stats = regionprops('table',BW,'Centroid','MajorAxisLength','MinorAxisLength') and it gives nothing for major and minor axis. It seems that as you said the resolution makes problem.
Guillaume
Guillaume 10 Jan 2020
As I said, use imtool or imshow to look at the image.
resolution is a bit of an overloaded word. You have the optical resolution, i.e. physical unit/pixel (in your case ) which you can determine by measuring the length of the line in your image (not the most accurate method but of it's all you have...). Resolution is also used for the size of the image in pixels. If your images are only 170x315, then that's a very low resolution. In that image your white cylinders are only 2 or 3 pixels in diameter, so an error of meaurement of one pixel is a 50 % mesurement error. The only way to reduce that error is to have a sensor with more pixels or increase the optical magnification so that the cylinders take more pixel. An error of 1 pixel for a cylinder of diameter 20 pixels drops the measurement error to 5 %.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by