r/computervision 14h ago

Showcase I built a classical image processing algorithm that counts textile threads with high accuracy, source in body!

Hello everyone!

I'm an engineering student, during my last internship at a medical device company, i was FORCED to count threads by hand, hated it so much that I wrote code that automated it, tried to turn it into a startup, not going all that great, so I thought I'll just document and release it, works on an Orange Pi and camera module, tested on a real production line, let me know if you have any remarks or questions, check it out!

https://github.com/Asxcvg/thread-counter

119 Upvotes

6 comments sorted by

36

u/BlobbyMcBlobber 14h ago

Classic CV is so much fun

14

u/SalemIII 13h ago

very much, i remember jumping in my seat when it went from double counting to being off by ~1-2 threads

2

u/Cw3538cw 8h ago

Such a satisfying moment. If you are looking to keep this open/prevent others from profiting off of it without permission, you might consider a copy left license like MPL. The big difference being that someone else can't legally package it into their own paid startup app

1

u/SalemIII 8h ago

yes i understand that Apache-2.0 is a commercially permissive license, you are more the welcome to package it into anything you please, the fun part was engineering it, you wouldn't be surprised how much paperwork and headache it would be to have this pass a medical device audit even as a deterministic code, it's a brutal field and i have moved on from it anyway

1

u/pilibitti 2h ago

it went from double counting to being off by ~1-2 threads

ah the (x / 2) trick, works every time.

1

u/RoboMind 16m ago

If you know the thickness of a single thread in pixels, you can simply use the ratio of white and black pixels, right?