0

I have several thousand images of fluid pathlines -- below is a simple example --

image

and I would like to automatically detect them: Length and position. For the position a defined point would be sufficient (e.g. left end). I don't need the full shape information.

This is a pretty common task but I did not find a reliable method.

How could I do this?

My choice would be Python but it's no necessity as long as I can export the results.


EDIT

This is a rough draft of what I'm searching for:

example

I need the length of the lines and e.g. the coordinates of the red dot.

Suuuehgi
  • 4,547
  • 3
  • 27
  • 32

1 Answers1

0

Counting curves, angles and straights in a binary image in openCV and python pretty much answers your question. I tried it on your image and it works.

I used:

ret, thresh = cv2.threshold(gray, 90, 255, cv2.THRESH_BINARY_INV)

and commented out these two lines:

pts = remove_straight(pts)      # remove almost straight angles
pts = max_corner(pts) # remove nearby points with greater angle

enter image description here

Vandan Revanur
  • 459
  • 6
  • 17
  • You you for your answer! Could you explain in what way this is working? I don't understand in what way the points are related to my question. – Suuuehgi Feb 15 '23 at 13:28
  • It is possible to determine the points in the fluid pathlines by tweaking the cv2.threshold parameters, which as far as I understood was what you wanted to do. – Vandan Revanur Feb 15 '23 at 13:36
  • Vandan Revanur: I added a sketch of what I mean to the question. – Suuuehgi Feb 21 '23 at 15:17