Extract peaks from image

EDIT: I've managed to solve the problem by using "Get Coordinates" on a couple of points and then figuring out the affine mapping by using the values they're supposed to be at, and applying that mapping (both x and y components) to the peaks in order to find the wavelengths and peak intensities.

I've got an image here that I'd like to process:

Unfortunately, I don't have the corresponding data set with me (mostly my fault), so what I'd like to know is if there's some way to extract the peaks (primarily the top 4) automatically (i.e. no clicking "Get Coordinates" and figuring out how to map them to an actual plot)? I've tried ImageData, but I'm not exactly sure what to do with it since I'm not familiar with image manipulation (Mathematica or otherwise), and most of the documentation deals with manipulating image properties, not extracting points. I'm getting kind of desperate and any help or hints would be greatly appreciated!

Note: I've already seen (3831), but I don't see how I could use it since my picture has lines and not points...

• Atomic hydrogen? May 25, 2015 at 15:09
• Yup, I'm supposed to find the largest peaks and compare them with the theoretical values. I know I could just "eyeball it", but I fear the errors would be too large. May 25, 2015 at 15:24
• You only have one ratio (between H-alpha and H-beta) to go on anyway, so I wouldn't worry too much about that, if I were you. Everything else is down in the noise and the spectrum is does not have high enough resolution to meaningfully integrate across the lines. Call it 5:1 and be done with it, in my opinion. Allow for maybe a 20% error in your temperature estimate as a result of that. May 25, 2015 at 15:32
• I don't need the intensity ratios, but the wavelengths where the intensity is largest. I see one of them is at around 650 nm, the second largest is at around 480 nm, but is there any way to narrow it down a bit? May 25, 2015 at 15:39
• You need seriously higher resolution if you hope to usefully measure (Doppler? Stark?) shifts. The (unshifted) wavelengths have been measured at high resolution by others and they are roughly 656.27 and 486.13 nm (air wavelengths). But these are both multiplets (see e.g. the NIST atomic spectra database), so I would say you need resolution about 1000-10000 times better than you have to get anything useful from it. May 25, 2015 at 15:51

I accept a long time ago and 3831 does a lot of the trick, simply do

ImageDimensions@img
pt1 = {46, 52};
pt2 = {1266, 781};
imgCurve = ImageTrim[Image[MorphologicalComponents[img]], {pt1, pt2}]
ClearAll[data1, points];
data1 = ImageData[Binarize[ColorNegate[imgCurve], {1, 1}]];
points = Reverse /@ Position[data1, 1];
points[[All, 2]] = 781 - points[[All, 2]];
ListPlot@points


Results will be:

Then remember your offset on the left side. Rescale and the wavelength is there. Assuming pixel is a wavelength step and around 20 pixels, wavelength steps are below 400 micrometers. Your wavelength is

even the line profile can be fitted with this data.