Night-time time-lapse - page 4 - Completed and Working Scripts - CHDK Forum  

Night-time time-lapse

  • 80 Replies
  • 78671 Views
*

Offline reyalp

  • ******
  • 14118
Re: Night-time time-lapse
« Reply #30 on: 20 / September / 2008, 17:21:06 »
Advertisements
Of course, those strings should be immediately garbage collectible, so it shouldn't really run out. However, as this thread shows, the amount of memory available varies a lot across different cameras, and is quite low on some.

The lua garbage collector doesn't have a hard limit, and doesn't attempt to collect if malloc returns null (this makes sense on things like PCs where, but less under CHDK), so it's quite possible for it to hit that error even though there would be enough memory if it collected. This is probably something we can improve.
Don't forget what the H stands for.

Re: Night-time time-lapse
« Reply #31 on: 24 / September / 2008, 06:55:45 »
SX100, S3

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Night-time time-lapse
« Reply #32 on: 24 / September / 2008, 08:23:21 »
It's not by chance they limit the camera automatic shutter speed to 1 sec.

They do it beacuse they know meter readings aren't reliable.

This is an actual graph of the meter readings at sunset over about 800 frames. You hit a very hard floor!!!

Re: Night-time time-lapse
« Reply #33 on: 24 / September / 2008, 21:56:50 »
Thanks for that graph; incidentally the tests I had been doing stopped at meter readings just about -200.

But the graph actually suggests that the meter is capable of reliable readings all the way down to -800 where it stops. It looks like the camera is just rounding off the output of the meter to a few specific values, but without the rounding off we would have a smooth curve all the way down to -800. If the readings were really unreliable - that is, inconsistent, jumping - then it wouldn't consistently go from one rounded value to the next. Rather, it would be jumping back and forth between steps before settling on a new step.

The reason for the 1 second limit and the step curve is the same - but it doesn't look like it's an incapable meter. Apart from the graph there is another reason I suspect so. DSLRs don't have the luxury of being able to use the main sensor for metering - rather, they must have a small secondary sensor, and that sensor only gets part of the light because the rest goes through the viewfinder. I doubt the secondary sensor in a DSLR has better light gathering capability than the main ccd in our compacts, yet DSLRs don't stop metering at night. So I don't see much reason why compacts shouldn't be able to meter even better at night - other than Canon not wanting them to be that capable.
SX100, S3


*

Offline reyalp

  • ******
  • 14118
Re: Night-time time-lapse
« Reply #34 on: 24 / September / 2008, 22:28:34 »
Graph: Are those the last 2 bits of the meter value ? ;)
Quote
I doubt the secondary sensor in a DSLR has better light gathering capability than the main ccd in our compacts, yet DSLRs don't stop metering at night.
I'd bet on it. P&S sensors are designed to pack a lot of pixels in a tiny space, at the expense of basically everything else. A dedicated light meter doesn't need to pack 10 million sensors into an area the size of a your pinky nail.
Don't forget what the H stands for.

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Night-time time-lapse
« Reply #35 on: 25 / September / 2008, 02:37:11 »
Graph: Are those the last 2 bits of the meter value ? ;)

Yes, that's somehow how I see that.

The variation in the height of those steps is odd, too.

I first thought that would be because of linear-to-exponential conversion, but probably it should be the opposite (lowest steps are the highest).

DSLRs don't have the luxury of being able to use the main sensor for metering...

Actually, without knowing the details of a DSLR I was thinking exactly the opposite. The sensor of a DSLR meter must have a resolution of few Kpixels, not Mpixels. This means that each individual pixel can afford to collect more signal


Re: Night-time time-lapse
« Reply #36 on: 25 / September / 2008, 22:30:07 »
Look at it from the DSLR manufacturers' point of view. Their objectives are:
1) Employ a secondary sensor that meets a specific requirement on light sensitivity.
2) Make that sensor as small and cheap as possible.
So the question is, how big of a sensor do they need to get the desired sensitivity? My guess is that it's smaller (total effective light gathering area, not per pixel) than the main CCD on a compact. It's possible that the compact only reads/processes part of the CCD to speed up things when lighting is good, but it CAN (and should!) use the full CCD if needed. My compacts are quite a bit slower in the dark (on manual focus) which could be because they process as much of the CCD as needed to get a reliable reading. In any case, from the graph it appears that the readings are reliable (consistent) down to -800, but that the camera unfortunately rounds them off brutally.  :(

Regarding the odd variations in step sizes I've seen these oddities elsewhere too. The exposure times used on automatic settings mostly agree with 1/32 ev steps, but then there are odd steps in between. The steps in aperture values are quite odd, though also averaging about 1/32 ev. Sometimes the steps are so much off that they go "the wrong way" - that is, the camera decreases the exposure when the meter value goes down.
SX100, S3

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Night-time time-lapse
« Reply #37 on: 26 / September / 2008, 01:45:05 »
Quote
In any case, from the graph it appears that the readings are reliable (consistent) down to -800, but that the camera unfortunately rounds them off brutally.

How can you distinguish this from a clipping in the original sensor data?


Do some experimentig... Shot a shot at 0.5", iso 800 in a pitch dark night.

Look at the resulting photo. Do you believe this is all the information that the camera originally had, i.e. that no "rounding" took place? Otherwise this would mean that the Canon engineers were on purpose throwing away useful data from the sensor.

First of all, if you pull up the image very strong with levels you will notice the exact same phenomenon: a strong quantization error in dark areas.

Also, a good part of the image is still under-exposed. This means that when collecting data for the photo the sensor just does not have enough information about that area, therefore it bould be impossible to assess the brightness of the area.

The only workaround would be to increase the "shutter time" of the meter, i.e. to keep the meter "open" for a longer time. I have no idea about the maximum time the camera keeps the meter reading, but it certainly has a maximum that well below a second, or you would feel a sensible delay. We could find that limit and hack it away, I guess..

I in effects thought about doing something equivalent:
1) shoot a test shot at 4", ISO 3200
2) use that shoot to measure exposure
3) shoot the real shot at (say) 30" ISO 100

But for my purpose (a sequence of slowly-changing shots) the approach I used was easier:
1) shoot a shot
2) use that image to correct exposure
3) GOTO 1



Re: Night-time time-lapse
« Reply #38 on: 26 / September / 2008, 19:49:11 »
Admittedly, the metering discussion is just out of interest and can be considered off topic. In practice, your method for determining correct exposure is as good as anything I can think of.

I think I understand your arguments, but maybe not. I'll try to describe in more detail my understanding of metering which will hopefully explain why I think what I think.

1) You take XXX amount of dark frames, that is, no light at all admitted to the sensor. For each frame, add up the photon counts for all pixels to get a number. This way you can obtain a pretty reliable estimate of what the photon count due to noise is and how much it varies (e.g. the standard deviation of the XXX measurements). You can split the sensor into smaller areas, all the way down to each individual pixel, to get a reliable estimate of what the average noise photon count and its standard deviation is for that area.
2) Admit just a little light to the sensor. Each individual pixel may not have received enough photons that the reading is above noise average + std.dev. - that is, for an individual pixel you won't know if the photon count is all due to noise. Visually, the pixel may simply look black. But when you add the count for sufficiently many pixels, then at some point it will grow above the noise average + std.dev. for the number of pixels considered. So, what you can do is to keep reading pixels until you get above a reliability threshold, say, the noise average + 3*std.dev. for the number of pixels you've read. This way you can in principle get a reliable reading of the light level even if the whole image looks pitch black to your eyes.

If the light level gets so low that the "signal photon count" for the whole sensor is comparable to or below the std.dev. in noise photon count for the whole sensor, then the number the meter spits out will jump around due to the std.dev. in the noise photon count. But if the "signal count" is comfortably above the std.dev. in noise count for the whole sensor, then the meter should give a reliable reading consistent from time to time. In your graph there is no jumping to be seen, indicating that the readings are still consistent down to ~-800.

I can't imagine that the sensor itself does any rounding off/clipping; it should hand over the raw photon counts and let the rest be up to the camera.
SX100, S3

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Night-time time-lapse
« Reply #39 on: 27 / September / 2008, 02:47:30 »
Quote
I can't imagine that the sensor itself does any rounding off/clipping; it should hand over the raw photon counts

Photons are a bit too many to count :-)

In practice, each pixel of the sensor gives a tiny electric signal that is connected to a small amplifier. We can tell the amplifier how much we want the signal to be amplified (this is what we pretend to be the ISO settings).

Let's suppose we pump the umplifier up to its maximum gain (we set ISO to the highest practical level)

The signal then goes to an analog-to-digital converter that gives us 10 bits of information. That is, for each pixel we can read values of luminisity that goes from 0 to 1023.

For the ease of discussion, let's assume these values are linear (which of course they aren't). This means that if the top range of that signal is X (in an arbitrary unit) the minimum range we can read is X/1024.

The sensor might have smaller signals, but as soon as we digitize it we aren't able to read values below X/1024 ... It's either 0 or X/1024, not 0.5 * X/1024 ... no intermediate values are redable.

That's what you call 'clipping': a clipping takes place automatically as soon as you digitize a signal.

PS.
Just to add confusion, and to make you angry:-), we know (see Bit depth of raw files?) that at least in some powershots the analog-to-digital converter actually has 12-bits, but canon decided to connect only the top 10 bits, so actually a clipping does take place.

Oh, the things I would do to have the rest of that diagram!!!


« Last Edit: 27 / September / 2008, 02:50:57 by fbonomi »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal