How to calculate the curvature of a boundaries in binary images?

조회 수: 27 (최근 30일)
Meshooo
Meshooo 2014년 11월 26일
댓글: Image Analyst 2022년 12월 10일
Dear all,
I have a binary image that contains one shape as I show below:
I want to represent the curvature using color coding of the boundariessimilar to image I got from the video in this link http://en.wikipedia.org/wiki/Curvature
Does anyone knows how to do that?
Any help or suggestion will be appreciated.
Meshoo

채택된 답변

Image Analyst
Image Analyst 2014년 11월 27일
Use bwboundaries to get a list of the (x,y) boundary coordinates. Run around that border taking a section of the curve, say 9 elements, and fit a polynomial to it. Knowing the derivative of the curve model you used, and the coefficients polyfit() gave you, you can get the curvature at each point. Then run around the list of (x,y) edge coordinates using a marker color that corresponds to the curvature. Try to program that up. If you can't do it all , then post what you have and I'll try to help with the rest.
  댓글 수: 19
Francesco Pignatelli
Francesco Pignatelli 2022년 12월 9일
@Image Analyst I have followed this post and I saw your comments and you mentioned that "Knowing the derivative of the curve model you used, and the coefficients polyfit() gave you, you can get the curvature at each point.". My question is, how is it possible to get the derivatives?
At the current stage, I am at:
boundaries = bwboundaries(binaryImage);
x = boundaries{1}(:, 2);
y = boundaries{1}(:, 1);
So I have x and y now.
Image Analyst
Image Analyst 2022년 12월 10일
@Francesco Pignatelli see attached demo that does what I said. Adapt as needed. If you need more help, start your own discussion thread and attach your (x,y) data.

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

추가 답변 (3개)

Preetham Manjunatha
Preetham Manjunatha 2021년 8월 2일
편집: Preetham Manjunatha 2021년 8월 4일
Here this function measures the curvature and other shape properties. In addition, it displays the curvature.
Here is the T-section with sharp corners:

linda cummings cummingslinda14@gmail.com
Very nice. Have you worked in gray image the this code ? Have you tried?
Linda Cummings
cummingslinda14 at gmail.com

sana3 sal
sana3 sal 2018년 6월 18일
Hello Mr @Image Analyst, I am wondering how to read the curvature? or how to analyse it?
  댓글 수: 3
Image Analyst
Image Analyst 2020년 4월 9일
Did you see the code he gave for computing curvature in this link to his comment.
cyril grandjean
cyril grandjean 2020년 4월 10일
Hello I read the code well but I was not sure that I understood correctly. So the coefficient provided in this code corresponds to the overall curvature of my form or a trend is that right?
thank you in advance

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

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by