What is the best way to find the brown lines?
The output image should kind of look like this:
I have tried to just filter out the brown color, but I couldn't find a good color range.
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:
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:
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.
Although I can not judge whether such a simple preprocessing result is really useful... If you can use some preconditions, for example
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.
Ended up taking 3 static points from the image, template matching them and manually setting offsets to calculate the lines