blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Images progressively blurry as the day goes on

Fri Feb 13, 2015 11:08 pm

I'm working on a long-term time lapse project with a B+ and camera board and I'm seeing some strange blurriness in the images as the day gets brighter. Here are two examples, taken at 10am and 11am this morning. The raspistill parameters were exactly the same:

Image

Image

From the EXIF data visible to Aperture, I can only see that the shutter time was shorter at 11.

As the day goes on they get progressively more blurry, then at night it sharpens back up.

Anybody have a suggestion? It is warm up there and gets warmer as the day progresses. Is sharpness correlated with temperature?

Thank in advance!

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 2:12 pm

I can only say that I observed this too when I did day and night timelapses. When it got really bright during the day the image got fuzzy.

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 4:40 pm

Weird. Possibly be the lens warming up and distorting?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 4:45 pm

The most noticable difference between those images is change in contrast. In the 'blurry' one the dark areas are not very dark. Could it be light on the window or lens as the sun moves?

blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 5:07 pm

PiGraham wrote:The most noticable difference between those images is change in contrast. In the 'blurry' one the dark areas are not very dark. Could it be light on the window or lens as the sun moves?
If you right-click on those images and see them in full resolution, you can see that the focus has changed substantially. (And it gets worse over the day.) I'm less concerned with the contrast change (as the sun has moved a bit), though the changes may be related.

The camera is behind a window and is shielded with a hood to prevent reflections from the inside making their way into the image.

As far as the lens distorting, that's a possibility. If you compare the two images you can also see a shift of the whole image, as well as a non-uniform smear of the image (directional, not just unfocused blur).

User avatar
jbeale
Posts: 3441
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 5:17 pm

I think the lens-sensor distance difference between sharp focus and not-sharp on this camera is measured in microns. So I think thermal expansion as ambient temperature changes could do it.

blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 5:19 pm

jbeale wrote:I think the lens-sensor distance difference between sharp focus and not-sharp on this camera is measured in microns. So I think thermal expansion as ambient temperature changes could do it.
Aha. That makes sense. I'll get out my heat gun and do a little bit of (gentle) experimenting. Maybe I need a better/different lens. I'd totally appreciate suggestions!

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 5:25 pm

blackketter wrote:
PiGraham wrote:The most noticable difference between those images is change in contrast. In the 'blurry' one the dark areas are not very dark. Could it be light on the window or lens as the sun moves?
If you right-click on those images and see them in full resolution, you can see that the focus has changed substantially. (And it gets worse over the day.) I'm less concerned with the contrast change (as the sun has moved a bit), though the changes may be related.

The camera is behind a window and is shielded with a hood to prevent reflections from the inside making their way into the image.

As far as the lens distorting, that's a possibility. If you compare the two images you can also see a shift of the whole image, as well as a non-uniform smear of the image (directional, not just unfocused blur).
I did look at the full size images.

Note that a soft image is not the same as poorly focused image. Poor focus will give an soft image, but other things can produce similarly soft images that refocussing will not improve.

As an example, 'soft focus effect' can be acheived by putting a lightly diffusing filter over the lens (cling film is sometime used) . This does not alter the focus, but produces a softened image.

I'd look at scattering on the window and in the air, which will soften an image and reduce contrast.
If the plastic lens housing gets hot it could distort, but it seems unlikely that it would be sufficient to notice.
The Lens-sensor distance is small, but it's the proportionate change that matters. Any thermal expansion of the tiny housing will be tiny.

If this is a focus problem you should find that you can eliminate the effect by refocussing the lens later in the day. If that is not possible the effect is not lens focus.

You could try a shroud on the outside of the window.

Monitor temperature to look for correlation with temp while eliminating lighting changes.

If you have a widow facing away from the sun late in the day I suggest you set the camera there for a test.

Another thing you could try is to use a camera phone to take pictures of the scene at the same time of day from the same spot and see if they show something similar or not.

blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 5:59 pm

Ok, quick test verifies that heat is an issue. Below are hot and cold pictures, after heating another camera module a bit with a hot rework station (set to max 100C, though I don't think it got that hot), then letting it cool for a minute:

Image
Image

Not sure how to verify if it's the sensor or the lens assembly that's affected by the heat...

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 6:07 pm

Can you refocus a warm camera?

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 6:12 pm

Just checking. Is this a standard Pi camera, or a Pi Noir?

User avatar
jbeale
Posts: 3441
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 6:19 pm

Nice experiment; clearly temperature has an effect! My first guess is that it's simply the plastic lens housing expanding with temperature, although it could also be the lens itself (if it is also plastic) deforming slightly as well. I have refocused these (nominally fixed-focus) camera modules with two pairs of small pliers but it is a bit cumbersome, tricky to do precisely, and you are still left with a camera that is in focus at only one temperature. I have several aftermarket (ebay) versions with M12 lenses, and one conversion I did myself, but I can't say they have any better performance. Actually for absolute resolution I think they are worse than the original module, I got them only because I needed a longer focal length.

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 6:22 pm

The point of refocusing it to confirm that the effect is due to movement of the lens. If refocusing correct the image sharpness then the issue is that the lens-sensor distance has changed. If it is not possible to restore sharpness by focusing the camera something else is the cause.

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 6:25 pm

The lens housing is fixed to the pcb with a sticky pad. Press the housing and it move a bit. If that has anything to do with it then perhaps fixing the housing to the PCB with epoxy would cure it.

blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 7:09 pm

Wow, thanks for the help everybody!

- Pressing on the warm lens doesn't affect focus, I can't get it to move appreciably. So I don't think it's the adhesive/gasket.

- Refocusing the lens while warm brings it back into focus. It goes out of focus when it cools down. This implies that it's the lens assembly and not the sensor.

- These are regular (not NoIR) cameras. One is authentic, the other is a VILROS clone. Both exhibit the same behavior. (I didn't realize that the first camera I bought was a clone, saw this behavior and then bought a new one. The clone seems to be a bit worse than the authentic one in this regard.

gordon77
Posts: 4004
Joined: Sun Aug 05, 2012 3:12 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 7:30 pm

How much is the temp in your room varying during the day?

blackketter
Posts: 8
Joined: Thu Jan 29, 2015 10:30 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 9:10 pm

gordon77 wrote:How much is the temp in your room varying during the day?
A lot. It's a south-facing window. At night it probably gets down to around 10C.

Just broke out the cooking probe thermometer. Wow. The temperature at the lens is around 59C right now, which is probably the peak.

So, yeah, probably around a swing of 50C.

I think the spec for the camera is to 50C, so right now I am operating outside of spec. But I think it goes out of focus below that point. I'll check in the morning and report back.

gordon77
Posts: 4004
Joined: Sun Aug 05, 2012 3:12 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 9:14 pm

As you say wow!

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 9:25 pm

60 C? is it in direct sun?
Use a sun shade?
Presumably the air temperature in the room is much cooler than that. You could use a fan.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 10:25 pm

PiGraham wrote:The lens housing is fixed to the pcb with a sticky pad. Press the housing and it move a bit. If that has anything to do with it then perhaps fixing the housing to the PCB with epoxy would cure it.
The sensor/lens package is fixed with a sticky pad so that doesn't change anything.

OP, you obviously have to keep the camera in the shade.

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

Re: Images progressively blurry as the day goes on

Sat Feb 14, 2015 11:03 pm

poing wrote:
PiGraham wrote:The lens housing is fixed to the pcb with a sticky pad. Press the housing and it move a bit. If that has anything to do with it then perhaps fixing the housing to the PCB with epoxy would cure it.
The sensor/lens package is fixed with a sticky pad so that doesn't change anything.

OP, you obviously have to keep the camera in the shade.
My thought was that the fixing to the PCB might be susceptible to heat, rather than the plastic housing itself. It doesn't seem that this is the case, but it was worth considering. If the glue moved then more rigid glue could be a fix. There is some flex in the pad. I can see the housing move relative to the PCB with finger pressure.If it was epoxied to the board it wouldn't do that.

It is very surprising that the housing itself can distort enough to disturb the focus, but it seems that may be the case.

Shading & cooling seem to be the way to go.

ZuLuuuuuu
Posts: 26
Joined: Thu May 23, 2013 6:30 am

Re: Images progressively blurry as the day goes on

Fri Mar 27, 2015 1:43 pm

Hello we are facing a similar problem:

We are doing a calibration process which requires a very stable camera with fixed FOV. We can calculate the difference between two images of the same scene using our calibration software and we saw that after we first boot up Raspberry, while we are getting images from the camera module, the FOV of the camera changes slightly. It changes as much as 1 pixel in first 5 minutes and almost 2 pixels in about 20 minutes. Then the change slows down.

We saw this thread, our guess is also that it is something to do with temperature but we are not sure. The temperature of the room we are in is quite stable. Also we tried hard not to shake the camera during the tests. So if it is temperature, then even the internal temperature of the camera causes FOV changes.

We tried separating the plastic black housing from the PCB and fixing the housing via a cramp but it is still changing. So the glue thing between housing and the PCB might not be the problem.

My questions are:

1) Do you think it is the temperature?

2) If yes, which part is the most susceptible to heat changes? The lens? The plastic housing? The sensor? The glue that joins the plastic housing and the PCB?

3) What can we do to stabilize the camera FOV?

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Images progressively blurry as the day goes on

Fri Mar 27, 2015 10:51 pm

The sensor will generate a little heat with each exposure, the longer the exposure the more heat.

Return to “Camera board”