jneilliii / OctoPrint-BedReady

11 stars 3 forks source link

Multiple possible reference images? #4

Open ahernsean opened 2 years ago

ahernsean commented 2 years ago

Cool plugin! Unfortunately, it won't work for me due to lighting differences. There's a lamp near my printer that might be on or might be off. That's enough of a difference to send the match percentage down to about 94%. That's so low that it misses things like tools left on the build plate.

A possible workaround would be to allow the user to take more than one reference image. At @BEDREADY, the code would check if the test image is above 98% with any of the reference images. If it is, all is good.

What do you think?

(I'm tempted to try this myself and submit a PR. I'm a Python developer, but I have no experience developing or debugging OctoPrint plugins.)

jneilliii commented 2 years ago

I was hoping that someone like you would come along to contribute as I have no clue on that side of things, but the backend is using open cv, so I'm assuming would be fairly easy to train a set of images. I just don't have the knowledge to do so. The whole comparison function at this point can be found in this function here.

ahernsean commented 2 years ago

Thanks. That's exactly the pointer I would need. I have to figure out how to set up a development environment for OctoPrint plugins, then it's probably straightforward.

jneilliii commented 1 year ago

Initial support for multiple images has been added in version 0.1.6. It's still a manual process for now of setting the comparison image as reference, but this will lay the ground work for having the multiple images to use in the opencv comparison in a future release.