How to perform 2D curve fitting on an image

99 views (last 30 days)
EUAN FOSTER
EUAN FOSTER on 18 Jul 2019
Commented: Addy on 26 Mar 2021
Hello all,
I am very new to image processing and am struggling with post processing some data I have gathered. I have an image of some experimental data with frequency accross the x axis and wavenumber accrosss the y axis. Image attached for you to view..
untitled.png
It clearly can be seen that there are various curves (about 5 of them) that vary accross this 3D space, due to their large amplitude.
I would like to be able to curve fit data in terms of y = f(x) (wavenumber = f(frequency)) at the pixels of max amplitude. Does anyone have an idea of how to do this?
I thought I could loop through each column and find the peaks in order to determine the function I desire but I don't feel that this is too elegant.
Keen to hear if anyone has any other smart ideas
Regards,
Euan
  1 Comment
Addy
Addy on 26 Mar 2021
I am working with ultrasonic guided waves. Looks like you are trying to achieve mode filterning based on wavenumber plot.

Sign in to comment.

Answers (1)

Vinoth Venkatesan
Vinoth Venkatesan on 1 Aug 2019
Assuming you want to process the plot as an image, this is a possible workflow:
  • Binarize the grayscale image ("rgb2gray" and "imbinarize")
  • Find the connected components in the binarized image ("bwconncomp")
  • Use the 'PixelIdxList' that you get for these components to fit a curve (Interactively using "cftool" or programmatically using functions in the Curve Fitting Toolbox)
You might have to do some post-processing to convert the 'PixelIdxList' to [x,y] data (the "ind2sub" function might be of use here). Refer to these doc links for more info on these functions:

Community Treasure Hunt

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

Start Hunting!