2
$\begingroup$

I have just installed Mathematica and appreciate your help on my question.

I have the following picture:

enter image description here

Is it possible using Mathematica to flip the green curve and overlay it on the blue? My intention is to compare them to see to what extent they are similar once the green one is flipped.

$\endgroup$
1
  • 1
    $\begingroup$ Do you have a picture or a list of data? If you have data values then much more is possible. $\endgroup$
    – Hugh
    Commented Jul 9 at 17:56

1 Answer 1

4
$\begingroup$

One way is to reflect the image and then combine with the original, e.g., by multiplying the two images.

img = Import["https://i.sstatic.net/26xqd6nM.jpg"];
imgR = ImageReflect[img];
ImageMultiply[img,imgR]

which gives:

enter image description here

This works because the two curves you're interested in are equally spaced vertically.

If you'd like to remove the other curves from the image to make it less busy, you could use DominantColors[img] to identify the colors and ColorDetect[img,color] to extract a mask of each curve using its color as returned by DominantColors. Then combine these masks with the original image to get an image with just the two curves you want.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.