Using Python and openCV to extract and manipulate plot lines

Someone on the PLOTS-spectrometry mailing list posted two spectrographs they'd collected with their PLOTS-spectrometer, and also a plot the LED manufacturer provided.
The wondered why their spectrogram didn't look like either of the two plots provided by the manufacturer, and I thought they might look similar if the plot lines were added or multiplied with each other.
So I made this script to select the plot line color, then extract colors close to that into separate images.
With these images, the maximum Y value for each column was found, and Y values from the corresponding plots were added and also multiplied, then saved to new output images.

LED spectrograms in question

Input dual-line plot

Input dual-line plot
 
 

Using this dual-line graph as input

openCV image
 

These binary images were extracted of the individual plot lines

openCV image

openCV image

Plots' Y-values added together

openCV image

Added, then divided by 2

openCV image

Square root of the multiples ( sqrt(y1 * y2) )

openCV image

Graph of added (yellow) and multiplied (red) lines, both were scaled down.

openCV image

 
 
 
 
 
 
 

Using this triple-line graph image as input

openCV image

The results from processing:

Binary images of extracted plots

openCV image

openCV image

openCV image

Added

openCV image

Added then divided by 3

openCV image

Cube root of the multiples ( cube_root(y1 * y2 * y3) )

openCV image

Graph of added (yellow) and multiplied (red) lines, both were scaled down.

openCV image

 
 
 
 
 

So to sum things up, these were in question

Input dual-line plot

Input dual-line plot

 
 

And what I thought might have looked similar after some computation.

openCV image

openCV image

 
 
 
 
 

What do you think? Leave me some Feedback

 
 
 
 
 

Check out the code I wrote to do this here