image processing - Compare Plots in matlab -
i have 2 plots in matlab in have plotted x , y coordinates. if have these 2 plots, possible compare if plots match? can obtain numbers tell how match?
note graphs possibly right/left/up/down shifted in plot (turning axis off not problem), scaled/rotated (i know if skewed, now, not must).
it not need test color elements, color inversion , other complicated graphic properties basic ones mentioned above.
if matlab not enough, welcome other tools.
note cannot take absolute difference of x- , y- values. obtain x-absolute difference average , y-absolute difference , average need combined error. need compare graph.
graphs compared.
edit
direct correlation not work me.
for different set of data: got .94 correlation. high given data. noticing 1 data fluctuating less , faster other.
you can access plotted data code
x = 10:100; y = log10(x); plot(x,y); h = gcf; axesobjs = get(h, 'children'); %axes handles dataobjs = get(axesobjs, 'children'); %handles low-level graphics objects in axes objtypes = get(dataobjs, 'type'); %type of low-level graphics object xdata = get(dataobjs, 'xdata'); %data low-level grahics objects ydata = get(dataobjs, 'ydata');
then can correlation between xdata , ydata example, or kind of comparison. coefficient r indicate percent match.
[r,p] = corrcoef(xdata, ydata);
you interested in comparing axes limits in graphical current axes. example
r = ( diff(get(h_ax1,'xlim')) / diff(get(h_ax2,'xlim')) ) + ... ( diff(get(h_ax1,'ylim')) / diff(get(h_ax2,'ylim')) )
where h_ax1 handle of first axe , h_ax2 second one. here, have comparison between values of (xlim + ylim). possible comparisons different gca properties vast though.
edit
to compare 2 sets of points, may use other metrics analytical relationship. think of distances or convergences such hausdorff distance. script available here in matlab central. used such distance compare letter shapes. in wikipedia page, 'applications' section of importance (edge detector thick shapes, may not pertinent particular problem).
Comments
Post a Comment