In this image (http://postimg.org/image/mu8uhwhhx/) there are 3 more or less vertical peaks in total. Let the x-axis be the horicontal axis and y-axis be the vertical axis. I would like to determine the distance between the center of the most intense peak (peak in the middle of the image) and the centers of the 4 symmetrically sorrounding peaks for every given y-value. So that I know the distance of these peak-centers as a function of y. Within my code the image is called: testlong.jpg
My code so far:
img2 = Import["filepath\\testlong.jpg"];
data2 = ImageData[img2];
Dimensions[data2]
For[column = 1, column < 83, column++, pc[column] = Position[data2[[All, column]], Max[data2[[All, column]]]];
pb[column] = Position[data2[[1 ;; 60, column]], Max[data2[[1 ;; 60, column]]]];
pt[column] = 239 + Position[data2[[240 ;; 282, column]], Max[data2[[240;; 280, column]]]];];
For[lauf = 1, lauf < 83, lauf++, pcflat[lauf] = Flatten[pc[lauf]]];
For[lauf = 1, lauf < 83, lauf++, pbflat[lauf] = Flatten[pb[lauf]]];
For[lauf = 1, lauf < 83, lauf++, ptflat[lauf] = Flatten[pt[lauf]]];
Now I need to plot pcflat, ptflat, pbflat, fit each one with a line of best fit and determine the distance between these lines. But I don't seem to be able to plot pcflat, ptflat, pbflat. If I use:
ListPlot[Table[pcflat[i],{i,1,82}],PlotRange->All]
Mathematica plots 3 points within the intervall [1,2]
The problem is, that pcflat, pbflat, etc are nested lists with unequal length, because some x-values correspond with more than one y-value where there is a maximum (peaks are not delta peaks but have a width). How do I plot that?