So im currently working on a computer vision pipeline in openCV and skimage to process and interpret IQ puzzles.
Right now Im at the contour detection phase and ive been trying to further simplify the contours of the image. I found that the skeletonization function of skimage looks promising for its ability to turn multi pixel thick lines into single lines. Which I was planning on pairing with my contour detection which would avoid near duplicate/overlapping contours.
However upon testing the skeletonization function ive found it to be very limited and sensitive to noise. It works about 50% of the time however there are lots of images that cause edge cases to occur and lead to big gaps in the skeleton. My expectation was something that would basically function identically to a human just tracing the lines. But ofc its not that easy.
Im wondering is there potential preprocessing I can do? Better skeletonization algorithms? Or a new approach altogether?
my current pipeline is as follows img->grayscale->quantize pixels->adaptive_thresh->skeletonize(skipped)->find contours->extract primitives(later)
heres a snippet of my code:
https://pastebin.com/tKA02dXs
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.