Recreating the curve from image graph as a matlab plot
Afficher commentaires plus anciens
I have an .jpeg image of a graph. I have extracted the x,y coordinates of the black curve usng pixel intensity and would like to recreate the original graph as a matlab plot to extract data. I am not using any digitizer prebuilt functions because I dont want to manually click on the points in the curve to extract data. So my idea is to plot the x,y cooridnates of the black pixel graph as a plot with the origin x and y axis scale and get the data from it. Now I need help to understand how I can plot the x,y coordinates extracted from image to recreate the curve exactly as below? Any better ideas are also appreciated. Thank you!
3 commentaires
DGM
le 22 Sep 2021
If you have extracted the points based on image segmentation, then you'll have to contend with the fact that the points are not ordered. Similarly, you'd want to deal with the ambiguity caused by artifacts and the fact that the line is thick. This is one example, and contains links to other similar examples.
I don't have much trust in the accuracy of doing it this way, especially with the retention of small details and narrow peaks where the line thickness will cause problems with edge thinning.
Suchithra Ramachandran
le 22 Sep 2021
Image Analyst
le 5 Oct 2021
But did my code (scroll down) work for you?
Réponses (1)
Image Analyst
le 22 Sep 2021
"I have extracted the x,y coordinates " So just sort by x and plot
% Scale
x = rescale(x, time1, time2);
y = rescale(y, 14.4, 23.4);
% Sort in order of increasing x.
[sortedX, sortOtder] = sort(x, 'ascend');
sortedY = y(sortOrder);
plot(sortedX, sortedY, 'b-');
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!