1
$\begingroup$

For the image below, would like to make the heavy black downward sloping lines more prominent and the fine gridlines in the background less prominent. Also, would like to provide operations for the user, something like, "increase" and "decrease".
The goal would be that applying the increase operation once and the decrease operation once should return the original image. Context for this question is that we are making a general tool. The image below is just one example. The goal for the question is to identify the appropriate functions for this operation.

ImageAdjust as used below seems to achieve the goal of making the heavy black downward sloping lines more prominent. But this operation might not be easily reversible, because ImageAdjust uses the equation (b+1)(c+1)x^1 -c/2, and the value of x may be different at each point. So, the coefficients to invert the operation will not be the same.

image00 = Import[FileNameJoin[{NotebookDirectory[], "image_00.png"}]]
imageAdj01 = ImageAdjust[image00, {0.5, 0., 0.3} ] 
imageAdj02 = ImageAdjust[imageAdj01, {0, -0.2, 1} ] 
imageAdj03 = ImageAdjust[imageAdj01, {1, -0.35, 1} ] 

This is the original image. Note the fine grid in the background will distract the user from the key features of the plot.

enter image description here

And this is the image after applying ImageAdjust[image00, {0.5, 0., 0.3} ]. Note that the heavy black lines are much more prominent.

result from applying ImageAdjust[image00, {0.5, 0., 0.3} ]

This was the first attempt to reverse this operation, using ImageAdjust[imageAdj01, {0, -0.2, 1} ] enter image description here

This was the second attempt, using ImageAdjust[imageAdj01, {1, -0.35, 1} ] ImageAdjust[imageAdj01, {1, -0.35, 1} ]

After writing all of this, am now considering putting the {c,b,gamma} under the user's control. Please suggest alternatives to consider.

$\endgroup$
4
  • $\begingroup$ May be try ImageLines $\endgroup$
    – chris
    Oct 26 '20 at 7:01
  • $\begingroup$ Just curious. Why not simply generate the plot? $\endgroup$
    – Jagra
    Oct 26 '20 at 14:06
  • $\begingroup$ the plot is from a third party (actually it was generated in the 1970's). Data to generate the plot is not available. Will make an approximation of the downward sloping heavy black lines. $\endgroup$
    – user6546
    Oct 26 '20 at 15:09
  • $\begingroup$ The simplest might be to click on the curve; there's a function called "Coordinate Tools" when you click on an image in Mathematica, it can be pretty convenient. $\endgroup$
    – anderstood
    Oct 26 '20 at 19:22
1
$\begingroup$

You have a hard problem.

The following - just an extended comment - offers one approach to attack it. Maybe you or others can build on it.

Start with your first two lines of code:

image00 = Import[FileNameJoin[{NotebookDirectory[], "image_00.png"}]]
imageAdj01 = ImageAdjust[image00, {0.5, 0., 0.3} ] 

Then apply a filter:

HarmonicMeanFilter[imageAdj01, 1]

enter image description here

Not pretty, but this sort of thing may help others in the forum think of other approaches.

Some other thoughts:

You might want to cull the x and y axes labels from imageAdj01, then reassemble them with some final image.

You need to, somehow, identify the background as background. Mathematica has lots of ways to do this when you have something recognizable as something, e.g., a face or a building, but not so much when just have lines on lines on lines.

What does the graph represent? Knowing might give a new line of attack.

$\endgroup$
2
  • $\begingroup$ the line represents the performance characteristics of a fan at a power plant. x-axis is flow and the y-axis is energy increase of the air across the fan. $\endgroup$
    – user6546
    Oct 26 '20 at 23:32
  • $\begingroup$ maybe the problem should be revised to better match the capabilities of the available tools. As you point out, finding a way to identify and remove the cross hatched background would be a big step forward. $\endgroup$
    – user6546
    Oct 26 '20 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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