Flowchart detection shape , lines , arrow and connected object through arrow line using python openCV

I want to process flowchart image using openCV and convert it into text file.

Please help about point 3 nd 4

  1. Able to detect flowchart shape ( square , rectangle, circle …etc )
  2. Able to extract text from shape
  3. Not able to detect arrow line
  4. Not able to detect arrow connecting from which shape and to which shape ?

Well, if you detected the shapes, then it’s almost ready.

Subtract those from the image (set the pixels covered by the shapes to the background color).

Then, you should have only the arrows. Binarize the image (arrows white, background black), run a skeleton thinning (if the arrow is more than 1 pixel wide).

Now, for every active (white) pixel check the number of active neighbors. If it has 2 neighbors, it lies on a line. If it has more than 2 (noted A below), it should be the arrow end of a line. If it has only 1 neighbor, (noted B) it’s the other end of a line. Just eliminate the ends that are close to the arrow end (noted C).

  *                    *
    C                  B

we appreciate code being posted as code. that’s not even a screenshot (every operating system understands the Print Screen key), that is a poor picture taken of a screen.

we don’t “share code”. we don’t have code.

are you asking someone to write code for you?