Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vertical distortion of an image to a datum (=seismic horizon flattening of an image)
#9
(05-09-2020, 10:45 AM)programmer_ceds Wrote:
(05-07-2020, 09:14 PM)Ofnuts Wrote: Mathematically you can compute the cross-correlation between adjacent strips of pixels, and deduce the shift to apply to align them (and this would find a best fit over the whole height, not locally for a specific feature). A question could be how to avoid drifts.

For the specific problem in the original post would the cross-correlation not have to be done only on the area of the thicker red stripe (or possibly the thin lighter line above it)? If you work on the complete columns of pixels the thicker red line would probably bot end up horizontal.

One problem is that in one area the lower edge of the thicker red stripe becomes rather blurred - hence suggesting using the lighter stripe immediately above it.

If writing a script for this Python should be used - Script-fu gets painfully slow when pixel peeping is required as here.

The original poster talks of drawing a path - that would be fine if this was an infrequent need. The easiest way then, from the point of view of writing a script, would be to add a transparent layer over the origianl image and draw a line of single pixel thickness on this second layer. The script dialog could specify the vertical coordinate at which the new 'horizon' should be placed. Its then a relatively simple matter for the script to determine the necessary vertical adjustment for each column of the original image based on the vertical positions of the pixels in the upper layer and shift the pixels in that column of the lower layer.

I wonder duplicating the original layer, applying one of the edge detection algorithms on this duplicated layer and then erase everything but the required line.

It would of course be possible to have the script operate only with the single layer of the original image and determine shifts required to make the thicker red band (or possibly the thinner light band above it) horizontal but I would be concerned about having a line with edges that were clear enough to follow.

Hope this makes some sort of sense.

Possibly a XY problem, so I wouldn't stick too much on the initial requirements.

Python would be OK if using numpy and/or some signal processing library, otherwise the amount of computation requires a compiled language.
Reply


Messages In This Thread
RE: Vertical distortion of an image to a datum (=seismic horizon flattening of an image) - by Ofnuts - 05-10-2020, 08:10 AM

Forum Jump: