|
Post by jrwilling on Aug 15, 2019 11:31:49 GMT -8
Perhaps it's just me, but it seems like since the SkyWeather unit has a sunlight sensor that it could be read prior to taking a picture and the resulting value used as a guide to the camera adjustments for any given time of the day.
Not something that I have the time to try coding up at present, but just thought I would toss it out as a concept.
|
|
|
Post by SDL on Aug 18, 2019 12:54:33 GMT -8
Very true. What I am wondering about is why the "auto" exposure is not working correctly. This is a big question for me. I haven't had time to work on it yet, beyond getting more data from debugging.
I'll be looking at this next week.
BP
|
|
|
Post by jrwilling on Aug 29, 2019 5:55:35 GMT -8
So... any new insights on the camera exposure issue?
|
|
|
Post by SDL on Aug 29, 2019 6:04:35 GMT -8
Didn't get to it last week. I'll get into this tomorrow. I have one test system that is behaving similarly to yours so I can work on it!
BP
|
|
|
Post by mikemcdonald on Aug 30, 2019 3:23:18 GMT -8
Checking around for help with this issue, I found oter products with the same issue. In at least a few of them, the problem was ascribed to simply creating the camera and taking the picture (as happens in SkyCamera.py) without allowing time for the camera to "warm up". This means, supposedly, that time is not allowed for the camera to properly adjust auto-exposure and auto-white balance.
I noticed in the SkyCamera code that it looks a lot like sample code from the picamera.py docs, shown below:
camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
# Camera warm-up time
sleep(2)
camera.capture('foo.jpg')
But SkyCamera.py lacks the delay
camera = picamera.PiCamera()
camera.exposure_mode = "auto"
try:
camera.rotation = 180
#camera.rotation = 270
camera.resolution = (1920, 1080)
# Camera warm-up time
camera.capture('static/skycamera.jpg')
camera.capture('static/skycamera-raw.jpg')
So I added the 2 second warm-up time back and will see how that works. Should have a useful result later this morning.
|
|
|
Post by mikemcdonald on Aug 30, 2019 3:30:43 GMT -8
This quote, found on a raspberrypi.org forum, should provide some insight:
|
|
|
Post by mikemcdonald on Aug 30, 2019 3:56:10 GMT -8
Sorry for the rapid-fire posts, but this result was super fast. Adding the 2 second delay definitely fixed the over-exposure problem. Seems this is just how the camera works. The first several frames are used to calculate AWB and other auto-stuff, so they need to be discarded. Below is the code I am using and it's taking one properly exposed photo after another.
camera = picamera.PiCamera()
camera.exposure_mode = "auto"
try:
camera.rotation = 180
#camera.rotation = 270
camera.resolution = (1920, 1080)
# Camera warm-up time
time.sleep(2)
camera.capture('static/skycamera.jpg')
camera.capture('static/skycamera-raw.jpg')
|
|
|
Post by jrwilling on Aug 30, 2019 6:39:04 GMT -8
Added the delay line to the SkyCamera.py file on my unit as well, and while I'll probably wait for a bit before a final decision, the half dozen of so pix I have viewed so far appear to be properly exposed.
Thanks!
|
|
|
Post by mikemcdonald on Aug 31, 2019 5:29:47 GMT -8
Well, my camera took great pictures all day long.
|
|
|
Post by topher2880 on Aug 31, 2019 18:21:09 GMT -8
|
|
|
Post by SDL on Sept 1, 2019 12:48:32 GMT -8
Son of a gun! All hail the brilliance of our hero Mike Macdonald. I'll add this immediately to the software. Makes perfect sense. And I go back and look my old code, and lo, I had the delay.
Dumb, dumb, dumb, BP. Good thing it's a Sunday and and I can get this out!
BP
|
|
SoCoDoug
New Member
Posts: 8
Raspberry Pi: Yes
Other Device: SkyWeatherPi
|
Post by SoCoDoug on Sept 7, 2019 6:54:23 GMT -8
I just updated the software on my SkyWeather and the exposure issue appears to be resolved. Much better daytime photos in bright sunlight. Thanks for all the effort you put into this.
Doug
|
|
|
Post by SDL on Sept 10, 2019 12:47:25 GMT -8
You guys are welcome! It was my silly mistake in any case. No beer for me.
BP
|
|
|
Post by jaybird116 on Feb 16, 2020 17:36:31 GMT -8
How does one use the existing I/R cut filer in this camera? I looked in the SkyCamera.py and looked through the link posted at the beginning of this thread but saw no option for it and am guessing its not that easy. I have one of my demo cameras with I/R that covers the same area as the weather station and figured I could get some night shots.
|
|
|
Post by SDL on Feb 17, 2020 7:52:45 GMT -8
|
|