curve fitting of an image
Show older comments
I have this image which i changed to binary. I want to write a code that draws a fitting curve into the points shown in the figure attached. How can I do that?
4 Comments
yanqi liu
on 4 Jan 2022
yes,sir,which area is curve,may be draw the curve to make some introduction
John D'Errico
on 4 Jan 2022
Suppose you had some magic tool that would fit a curve that looks EXACTLY like you think it should. What would that curve look like on that image? If you don't know, then don't expect a computer to figure it out.
Anyway, you cannot fit a curve to an image. You CAN extract the pixels of interest, then use some sort of curve fitting tool to create a fit. However, in any case, you would need to propose a valid model for that curve.
Image Analyst
on 4 Jan 2022
It would be better to attach the original image, not the segmented image. Looks like your segmentation algorithm is not so good. Also post another image where you've painted the curve over the original gray scale image so we can see what you're trying to find.
Finally, say WHY it's the curve that you think you need to find, and if you actually had a list of (x,y) coordinates of the curve, what would you do with that information.
KALYAN ACHARJYA
on 5 Jan 2022
Answers (1)
VINAYAK LUHA
on 13 Sep 2023
0 votes
Hi Ali,
I understand that you wish to know about how to fit a curve to the points in a binarized image.
Follow the steps mentioned below in order to achieve that:
- Find the connected components in the binarized image using "bwconncomp" function.
- Convert the "PixelIdxList" in each found connected component to [x, y] data using the “ind2sub” function.
- Fit a polynomial degree curve to the data using the “fit” function.
- Display the original image using “imshow” function.
- Plot the fitted curves on top of the image.
Hope this helps.
Regards,
Vinayak Luha
1 Comment
DGM
on 13 Sep 2023
Can you provide an example applying these steps to the given image?
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!