0

I have the following image:
raw example image

What is the best way to find the brown lines?

The output image should kind of look like this: example image with makeshift lines drawn

I have tried to just filter out the brown color, but I couldn't find a good color range.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Flojomojo
  • 53
  • 8
  • They are fairly well defined in the `H` channel if you convert to HSV colourspace, and in the `a` channel if you convert to `Lab` colourspace. – Mark Setchell Mar 08 '23 at 21:20
  • those lines are barely there (I didn't look at a hue image of it). forget about detecting that directly. detect the boundary between "textures" (cut lawn vs wild) – Christoph Rackwitz Mar 09 '23 at 13:15

3 Answers3

2

The brown lines are fairly well separated in HSV colourspace in the H channel. Below the H channel is on the left, the S channel in the centre and V on the right:

enter image description here

Likewise, if you convert to Lab mode, you can discern the brown lines in the a channel. L is on the left, a in the centre and b on the right:

enter image description here

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
1

You might use "Morphological gradient" as a rough indicator of "noisy".

Following 2 images is, "Morphological gradient" (of the grayscaled image) and the binalized result of it.

enter image description here enter image description here

Although I can not judge whether such a simple preprocessing result is really useful... If you can use some preconditions, for example

  • The interest region (surrounded by "noisy lines") is enoughly large
  • Orientation of "noisy lines" is always 45 degree
  • etc

You may be able to think some method based on them.
e.g. extracting biggest black region from the binalized image, and then approximating the region's border as 45 degree line.

fana
  • 1,370
  • 2
  • 7
0

Ended up taking 3 static points from the image, template matching them and manually setting offsets to calculate the lines

Flojomojo
  • 53
  • 8