I'm trying to write a script that views an image, looks at lines on the image, and creates bounding boxes around the lines. Here is what I'm talking about...
I'm trying to have a way of intelligently cropping each section using a script. The best idea I came up with was to have colored tape around each of the sections like this:
Given this image with the colored tape the program should be able to find the colored lines and identify where they intersect. Here is a visual of what the program should be able to locate: (Black lines are where the tape is, red dots are the intersecting positions)
The end game here is for the program to be able to use this data to
OpenCV has facial detection and feature detection so something like this with a static image should be fairly possible. What is the best method to accomplish this?
There are many ways to do what you want.
One is to use sift:
https://docs.opencv.org/3.3.0/da/df5/tutorial_py_sift_intro.html
You will need to use keypoint detection, something like:
sift = cv2.SIFT()
kp = sift.detect(img,None)
You can check if the points are right with: img2 = cv2.drawKeyPoints(kp)
Then you will need to use cv2.boundingRect
box = cv2.boundingRect(kp)
If your marker is of a different color then the rest of the image, you only need to make a color filter to find the points.