Open ansonl opened 2 years ago
Interesting proposition. Perhaps a good way to do this would be to inject some additional information into the camera scripts panel shown here:
That way you can tweak the focus values based on your need. I know the focus can be adjusted via script, so you'd just need the current printhead coordinates to deduce a value, right? I'll add this to the milestones.
Set camera focus value based on X/Y position of printhead
First off, great plugin, it's fast and works great! Would you consider adding a feature to automatically set the correct camera focus value when taking a picture based off of the printhead X/Y location? If the user has predetermined where the optimal focus values for the closest (ex: 0) and furthest (ex:210) printhead location, higher quality snapshots could be taken if the scaled focus value was manually set for each picture based on the printhead distance from the camera. I am assuming the desired focus should always be where the printhead is but this could be useful for other needs as well.
Ex: I am using a Logitech C920 webcam that supports adjustable focus with values from 0-250. The webcam's autofocus doesn't use the best value especially with a fast printhead and busy picture details. If I determine on my camera mounting location, the best focus value for the closest printhead (0,0) is 20 and the furthest printhead (210,210) is 230, when taking a picture and the printhead is at (105,105), manual focus value should be set to 125 for that picture.
If the option to continually adjust the focus during the print (for normal webcam viewing) is possible, that would be very useful for print monitoring when you just want to see how the extruder itself is doing.
Version of Octolapse
Octolapse Version: 0.4.1
Version of OctoPrint
OctoPrint Version: 1.7.3
When you ran into the problem, did you have diagnostic logging enabled?
Diagnostic Logging was Enabled: _REPLACE_THISYES_OR_NO
What were you doing when the problem occurred
What should have happened?
_REPLACE_THISPUT_YOUR_DESCRIPTION_HERE
What happened instead?
_REPLACE_THISPUT_YOUR_DESCRIPTION_HERE
Operating System running OctoPrint and Octolapse
OS Name: _REPLACE_THISOS_NAME_GOES_HERE Os Version: _REPLACE_THISOS_VERSION_GOES_HERE
Printer model & used firmware incl. version
Printer Model: _REPLACE_THISPRINTER_MODEL_GOES_HERE Printer Firmware Version: _REPLACE_THISPRINTER_FIRMWARE_VERSION_GOES_HERE
Browser and version of browser, operating system running browser
Browser: _REPLACE_THISBROWSER_VERSION_GOES_HERE Browser OS: _REPLACE_THISBROWSER_OS_GOES_HERE
Link to the gcode file you were printing when the problem occurred
Link to Gcode File: _REPLACE_THISGCODE_FILE_LINK_GOES_HERE
Link to settings.json
Link to settings.json with all passwords removed: _REPLACE_THISSETTINGS_JSON_LINK_GOES_HERE
Link to plugin_octolapse.log
Link to plugin_octolapse.log: LINK_GOES_HERE
Link to octoprint.log
Link to octoprint.log: _REPLACE_THISLINK_GOES_HERE
Link to contents of Javascript console in the browser
Link to javascript console output: _REPLACE_THISLINK_GOES_HERE
Screenshots and/or videos of the problem:
Screenshot/Video Links: _REPLACE_THISLINKs_GO_HERE
Please consider becoming a patron
If you like this project, please support my work by becoming a patron, and consider adding a 'star' to the repository. It takes a lot of time and effort to maintain the project and respond to issues. The cost of test prints, software, cameras, printer parts, etc. can quickly add up, so every bit helps.
You can find various videos and tutorials by subscribing to my Youtube channel. You can also follow me on Twitter.