Shot Histogram Request - page 42 - CHDK Releases - CHDK Forum

Shot Histogram Request

  • 467 Replies
  • 148365 Views
*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #410 on: 11 / September / 2013, 00:19:41 »
Advertisements
The camera is connected to an Arduino board and so I just sending a +5V or 0V to the USB port, not serial data streaming.

Thank you for the link but I prefer just receive a 5+V or 0V instead of a real data streaming... it's easier to handle this with the arduino board.

I tried to use the script without the USB triggering and the timing is perfect.
I just need to receive on the USB a pulse to obtain the sync with the board.
The USB connector has a data line, and a power line (red wire). Normally, the power line is always 5 volts. The power comes from the external computer, not the camera. The camera, and CHDK, can sense if the power is on, without any data being transmitted. I suspect that you're leaving the power on, and sending pulses over the data line. My original script looks for changes in the power line, not the data line, so it wouldn't be triggered. I think there's a way to shut the USB power off and on with the board, but I'm not sure how.

But I think the CHDK remote trigger can also sense a change in the data line, so it would work the way you're doing it, like you said. My modified script senses the CHDK remote, so it should trigger the way you're doing it. Did you try the new script? I didn't change the file name, but the I put the date in the script name at the bottom of the screen.

CHDK can only send data on the data lines, and can't change the power lines since the power is supplied by the computer (your board). But you wouldn't need to read the actual data with the Arduino, just sense when there WAS data. The script could just send a byte of garbage data between shots.

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #411 on: 11 / September / 2013, 02:07:28 »
I've been out taking time lapses a lot lately, while the weather is still good for a few more weeks. I noticed that 2 Iridium flares were coming up near my house, so I set up to photograph them. Here's the two time lapses I made with the flares in them. More info is in the descriptions on YouTube:

http://www.youtube.com/watch?v=Ap38PBGcSX8#

http://www.youtube.com/watch?v=7NQ0ZSFHFK0#

I set up the SX50 to watch the city get dark after sunset, while the G1X was watching the Iridium flare.
http://www.youtube.com/watch?v=dRnDoNcUDOY#

Last night, I tried out the D20(wide) and the SX260(zoomed) on the same sunset. I really like the color changes. The D20 lasted a lot longer than the SX260.

http://www.youtube.com/watch?v=WGfDP9PMmbs#

http://www.youtube.com/watch?v=iUZVhwvobuw#
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Shot Histogram Request
« Reply #412 on: 11 / September / 2013, 04:21:01 »
Quote
The USB connector has a data line, and a power line (red wire). Normally, the power line is always 5 volts. The power comes from the external computer, not the camera. The camera, and CHDK, can sense if the power is on, without any data being transmitted. I suspect that you're leaving the power on, and sending pulses over the data line. My original script looks for changes in the power line, not the data line, so it wouldn't be triggered. I think there's a way to shut the USB power off and on with the board, but I'm not sure how.

I've the data sheet of the cable and I connected the +5V from the Arduino board to the red wire.
Effectively with the standard remote triggering CHDK it works.

Another strange behavior is this: the camera is on (remote triggering OFF), I don't start the script, I connect the cable and the shutter start to open/close (without capture pictures).

I tried the new script, it works with the keys but not with USB.

Maybe we can try using the USB +5V just to start to take pictures every x second (without waiting for USB) and sending a byte of garbage on the data out after every shot. I'll try to read that signal from the Arduino.

Thanks


Re: Shot Histogram Request
« Reply #413 on: 11 / September / 2013, 08:52:37 »
Another strange behavior is this: the camera is on (remote triggering OFF), I don't start the script, I connect the cable and the shutter start to open/close (without capture pictures).
Many Canon P&S cameras will switch to playback mode when USB power is applied if CHDK remote mode is disabled.  The lens will also retract if and extended retract delay has not been selected in the Canon menus.  Could this be what you are seeing?

I tried the new script, it works with the keys but not with USB.
Quote
Maybe we can try using the USB +5V just to start to take pictures every x second (without waiting for USB) and sending a byte of garbage on the data out after every shot. I'll try to read that signal from the Arduino.
I might be wrong but I suspect the CHDK USB commands for sending data messages will only work if a valid host / slave relationship has been negotiated between the camera and PC.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Shot Histogram Request
« Reply #414 on: 11 / September / 2013, 09:13:57 »
Another strange behavior is this: the camera is on (remote triggering OFF), I don't start the script, I connect the cable and the shutter start to open/close (without capture pictures).

Many Canon P&S cameras will switch to playback mode when USB power is applied if CHDK remote mode is disabled.  The lens will also retract if and extended retract delay has not been selected in the Canon menus.  Could this be what you are seeing?

The camera doesn't retract the lens but can be something of similar... the screen switch continuously between black and the live view.
Quote
I tried the new script, it works with the keys but not with USB.

Maybe we can try using the USB +5V just to start to take pictures every x second (without waiting for USB) and sending a byte of garbage on the data out after every shot. I'll try to read that signal from the Arduino.

Quote
I might be wrong but I suspect the CHDK USB commands for sending data messages will only work if a valid host / slave relationship has been negotiated between the camera and PC.

I hope you're wrong but we've to try... :-)

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #415 on: 11 / September / 2013, 16:07:51 »
The camera doesn't retract the lens but can be something of similar... the screen switch continuously between black and the live view.
It does sound like it's taking pictures. If new pictures aren't appearing on the card, maybe it's a bug in the new remote capture feature that uses the filewrite hook?
Quote
I might be wrong but I suspect the CHDK USB commands for sending data messages will only work if a valid host / slave relationship has been negotiated between the camera and PC.
reyalp probably knows more about it. It seems like you should be able to output 1 byte to the usb port without a negotiated connection. After all, there has to be a way to negotiate a connection.

Maybe you should start a new topic, "Using Arduino with CHDK". Someone who has done it can probably help you better.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Shot Histogram Request
« Reply #416 on: 12 / September / 2013, 10:18:25 »
@lapser: I also have a SX210 IS (100c). Could you attach a build for that camera, so I can try if I run into the same problems like with my G1 X?
That would be great. Thanks!

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #417 on: 13 / September / 2013, 14:03:28 »
@lapser: I also have a SX210 IS (100c). Could you attach a build for that camera, so I can try if I run into the same problems like with my G1 X?
That would be great. Thanks!
Will do. I'll have to test single shot mode in all my cameras too. Thanks for helping to find this problem. Here's the answer to the questions you brought up in the G1X thread:

Sorry, very stupid question... I figured it out. It's just the setting in the canon menu :)
But it's interesting: I've always shot time lapses in single shot mode. Now I tested in the continuous mode and it works perfectly.

So what is actually the difference between these two modes (except that you loose all pictures when you run out of power in continuous mode)?
90% of my questions are "stupid". And if I don't feel stupid after figuring something out, I probably haven't really figured it out.

I'm really glad you tested it in single shot mode, since I haven't used single shot very much. I tested the script on my G1X in single shot and it brings out the problem for me too!

There are no real advantages of single shot mode with my time lapse script, except the possibility of losing pictures with an external battery. The solution to that problem isn't to use single shot mode though. It's to stop the script when the external battery gets near its low voltage cutoff.

A script just simulates pushing the shutter button to take pictures. You push the shutter yourself, without a script, to see what happens.

In single shot mode, the script pushes the shutter all the way down, and lets it up half way between pictures.  The advantage of letting it up only half way is that the camera doesn't re-focus and measure exposure before each shot. All the pictures are taken with the same exposure as the first shot.

In continuous mode, the script holds the shutter all the way down for the entire time. The focus and exposure behavior is the same as single shot, but the shot rate is about twice as fast. In addition to the faster shot rate, the minimum time between shots is about .25 seconds in continuous mode, and .75 seconds in single shot. This is great for night shots, because you don't miss as many brief events, like meteors.

My CHDK build includes a shot meter function that measures the brightness of 4 different image areas after the shot, from the raw image when it's in memory. It's this raw image that was color shifted, and caused the bad meter readings and fluttering. The script uses the meter readings to set the exposure of the next shot, in 1/96 F-stop (ev) units.

In-camera real time shot metering is something that I don't think has ever been done before. It's much more accurate, and faster, than the built in camera exposure meter, especially at low light levels. The disadvantage is that you don't know the meter reading until after the shot. But if you're willing to take multiple shots, like with a time lapse, there are lots of possibilites, like optimum exposure bracketing and HDR with a minimum of shots. The multiple metering areas are quite useful too.

But the most exciting use of shot metering to me is doing smooth exposure adjustments in day to night time lapses. This is the so called "Holy Grail" of time lapse photography. My script produces pictures that can be converted to a time lapse straight out of the camera, with no post processing of the images. I don't think there's any other way to do this. The only thing comparable is "bulb ramping" where an external controller holds the remote shutter down. There's are smartphone apps coming out that control the camera through PTP and can adjust exposure between shots. I assume they use the phone as an exposure meter, but I haven't tried them. I think you still have to post process the images to get rid of the flickering.

The other major addition to CHDK in my build is the set_shot_interval(interval) function. What this does is hold the camera at the point immediately before it opens the shutter until the time from the last shot is equal to the specified interval. The time between shots is perfectly accurate. When I take time lapses with 2 different cameras at the same time, they stay perfectly in sync with each other as long as the shutter time is at least ~300 msec less than the interval. This has real potential for multi-camera synchronization without requiring usb cables connected to each camera.

[EDIT]
Another big advantage of continuous over single shot mode is that the pictures are displayed on the screen between shots, as you've probably noticed. In single shot, the screen is blank most of the time.

New build is attached now:
« Last Edit: 13 / September / 2013, 14:21:10 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Shot Histogram Request
« Reply #418 on: 13 / September / 2013, 14:50:10 »
.
« Last Edit: 13 / September / 2013, 14:53:03 by Microfunguy »

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #419 on: 16 / September / 2013, 15:27:00 »
I captured some fast moving clouds at sunset last night from a bridge over the Willamette River. Like a lot of the time lapse videos I make, there are a lot of pixelation artifacts in the very dark areas of the pictures. I always thought this was from the mp4 compression, which it may be, but I had another idea.

I have a linear underexposure fudge factor that starts at +500 Bv96, and underexposes by 2 EV at -500 Bv96. This makes the time lapses look more natural as the light fades. Without the underexposure, everything gets way too bright after dark.

However, this greatly reduces the precision of the low light shots. It's the opposite of ETTR. It might be better to let the camera expose the dark scenes normally, and fix it on the computer later, i.e. with Lightroom. The problem is varying the brightness of the pictures smoothly as it gets darker. There's a program called LRTimelapse that can do this, but the number of pictures I take would overwhelm it, and it would take about 2 days of computer time to process all the photos.

One possibility would be to take every other shot at 2 EV brighter, and blend them together as 2 tracks in the video, fading one to the other. This is kind of like HDR, but it would decrease the shot rate quite a bit at longer shutter times.

Anyway, here's the video from last night:
http://www.youtube.com/watch?v=u1yy1qXU-WU#



EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics


SimplePortal © 2008-2014, SimplePortal