Approximation of area of an image

조회 수: 4 (최근 30일)
Holmbrero
Holmbrero 2021년 1월 5일
댓글: Timo Dietz 2021년 1월 5일
Hi!
I want to approximate an area with a circle as in the attached image (which is manually drawn).
I have three somewhat distinct peaks in the histogram but i think the image needs to be pre-processed in order to achive a good result. I have tried to smoothen the image, opening and closing but it does not get me to where i want to be.
Any suggestions would be greatly appriciated!
  댓글 수: 2
Timo Dietz
Timo Dietz 2021년 1월 5일
편집: Timo Dietz 2021년 1월 5일
I guess you'd like to draw a circle around that area which shows only few or even no voids, right?
Which histogram are you talking about? Color frequency versus pixel location?
Holmbrero
Holmbrero 2021년 1월 5일
That is exactly what i want!
The histogram is for the pixel intensity values of the whole image.

댓글을 달려면 로그인하십시오.

답변 (1개)

Timo Dietz
Timo Dietz 2021년 1월 5일
편집: Timo Dietz 2021년 1월 5일
Personally, I would try this:
1) Introduce an intensity threshold. All pixels below will be treated as 0, all above as 1.
2) Now, start from center of the image and move to the image boundary in multiple rays with different angle (0 to 360°) - like a star shape - and stop as soon as a 0-pixel is hit.
3) Collect all ray lengths. The minimum gives you the shortest distance (from center) where a void exists and thus the radius.
4) Play around with angle step / number of rays and intensity threshold to adjust processing time to needed detection coverage.
What do you think? Do you get my point?
  댓글 수: 2
Holmbrero
Holmbrero 2021년 1월 5일
Sound like a good approach. Have you tried to implement something similar?
I figure i could create a circle starting from with an increasing radius and as soon as the circle contains a threshold value of voids the circle stops expanding and thus the minimum radius is found.
Timo Dietz
Timo Dietz 2021년 1월 5일
Yes, that's in priciple similar. Maybe it's slower since you have to check much more pixels inside the circle - each time the circle radius increased.
Further, working with rays, gives you the possibility to re-center the circle afterwards pretty easy, since you know the directions.
Anyway, I think you got my point :-)
Yes, I did something like this in the past with Python. I had to find a minimum square which sourrounds a graphic in the center. It's the opposite but the same principle.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by