How to detect the all black lines in an image

Would you advise me how to detect all the black lines in an image?

Hi @wency.www

Look for threshold function.
We can help you better if you post an example image describing what you are looking for.
For example, I don’t know if you are looking for straight lines. There is a fast line detector for such purpose. And there also is canny for edge detection.

Well, i’m looking only for straight black (or almost black, i know there is an option to give a color tolerance) lines together with their angle of rotation. A simple example is attached as an image - i want to get the rotation angle of the the 4 black lines.

. In fact, the angle of rotation is all i want to get.

Fortunately, there are many ways to do this. I’ll only describe one.

There are two problems: detect lines and filter color. You can detect lines and then check their color, or apply a filter (like inRange()) ant then detect lines.

You can detect straight lines segments with fast line detector. With their vertices coordinates you can calculate angles.