Reading sensor data without closing shutter? - page 6 - Script Writing - CHDK Forum

Reading sensor data without closing shutter?

  • 70 Replies
  • 34609 Views
*

Offline c_joerg

  • *****
  • 1251
Re: Reading sensor data without closing shutter?
« Reply #50 on: 25 / December / 2018, 13:09:03 »
Advertisements
Maybe your camera has excellent sensor.
May be  ;)

I tried this

Code: [Select]
call_func_ptr(0xFC5A460F) --EnableHeadDirectCapturePath_FW
frsp_shoot()
and this

Code: [Select]
call_func_ptr(0xFC5A4615) --DisableHeadDirectCapturePath_FW
frsp_shoot()

and I can’t see any differences. No bad pixels…
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline srsa_4c

  • ******
  • 4451
Re: Reading sensor data without closing shutter?
« Reply #51 on: 25 / December / 2018, 13:17:50 »
It might be useful to allow capture without saving the image at all (which I guess would happen if CHDK raw/DNG not enabled), for raw metering or other analysis on full res raw data. If the buffer gets clobbered after the shot (e.g. by live view) that could be an issue. To avoid that, the MenuOut might need to be under script control
I've been trying to move the raw processing part to spytask, but I could not come up with a solution that does not block script execution. Ideally, I'd like to avoid splitting the MenuOut part to a separate script command.
During regular shooting, we have physw to run scripts and spytask for raw processing. But, other firmware tasks do the actual shooting.
When shooting frsp, we only have physw and spytask for everything (not counting the dng task).

@Ant
We could either introduce some new #define for camera specific code in shooting_shoot_frsp(), or, we could use function pointers that would be called before/after _DoMovieFrameCapture(). Those pointers would be set up from camera specific code during camera init, if the port required them.


edit:
It's likely possible to get more raw types using either DoMovieFrameCapture or other similar functions.
« Last Edit: 25 / December / 2018, 13:32:02 by srsa_4c »

*

Offline Ant

  • *****
  • 509
Re: Reading sensor data without closing shutter?
« Reply #52 on: 25 / December / 2018, 14:19:09 »
We could either introduce some new #define for camera specific code in shooting_shoot_frsp(), or, we could use function pointers that would be called before/after _DoMovieFrameCapture().

I don't think it's good idea to put camera specific code into "\platform\generic\" directory. I prefer to use my own implementation of function shooting_shoot_frsp() from \platform\m3\shooting.c

*

Offline Ant

  • *****
  • 509
Re: Reading sensor data without closing shutter?
« Reply #53 on: 25 / December / 2018, 15:41:27 »
and I can’t see any differences. No bad pixels…


Are you using this build?

« Last Edit: 25 / December / 2018, 15:47:35 by Ant »

*

Offline reyalp

  • ******
  • 14125
Re: Reading sensor data without closing shutter?
« Reply #54 on: 25 / December / 2018, 16:09:52 »
edit:
It's likely possible to get more raw types using either DoMovieFrameCapture or other similar functions.
I got a garbled but recognizable image on G7 X when I initially used fc17262d on g7x (100d) for DoMovieFrameCapture (this is called from ExecuteDigicon case 0, which calls the function used for DoMovieFrameCapture on elph180)

I don't think it's good idea to put camera specific code into "\platform\generic\" directory. I prefer to use my own implementation of function shooting_shoot_frsp() from \platform\m3\shooting.c
I disagree.  I generally prefer ifdefs in this kind of case. There are > 150 platforms, and in most cases, a given feature only requires a handful of different implementations at most.

I would much rather have a half dozen well specified ifdefs than 150 slightly varying copies of the whole function.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Reading sensor data without closing shutter?
« Reply #55 on: 25 / December / 2018, 19:50:04 »
This one is a reworked version that unfortunately doesn't work on the cam I tried, but I'm posting it anyway (doesn't work = it re-enables liveview before the raw data is saved, but I don't get how).
I renamed the script command and the C function because it does not work like shoot(), just captures data.
frsp_capture() doesn't block script execution, raw processing is in spytask and MenuOut is called from spytask right after raw_process() is finished.

edit:
Could be the script I'm using
Code: [Select]
sleep(2000)
press("shoot_half")
sleep(2000)
frsp_capture()
release("shoot_half")
As frsp_capture() doesn't block, halfpress is released immediately and that probably cancels the MenuIn state...
« Last Edit: 25 / December / 2018, 19:56:22 by srsa_4c »

*

Offline c_joerg

  • *****
  • 1251
Re: Reading sensor data without closing shutter?
« Reply #56 on: 26 / December / 2018, 02:58:56 »
Are you using this build?

Yes, I use exactly the same Version.
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline Ant

  • *****
  • 509
Re: Reading sensor data without closing shutter?
« Reply #57 on: 26 / December / 2018, 08:58:11 »
I would much rather have a half dozen well specified ifdefs than 150 slightly varying copies of the whole function.

I do not propose to use 150 copies of this function. On the contrary, there will be one common function for most cameras, called using wrapper with _attribute__((weak)).
For special/experimental features I suggest to use platform specific implementation.

But on the other hand, I can create my own _DoMovieFrameCapture function instead of the ROM stub.

*

Offline c_joerg

  • *****
  • 1251
Re: Reading sensor data without closing shutter?
« Reply #58 on: 27 / December / 2018, 03:56:13 »
It also contains patch which allows to set exposure time(in microseconds) up to 4 s using:

It has no effect on my M3
I tried this
Code: [Select]
  tvus=tv96_to_usec(get_prop(props.TV))
  call_event_proc("Capture.Create")
  call_event_proc("ShutterTool.SetExpTime", tvus)
  frsp_shoot()
and then I used 2*tvus. No difference.

About the bad pixels. Have you ever tried this:
Remove the lens and put a cover on the camera. Then call the sensor cleaning manually.
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline Ant

  • *****
  • 509
Re: Reading sensor data without closing shutter?
« Reply #59 on: 27 / December / 2018, 08:26:35 »
and then I used 2*tvus. No difference.

After the last experiments, I found that the exposure time should not exceed 1,200,000 μs. More time gives damaged RAW data. Without a patch, the maximum exposure time is 1 second.

Quote
Remove the lens and put a cover on the camera. Then call the sensor cleaning manually.

How does this help? AFAIK camera cleans the lens with a closed shutter. In any case, normally taken RAW files do not have bad pixels, so they have already been fixed.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal