FormerLurker / Octolapse

Stabilized timelapses for Octoprint
GNU Affero General Public License v3.0
638 stars 99 forks source link

raspberry pi camera high quality #609

Open mikgangal opened 4 years ago

mikgangal commented 4 years ago

If this is a feature request describe it here

full resolution on the new raspi camera high quality

just watched a video of somebody who used the new raspberry camera (high quality) and the results were not much better than with a webcam; seems like the guy couldn't increase the resolution past 2 MP while the new camera can go all the way to 12MP is this a true limitation? and if so any chance it could be improved? (before i shell out the cash on the module, adapters, new lenses ettcccc..) Thanks so much

Version of Octolapse

Octolapse Version: 0.4

Version of OctoPrint

OctoPrint Version: 1.4.2

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

  1. _REPLACE_THISSTEP_ONE_GOES_HERE
  2. _REPLACE_THISSTEP_TWO_GOES_HERE
  3. _REPLACE_THISSTEP_...

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.

FormerLurker commented 4 years ago

I'm going to grab one of these and see what can be done. 12MP will be difficult to achieve using mjpgstreamer, but I'll see what can be done. I know a capture routine could be created via a custom script, but it would only work if the camera isn't streaming since exclusive access is required, so I hope that's ok.

carcamerarig commented 4 years ago

I'm going to grab one of these and see what can be done. 12MP will be difficult to achieve using mjpgstreamer, but I'll see what can be done. I know a capture routine could be created via a custom script, but it would only work if the camera isn't streaming since exclusive access is required, so I hope that's ok.

Aah excellent, I've been waiting for this. Do you think you could implement the camera only service (max sensor size) and a frame rate that will reasonably transfer? Even 1fps is adequate for framing and focus right?

carcamerarig commented 4 years ago

I'm going to grab one of these and see what can be done. 12MP will be difficult to achieve using mjpgstreamer, but I'll see what can be done. I know a capture routine could be created via a custom script, but it would only work if the camera isn't streaming since exclusive access is required, so I hope that's ok.

Do you want me to send you one to work with?

FormerLurker commented 4 years ago

Do you think you could implement the camera only service (max sensor size) and a frame rate that will reasonably transfer? Even 1fps is adequate for framing and focus right?

At 1FPS, on average 500MS will be added to each snapshot, which is a lot of time. That would impact quality quite a bit, especially for the 'snap to print' trigger. Is focus automatic for the HQ camera? For my logitech 920, an extremely short delay (30-60MS depending on framerate) is adequate when using auto-focus. I've never thought about why that is honestly.

Do you want me to send you one to work with?

That is a very generous offer! Let me consider that. In the meantime, I'll try to come up with a script you can use for now.

carcamerarig commented 4 years ago

Well, I can't write the script myself so it's a small price to pay and everyone benefits with HQ timelapse. No one else has done it apart from the external dslr script.

What about a 2nd preview port/mode image for octolapse preview and the full res image straight to file or does just add even more time?

FormerLurker commented 4 years ago

Well, for the preview image I create a thumbnail from the original, and that is done on a background thread. All focus is on minimizing the snapshot acquisition time.

I am going to try to do this on my picam V2 first. In theory, it's still capability is pretty high too, so it should be a useful test case. Once I have the script I'll send it to you for testing. If it doesn't work on the HQ, I will take you up on your offer.

FormerLurker commented 4 years ago

I also wanted to mention that I'm finishing up another plugin, and will be starting on overdue Octolapse issues right after that.

carcamerarig commented 4 years ago

Excellent news 👍🏼

carcamerarig commented 4 years ago

I also wanted to mention that I'm finishing up another plugin, and will be starting on overdue Octolapse issues right after that.

I that plug-in will be a game changer in terms of how smooth it'll run.

mikgangal commented 4 years ago

Do you think you could implement the camera only service (max sensor size) and a frame rate that will reasonably transfer? Even 1fps is adequate for framing and focus right?

At 1FPS, on average 500MS will be added to each snapshot, which is a lot of time. That would impact quality quite a bit, especially for the 'snap to print' trigger. Is focus automatic for the HQ camera? For my logitech 920, an extremely short delay (30-60MS depending on framerate) is adequate when using auto-focus. I've never thought about why that is honestly.

Do you want me to send you one to work with?

That is a very generous offer! Let me consider that. In the meantime, I'll try to come up with a script you can use for now.

i believe the picam high quality is fixed focus.. just like in the original one; more over i think the aperture is also manual (at least in the videos i see on the web)

since i know nothing about coding.. i can ask a dumb question.. could you have the camera stream in really crappy resolution.. just so that we can monitor the progress etc... and cut the feed when it's time to take the shot.. for however many seconds it's needed (i understand this can have an impact on print quality.. but i find the small plastic bits fairly easy to remove).. and then restart the feed until the next shot needs to be taken?

thanks for reading my nonsense :D

carcamerarig commented 4 years ago

I also wanted to mention that I'm finishing up another plugin, and will be starting on overdue Octolapse issues right after that.

Did you ha e a chance to look into this?

FormerLurker commented 4 years ago

Not yet, been hammering out aec welder features based on user request. I promise i will get back to Octolapse soon!