Grow and merge line segments



Hello everyone, I have a TIF image of 8bits, which are from sugarcane planting lines, I needed to join the separate rows in a single segment of rows, but I do not know how to do that.
I uploaded two images: the original and what I want to be able to do, which is to join the segments of lines, I thought to increase the length of the lines until I found the other line, but I do not know how to do it. I drew some lines in red to illustrate.



The original image:



How would you differentiate blurred lines from non-existing lines?


I used a vegetation index called EGI to differentiate the vegetation from the soil and then extract the lines, the blur does not affect the extraction of the lines. I need the segments united in a single line, because then they will be used in the harvesters. The line can pass even where it does not have sugar cane.


Hi @hugonbgg,

Consider preprocessing with a Frangi filter. It’s useful when the true structure in the data are “lines” (in 2d) or “tubes” (in 3d). It tries to detect and enhance the local “tube-ness.”

The link above points to the paper, which is worth a read.

Good luck,


Thank you John! I’ll read the article and try it


You can get to the following image using FFT/inverse FFT on your original image:

Here are the steps:

  1. Process>FFT>FFT
  2. Adjust B/C to 50-180, hit Apply
  3. Process>FFT>Inverse FFT

You can play around with the min and max values in B/C to change the appearance of the final image.


Ved Sharma, PhD
Department of Anatomy and Structural Biology
Albert Einstein College of Medicine, New York


@vedsharma thank you so much! That’s exactly what I was looking for!