User avatar
HermannSW
Posts: 2564
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera Long Exposures

Sun May 17, 2020 4:42 pm

r2k-in-the-vortex wrote:
Sun May 17, 2020 4:03 pm
What I mean by not working with 20ms, is if you do the clock test you'll find the actual capture 1 was only 1s long, even though it took 195s and also wrote that to exif.
You are right, I just verified that.
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Tue May 19, 2020 2:19 pm

Will the raspistill version with the -lss option soon be released to the general public, if so any idea when?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8714
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera Long Exposures

Tue May 19, 2020 3:22 pm

RoboRob wrote:
Tue May 19, 2020 2:19 pm
Will the raspistill version with the -lss option soon be released to the general public, if so any idea when?
If someone creates a PR, and it has been implemented in a suitable manner, then potentially.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

naushir
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 45
Joined: Mon Apr 25, 2016 10:21 am

Re: Raspberry Pi High Quality Camera Long Exposures

Wed May 20, 2020 6:47 pm

We have made a number of changes to the firmware driver and together with this change to raspistill, long exposure captures should now take the expected amount of time to complete instead of waiting tens of minutes.

Some conditions must be followed:
  • Exposure mode must be off (-ex off)
  • Stats pass must be enable (-st)
  • Manual shutter speed and analogue gain must be provided (-ss and -ag)
  • Burst mode set (-bm)
All of the above parameters really must be provided to get sensible images at these extreme exposure times. With these parameters, the capture cycle will run for only one frame to give you the output jpeg.

An example:

Code: Select all

raspistill -t 10 -md 3 -bm -ex off -ag 1 -ss 100000000 -st -o long_exposure.jpg
The firmware changes are slowly trickling through the usual rpi-update channels and will not be available instantly, so please be patient.

EDIT: Added burst capture mode flag.

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Wed May 20, 2020 10:18 pm

Compiled your code from github and tested it tonight with

Code: Select all

time userland/build/bin/raspistill --nopreview --metering matrix --thumb none --raw --quality 100 --output image_800_10000000_3x3_20200520T235116.jpg --ISO 800 --exposure off --flicker off --awb auto --shutter 10000000 --drc off --mode 4 --timeout 100 --burst -ag 1 -st -v 2>&1 | perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
This should give a 10 sec exposure but was < 1 sec in reality... :(

results in:
[2020-05-21 00:16:05]
[2020-05-21 00:16:05] "raspistill" Camera App (commit 291f9cb826d5 Tainted)
[2020-05-21 00:16:05]
[2020-05-21 00:16:05] Camera Name imx477
[2020-05-21 00:16:05] Width 4056, Height 3040, filename image_800_10000000_3x3_20200520T235116.jpg
[2020-05-21 00:16:05] Using camera 0, sensor mode 4
[2020-05-21 00:16:05]
[2020-05-21 00:16:05] GPS output Disabled
[2020-05-21 00:16:05]
[2020-05-21 00:16:05] Quality 100, Raw yes
[2020-05-21 00:16:05] Thumbnail enabled No, width 64, height 48, quality 35
[2020-05-21 00:16:05] Time delay 100, Timelapse 0
[2020-05-21 00:16:05] Link to latest frame enabled no
[2020-05-21 00:16:05] Full resolution preview No
[2020-05-21 00:16:05] Capture method : Single capture
[2020-05-21 00:16:05]
[2020-05-21 00:16:05] Preview No, Full screen Yes
[2020-05-21 00:16:05] Preview window 0,0,1024,768
[2020-05-21 00:16:05] Opacity 255
[2020-05-21 00:16:05] Sharpness 0, Contrast 0, Brightness 50
[2020-05-21 00:16:05] Saturation 0, ISO 800, Video Stabilisation No, Exposure compensation 0
[2020-05-21 00:16:05] Exposure Mode 'off', AWB Mode 'auto', Image Effect 'none'
[2020-05-21 00:16:05] Flicker Avoid Mode 'off'
[2020-05-21 00:16:05] Metering Mode 'matrix', Colour Effect Enabled No with U = 128, V = 128
[2020-05-21 00:16:05] Rotation 0, hflip No, vflip No
[2020-05-21 00:16:05] ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
[2020-05-21 00:16:06] Camera component done
[2020-05-21 00:16:06] Encoder component done
[2020-05-21 00:16:06] Starting component connection stage
[2020-05-21 00:16:06] Connecting camera preview port to video render.
[2020-05-21 00:16:06] Connecting camera stills port to encoder input port
[2020-05-21 00:16:06] Opening output file image_800_10000000_3x3_20200520T235116.jpg
[2020-05-21 00:16:06] Enabling encoder output port
[2020-05-21 00:16:06] Starting capture -1
[2020-05-21 00:16:06] Finished capture -1
[2020-05-21 00:16:06] Closing down
[2020-05-21 00:16:06] Close down completed, all components disconnected, disabled and destroyed
[2020-05-21 00:16:06]

real 0m1,402s
user 0m0,095s
sys 0m0,061s

Black picture with no stars (with the sensor mounted on a small telescope)...

I get the feeling that shooting pics through a telescope (with lots of black background and just a few (sometimes out of focus) stars) is messing up the metering routines. Would it nog be possible to switch this function off as well and manually set a suitable metering measurement (with a new parameter when needed)?

User avatar
HermannSW
Posts: 2564
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 12:06 am

naushir wrote:
Wed May 20, 2020 6:47 pm
An example:

Code: Select all

raspistill -t 10 -md 3  -ex off -ag 1 -ss 100000000 -st -o long_exposure.jpg
The firmware changes are slowly trickling through the usual rpi-update channels and will not be available instantly, so please be patient.
I did flash Buster on new SD card, and did rpi-update finally.
I used your command, and it does not stop for an hour.
Pressing CTRL-C does not stop it.

In 2nd ssh session raspistill cannot be killed:

Code: Select all

pi@raspberrypi4B2:~ $ ps -ef | grep raspistill
pi        1313  1312  0 01:11 pts/0    00:00:00 [raspistill]
pi        1547  1535  0 02:05 pts/1    00:00:00 grep --color=auto raspistill
pi@raspberrypi4B2:~ $ sudo kill -9 1313
pi@raspberrypi4B2:~ $ ps -ef | grep raspistill
pi        1313  1312  0 01:11 pts/0    00:00:00 [raspistill]
pi        1558  1535  0 02:05 pts/1    00:00:00 grep --color=auto raspistill
pi@raspberrypi4B2:~ $ uname -a
Linux raspberrypi4B2 5.4.42-v7l+ #1319 SMP Wed May 20 14:12:03 BST 2020 armv7l GNU/Linux
pi@raspberrypi4B2:~ $ 
Should your changed version be available after rpi-udate now?
If not, when?
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

ethanol100
Posts: 637
Joined: Wed Oct 02, 2013 12:28 pm

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 5:52 am

RoboRob wrote:
Wed May 20, 2020 10:18 pm
This should give a 10 sec exposure but was < 1 sec in reality... :(
You are requesting mode 4, which has a fps range from 50.1-120fps. Therefore, maximum exposure time is about 20ms. Try to use mode 3!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 6:34 am

The changes will not have made it to rpi-update yet, will take a few days.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 9:58 am

ethanol100 wrote:
Thu May 21, 2020 5:52 am
RoboRob wrote:
Wed May 20, 2020 10:18 pm
This should give a 10 sec exposure but was < 1 sec in reality... :(
You are requesting mode 4, which has a fps range from 50.1-120fps. Therefore, maximum exposure time is about 20ms. Try to use mode 3!
Thanks for your response, I'm so puzzled with the behaviour of this camera (using raspistill or the picamera libraries)!

I use the sensor i.c.w. a telescope and to realize this I need to do auto-focussing (which need appr. 9 - 12 shots) when the temperature changes > 0.5 C. Then the telescope software does an automatically adjustment of the telescopes focusser at binning 3x3, mode 4, to ensure fast download times and with exposures of 2 - 5 sec. which needs minimum download times (< 3 secs) to ensure reasonable auto-focus times. Are you saying this is not possible with this sensor or should I use the ROI options i.c.w. mode 3 to make this possible?
Last edited by RoboRob on Thu May 21, 2020 10:18 am, edited 3 times in total.

PiGraham
Posts: 3928
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 10:13 am

RoboRob wrote:
Thu May 21, 2020 9:58 am

Thanks for your response, I'm so puzzled with the behgaviour of this camera (using raspistill or the picamera libraries)!
Does this help?

https://www.raspberrypi.org/documentati ... /camera.md

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 10:18 am

PiGraham wrote:
Thu May 21, 2020 10:13 am
RoboRob wrote:
Thu May 21, 2020 9:58 am

Thanks for your response, I'm so puzzled with the behaviour of this camera (using raspistill or the picamera libraries)!
Does this help?

https://www.raspberrypi.org/documentati ... /camera.md
it does, but I'm still puzzle why the following statement takes 1 minute and 41 seconds to capture and download. The capture alone take 1 minute and 28 seconds instead of the expected 10 seconds and the close down takes 13 seconds...

Code: Select all

time userland/build/bin/raspistill --nopreview --metering matrix --thumb none --encoding jpg --output test.jpg --ISO 400 --exposure off --flicker off --awb auto -ss 10000000 --drc off --mode 3 --timeout 100 -st -ag 1 -v --roi 0.33,0.33,0.33,0.33 2>&1 | perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
I would expect app. 15 seconds or so (10 + 5 seconds download time):

[2020-05-21 12:08:54] "raspistill" Camera App (commit 291f9cb826d5 Tainted)
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Camera Name imx477
[2020-05-21 12:08:54] Width 4056, Height 3040, filename test.jpg
[2020-05-21 12:08:54] Using camera 0, sensor mode 3
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] GPS output Disabled
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Quality 85, Raw no
[2020-05-21 12:08:54] Thumbnail enabled No, width 64, height 48, quality 35
[2020-05-21 12:08:54] Time delay 100, Timelapse 0
[2020-05-21 12:08:54] Link to latest frame enabled no
[2020-05-21 12:08:54] Full resolution preview No
[2020-05-21 12:08:54] Capture method : Single capture
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Preview No, Full screen Yes
[2020-05-21 12:08:54] Preview window 0,0,1024,768
[2020-05-21 12:08:54] Opacity 255
[2020-05-21 12:08:54] Sharpness 0, Contrast 0, Brightness 50
[2020-05-21 12:08:54] Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
[2020-05-21 12:08:54] Exposure Mode 'off', AWB Mode 'auto', Image Effect 'none'
[2020-05-21 12:08:54] Flicker Avoid Mode 'off'
[2020-05-21 12:08:54] Metering Mode 'matrix', Colour Effect Enabled No with U = 128, V = 128
[2020-05-21 12:08:54] Rotation 0, hflip No, vflip No
[2020-05-21 12:08:54] ROI x 0.330000, y 0.330000, w 0.330000 h 0.330000
[2020-05-21 12:08:55] Camera component done
[2020-05-21 12:08:55] Encoder component done
[2020-05-21 12:08:55] Starting component connection stage
[2020-05-21 12:08:55] Connecting camera preview port to video render.
[2020-05-21 12:08:55] Connecting camera stills port to encoder input port
[2020-05-21 12:08:55] Opening output file test.jpg
[2020-05-21 12:08:55] Enabling encoder output port
[2020-05-21 12:08:55] Starting capture -1
[2020-05-21 12:10:23] Finished capture -1
[2020-05-21 12:10:23] Closing down
[2020-05-21 12:10:36] Close down completed, all components disconnected, disabled and destroyed
[2020-05-21 12:10:36]

real 1m41,637s
user 0m0,051s
sys 0m0,089s

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 11:41 am

RoboRob wrote:
Thu May 21, 2020 10:18 am
PiGraham wrote:
Thu May 21, 2020 10:13 am
RoboRob wrote:
Thu May 21, 2020 9:58 am

Thanks for your response, I'm so puzzled with the behaviour of this camera (using raspistill or the picamera libraries)!
Does this help?

https://www.raspberrypi.org/documentati ... /camera.md
it does, but I'm still puzzle why the following statement takes 1 minute and 41 seconds to capture and download. The capture alone take 1 minute and 28 seconds instead of the expected 10 seconds and the close down takes 13 seconds...

Code: Select all

time userland/build/bin/raspistill --nopreview --metering matrix --thumb none --encoding jpg --output test.jpg --ISO 400 --exposure off --flicker off --awb auto -ss 10000000 --drc off --mode 3 --timeout 100 -st -ag 1 -v --roi 0.33,0.33,0.33,0.33 2>&1 | perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
I would expect app. 15 seconds or so (10 + 5 seconds download time):

[2020-05-21 12:08:54] "raspistill" Camera App (commit 291f9cb826d5 Tainted)
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Camera Name imx477
[2020-05-21 12:08:54] Width 4056, Height 3040, filename test.jpg
[2020-05-21 12:08:54] Using camera 0, sensor mode 3
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] GPS output Disabled
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Quality 85, Raw no
[2020-05-21 12:08:54] Thumbnail enabled No, width 64, height 48, quality 35
[2020-05-21 12:08:54] Time delay 100, Timelapse 0
[2020-05-21 12:08:54] Link to latest frame enabled no
[2020-05-21 12:08:54] Full resolution preview No
[2020-05-21 12:08:54] Capture method : Single capture
[2020-05-21 12:08:54]
[2020-05-21 12:08:54] Preview No, Full screen Yes
[2020-05-21 12:08:54] Preview window 0,0,1024,768
[2020-05-21 12:08:54] Opacity 255
[2020-05-21 12:08:54] Sharpness 0, Contrast 0, Brightness 50
[2020-05-21 12:08:54] Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
[2020-05-21 12:08:54] Exposure Mode 'off', AWB Mode 'auto', Image Effect 'none'
[2020-05-21 12:08:54] Flicker Avoid Mode 'off'
[2020-05-21 12:08:54] Metering Mode 'matrix', Colour Effect Enabled No with U = 128, V = 128
[2020-05-21 12:08:54] Rotation 0, hflip No, vflip No
[2020-05-21 12:08:54] ROI x 0.330000, y 0.330000, w 0.330000 h 0.330000
[2020-05-21 12:08:55] Camera component done
[2020-05-21 12:08:55] Encoder component done
[2020-05-21 12:08:55] Starting component connection stage
[2020-05-21 12:08:55] Connecting camera preview port to video render.
[2020-05-21 12:08:55] Connecting camera stills port to encoder input port
[2020-05-21 12:08:55] Opening output file test.jpg
[2020-05-21 12:08:55] Enabling encoder output port
[2020-05-21 12:08:55] Starting capture -1
[2020-05-21 12:10:23] Finished capture -1
[2020-05-21 12:10:23] Closing down
[2020-05-21 12:10:36] Close down completed, all components disconnected, disabled and destroyed
[2020-05-21 12:10:36]

real 1m41,637s
user 0m0,051s
sys 0m0,089s
This was explained above. When doing as standard capture, it grabs quite a few frames to do the AGC and AWB calculation, and there is also some frame dropping at the start. This means to get one capture frame at the end, you have actually used up quite a few frames. Since with the current firmware, setting exposure to 10s (for example) means 10s for *each* of those frames, you get a long overall time to capture.

The fixes mentioned above mean that we do not go through the entire process (so data needs to be user specified for gain and exposure), and only capture ONE frame. The changes should make it through to the test rpi-update code in a few days, difficult to predict.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 12:16 pm

But I downloaded the code from github (https://github.com/raspberrypi/userland ... be0ea6536b) and compiled it. Then I called the raspistill version from userland/build/bin. That should give me the latest version right (or is that providing only a part of the fixes)?

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 12:24 pm

I think I was just able to download the new version because now it is done in 23 seconds with the same command string. That is much better!!!

Info rpi-update:
*** depmod 5.4.42-v7+
*** depmod 5.4.42+
*** depmod 5.4.42-v8+
*** depmod 5.4.42-v7l+

time raspistill --nopreview --metering matrix --thumb none --encoding jpg --quality 100 --raw --output test1.jpg --ISO 400 --exposure off --flicker off --awb auto -ss 10000000 --drc off --mode 3 --timeout 1 -st -ag 1 -v --roi 0.33,0.33,0.33,0.33 2>&1 | perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
[2020-05-21 14:22:10]
[2020-05-21 14:22:10] "raspistill" Camera App (commit a246147c21ae Tainted)
[2020-05-21 14:22:10]
[2020-05-21 14:22:10] Camera Name imx477
[2020-05-21 14:22:10] Width 4056, Height 3040, filename test1.jpg
[2020-05-21 14:22:10] Using camera 0, sensor mode 3
[2020-05-21 14:22:10]
[2020-05-21 14:22:10] GPS output Disabled
[2020-05-21 14:22:10]
[2020-05-21 14:22:10] Quality 100, Raw yes
[2020-05-21 14:22:10] Thumbnail enabled No, width 64, height 48, quality 35
[2020-05-21 14:22:10] Time delay 1, Timelapse 0
[2020-05-21 14:22:10] Link to latest frame enabled no
[2020-05-21 14:22:10] Full resolution preview No
[2020-05-21 14:22:10] Capture method : Single capture
[2020-05-21 14:22:10]
[2020-05-21 14:22:10] Preview No, Full screen Yes
[2020-05-21 14:22:10] Preview window 0,0,1024,768
[2020-05-21 14:22:10] Opacity 255
[2020-05-21 14:22:10] Sharpness 0, Contrast 0, Brightness 50
[2020-05-21 14:22:10] Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
[2020-05-21 14:22:10] Exposure Mode 'off', AWB Mode 'auto', Image Effect 'none'
[2020-05-21 14:22:10] Flicker Avoid Mode 'off'
[2020-05-21 14:22:10] Metering Mode 'matrix', Colour Effect Enabled No with U = 128, V = 128
[2020-05-21 14:22:10] Rotation 0, hflip No, vflip No
[2020-05-21 14:22:10] ROI x 0.330000, y 0.330000, w 0.330000 h 0.330000
[2020-05-21 14:22:10] Camera component done
[2020-05-21 14:22:10] Encoder component done
[2020-05-21 14:22:10] Starting component connection stage
[2020-05-21 14:22:10] Connecting camera preview port to video render.
[2020-05-21 14:22:10] Connecting camera stills port to encoder input port
[2020-05-21 14:22:10] Opening output file test1.jpg
[2020-05-21 14:22:10] Enabling encoder output port
[2020-05-21 14:22:10] Starting capture -1
[2020-05-21 14:22:32] Finished capture -1
[2020-05-21 14:22:33] Closing down
[2020-05-21 14:22:33] Close down completed, all components disconnected, disabled and destroyed
[2020-05-21 14:22:33]

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 12:30 pm

RoboRob wrote:
Thu May 21, 2020 12:16 pm
But I downloaded the code from github (https://github.com/raspberrypi/userland ... be0ea6536b) and compiled it. Then I called the raspistill version from userland/build/bin. That should give me the latest version right (or is that providing only a part of the fixes)?
There is also a firmware change, which you need to get via rpi-update, but I am not sure that has been released to rpi-update yet. If you are getting saner times, then perhaps it has.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
HermannSW
Posts: 2564
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 1:12 pm

jamesh wrote:
Thu May 21, 2020 12:30 pm
There is also a firmware change, which you need to get via rpi-update, but I am not sure that has been released to rpi-update yet. If you are getting saner times, then perhaps it has.
It has not. After rpi-update yesterday and not working, I did "sudo apt-get update" and "sudo apt-get upgrade" today. Still naushir's command just hangs and does not complete after something more than 100 seconds.
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 1:24 pm

HermannSW wrote:
Thu May 21, 2020 1:12 pm
jamesh wrote:
Thu May 21, 2020 12:30 pm
There is also a firmware change, which you need to get via rpi-update, but I am not sure that has been released to rpi-update yet. If you are getting saner times, then perhaps it has.
It has not. After rpi-update yesterday and not working, I did "sudo apt-get update" and "sudo apt-get upgrade" today. Still naushir's command just hangs and does not complete after something more than 100 seconds.
Do another sudo rpi-update today, it only arrived here in the Netherlands afternoon at 13:00.

naushir
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 45
Joined: Mon Apr 25, 2016 10:21 am

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 2:53 pm

RoboRob wrote:
Thu May 21, 2020 1:24 pm
HermannSW wrote:
Thu May 21, 2020 1:12 pm
jamesh wrote:
Thu May 21, 2020 12:30 pm
There is also a firmware change, which you need to get via rpi-update, but I am not sure that has been released to rpi-update yet. If you are getting saner times, then perhaps it has.
It has not. After rpi-update yesterday and not working, I did "sudo apt-get update" and "sudo apt-get upgrade" today. Still naushir's command just hangs and does not complete after something more than 100 seconds.
Do another sudo rpi-update today, it only arrived here in the Netherlands afternoon at 13:00.
Yes, the code is now available. Note, you also need to enable burst mode in order to bypass preview (otherwise, you will get 1 preview frame as well as a capture frame). I've edited my comment above and the command line I am using is:

Code: Select all

raspistill -t 10 -md 3 -bm -ex off -ag 1 -ss 100000000 -st -o long_exposure.jpg

User avatar
HermannSW
Posts: 2564
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 4:48 pm

naushir wrote:
Thu May 21, 2020 2:53 pm
Yes, the code is now available. Note, you also need to enable burst mode in order to bypass preview (otherwise, you will get 1 preview frame as well as a capture frame). I've edited my comment above and the command line I am using is:

Code: Select all

raspistill -t 10 -md 3 -bm -ex off -ag 1 -ss 100000000 -st -o long_exposure.jpg
Thank you !
I did another rpi-update, and now long exposure with up to 200s works fine, taking less than 2 additional seconds.


This time I did capture at daylight in room.
I had to place the ND4 filter directly in front of HQ camera lens.
20200521_181026.15%.jpg
20200521_181026.15%.jpg
20200521_181026.15%.jpg (186.9 KiB) Viewed 821 times

Even with that setup I had to close window shutter mostly in order to not get an overexposed imgage.
Second hand is invisible (unlike the lit second hand of smartphone analog clock I used before).
But you can see minute hand a bit unsharp because or moving 55 seconds:

Code: Select all

pi@raspberrypi4B2:~ $ time ( raspistill -t 10 -md 3 -bm -ex off -ag 1 --shutter 55000000 -st -o long_exposure_55s_f.jpg )

real	0m56.610s
user	0m0.000s
sys	0m0.081s
pi@raspberrypi4B2:~ $
long_exposure_55s_f.13%.jpg
long_exposure_55s_f.13%.jpg
long_exposure_55s_f.13%.jpg (217.28 KiB) Viewed 821 times

With 200 seconds exposure time I nearly had to close window shutter completely for avoiding overexposure.
Minute hand is washed out, but if you look carefully you see that minute hand moved more than 3 minutes in 100% part of 12MP image:

Code: Select all

pi@raspberrypi4B2:~ $ time ( raspistill -t 10 -md 3 -bm -ex off -ag 1 --shutter 200000000 -st -o long_exposure_200s_b.jpg )

real	3m21.604s
user	0m0.000s
sys	0m0.080s
pi@raspberrypi4B2:~ $ 
long_exposure_200s_b.part.jpg
long_exposure_200s_b.part.jpg
long_exposure_200s_b.part.jpg (14.3 KiB) Viewed 821 times
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8714
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 5:51 pm

6mm lens with the aperture shut nearly right down, a dark room, and a Image Engineering LED-panel set to 3secs per LED.

Code: Select all

pi@raspberrypi:~ $ time ( raspistill -t 10 -md 3 -bm -ex off -ag 1 --shutter 200000000 -st -o long_exposure_200s_b.jpg )

real	3m21.456s
user	0m0.000s
sys	0m0.103s
long_exposure_200s_b_1.jpg
long_exposure_200s_b_1.jpg (40.63 KiB) Viewed 789 times
8 + ( 5*10) + 9 = 67 LEDs lit (the first and last are only going to be partially lit). 67 * 3s = 201s.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

RoboRob
Posts: 58
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 6:03 pm

GREAT FIX, thanks!!!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26431
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 6:05 pm

6by9 wrote:
Thu May 21, 2020 5:51 pm
6mm lens with the aperture shut nearly right down, a dark room, and a Image Engineering LED-panel set to 3secs per LED.
1500 euro. Pretty sure a sense hat could do something like that!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8714
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 7:52 pm

jamesh wrote:
Thu May 21, 2020 6:05 pm
6by9 wrote:
Thu May 21, 2020 5:51 pm
6mm lens with the aperture shut nearly right down, a dark room, and a Image Engineering LED-panel set to 3secs per LED.
1500 euro. Pretty sure a sense hat could do something like that!
Come on, you know the imaging companies charge exorbitant amounts for test kit.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 2564
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Raspberry Pi High Quality Camera Long Exposures

Thu May 21, 2020 8:42 pm

jamesh wrote:
Thu May 21, 2020 6:05 pm
6by9 wrote:
Thu May 21, 2020 5:51 pm
6mm lens with the aperture shut nearly right down, a dark room, and a Image Engineering LED-panel set to 3secs per LED.
1500 euro. Pretty sure a sense hat could do something like that!
I was impressed by the idea 6by9 demonstrated, and even before your 1500€ statement I started to make this available cheaper with what I had at home. I found 1.40$ 8x8 dot matrix led I bought 3 years ago on aliexpress:
https://www.aliexpress.com/item/32702150050.html
You can get an Arduino Uno clone for 3$ on aliexpress.

I started based on this article:
https://create.arduino.cc/projecthub/SA ... rix-23475a

Unfortunately my 8x8 dot matrix led had an obscure pin ordering, was a riddle to find out pin to row/column position mapping.
This code does light 1 led for 3.333s, rows from top to bottom, columns from left to right:

Code: Select all

const byte rows[] = {9, 4, A3, 6, 10, A2, 11, A0};
const byte col[] = {2, 3, 7, A1, 8, 13, 12, 5};

byte a[8];
unsigned long nxt;
unsigned int pos;
unsigned int dt=3333;

void setup() 
{
  for (byte i=2; i<=13; i++)
    pinMode(i, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  for (byte i=0; i<=7; i++)
    a[i]=0;
  pos=0;
  a[pos/8] = 1<<(7-pos%8);  
  nxt = millis()+dt;
}

void loop() {
  if (millis() >= nxt)
  {
    for (byte i=0; i<=7; i++)
      a[i]=0;
    ++pos;
    pos%=64;
    a[pos/8] = 1<<(7-pos%8);  
    nxt = millis()+dt;
  }
//  delay(5);
  drawScreen(a);
}

void  drawScreen(byte buffer2[])
{ 
  for (byte i = 0; i < 8; i++)
  {
    digitalWrite(rows[i], HIGH);
    for (byte a = 0; a < 8; a++)
    {
      digitalWrite(col[a], (~buffer2[i] >> a) & 0x01);
      delayMicroseconds(100);
      digitalWrite(col[a], 1);
    }
    digitalWrite(rows[i], LOW);
  }
}
Why 3.333s? 200/3.333=60.006, so 3 leds remain completely off for 200s exposure time.

This was setup (I had to place a mini breadboard over the Arduino leds in addition, because they did flood 200s capture with red light):
20200521_221429.15%.jpg
20200521_221429.15%.jpg
20200521_221429.15%.jpg (174.63 KiB) Viewed 716 times

Now I captured 200s, and as expected 3 leds can be seen that were not lighted (room was completely dark, no filter used):

Code: Select all

pi@raspberrypi4B2:~ $ time ( raspistill -t 10 -md 3 -bm -ex off -ag 1 --shutter 200000000 -st -o long_exposure_200s_c.jpg )

real	3m21.808s
user	0m0.013s
sys	0m0.090s
pi@raspberrypi4B2:~ $ 
long_exposure_200s_c.15%.jpg
long_exposure_200s_c.15%.jpg
long_exposure_200s_c.15%.jpg (102.71 KiB) Viewed 716 times
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ada Shaine
Posts: 1
Joined: Mon May 25, 2020 4:11 am

Re: Raspberry Pi High Quality Camera Long Exposures

Mon May 25, 2020 4:14 am

Hey there,

I have a question. How to measure timing & synchronization of raspberry pi & on-board GPS?

Return to “Camera board”