CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD - page 54 - Creative Uses of CHDK - CHDK Forum supplierdeeply

CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD

  • 704 Replies
  • 144833 Views
*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #530 on: 12 / August / 2013, 19:27:52 »
Advertisements
FWIW,  you can run other executables from chdkptp with os.execute http://www.lua.org/manual/5.1/manual.html#5.8 so the download script could be modified to invoke exiftool. Coincidentally, someone just posted how to change the orientation tag with exiftool http://chdk.setepontos.com/index.php?topic=10060.msg103940#msg103940
Thanks for this potentially useful info.

Quote
This seems like a much more sensible approach than trying to hack it out on the camera to me.
This 101a FW is so terribly hacked, and still continues to work perfectly in all the areas I've tested so far, that I am not afraid of adding one or two more extras: srsa's solutions have proven themselves to be very reliable and trustworthy.

Quote
though at that point you probably might as well shell out to exiftool.
I am in favor of the possibility of srsa giving it a shot to find a solution in the camera HW to avoid splaying corrections elsewhere (PC) if it can be solved.  Also, two huge files (JPG & DNG | CR2) would have to be written twice I assume (write-read-modify-write), adding some outboard post-processing time.

Quote
Recent versions of chdkptp have to understand DNG tags for remoteshoot anyway, so it would also be fairly easy to make it overwrite the orientation tag before saving.
For a solution to be affective, it would have to work with JPG and CR2 (smaller, preferred over DNG for USB transfer and storage reasons, if it can be accomplished).

edit: trying the test on the 100c which still has 1.2 BIN, I don't think I have rmem in my CHDKPTP. If I write:
   =return rmem(0x330d8, 12)
for 3 words assuming the last parameter is bytes, I get global nil error.

« Last Edit: 12 / August / 2013, 20:14:29 by SticK »

*

Offline reyalp

  • ******
  • 13942
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #531 on: 12 / August / 2013, 23:35:45 »
Quote
though at that point you probably might as well shell out to exiftool.
I am in favor of the possibility of srsa giving it a shot to find a solution in the camera HW to avoid splaying corrections elsewhere (PC) if it can be solved.
That's a good deal if srsa wants to do it.
Quote
Also, two huge files (JPG & DNG | CR2) would have to be written twice I assume (write-read-modify-write), adding some outboard post-processing time.
To change an exif tag, exiftool should only need to read an rewrite the exif, not all the image data. (edit:  looking at the documentation, it sounds like it always does make a copy)
Code: [Select]
con 4> !return os.execute('exiftool.exe -n  -Orientation=6 -overwrite_original IMG_0603.jpg')
    1 image files updated
time 0.3390
=0
con 4> !return os.execute('exiftool.exe -n  -Orientation=6 -overwrite_original IMG_0606.DNG')
    1 image files updated
time 0.3760
Note the execution time for a 500k jpeg and 18mb DNG is virtually the same.
Quote
edit: trying the test on the 100c which still has 1.2 BIN, I don't think I have rmem in my CHDKPTP. If I write:
   =return rmem(0x330d8, 12)
for 3 words assuming the last parameter is bytes, I get global nil error.
rmem is a chdkptp cli command, not a camera lua function. The correct syntax would be
rmem 0x330d8 12

The equivalent with lua would be
=return peek(0x330d8)
but it will only return one word at a time.
« Last Edit: 12 / August / 2013, 23:40:01 by reyalp »
Don't forget what the H stands for.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #532 on: 13 / August / 2013, 00:13:36 »
@reyalp

Thanks for the nice post and code.  Re-writing just the header is OK ... so we have a backup plan in case srsa can't pull off the elegant solution.  In case I have to fall back on your solution, how would that work with the new USB direct file transfer with CHDK 1.2?  Does direct transfer implement file auto-numbering ?  If so, that should be easy.

USB 2 is so fast at file transfer that even 0.6 sec overhead does add up, and that's on a PC.  srsa's vignetting soln is a milestone in this project.  My next plan is to run the instrument with a (much slower) BBB, 2GMIPS (http://beagleboard.org/).  So I'd like to bounce off you some architectural ideas and get your insight. 

Conceptually .....

   ) The BBB has one USB2.   if I plug the camera there, can I run a version of CHDKPTP locally on its Linux, ie a Linux version? 

  ) If so, is there a way I would be able to see *just* the liveview on a PC via the LAN with a stripped down lua app on the PC?  .. that is .. talk to the core BBB CHDKPTP by sending it text commands from my PC via the LAN into its conceptual "command line input" but view remotely on my PC?  Sort of like CHDKPTP that has been split into a client-server ?  Is some kind of arrangement like this possible?   Do you understand my question ?

  ) In that scenario, I'd need the option to save image files either to PC over the LAN, or to an SD card on the BBB.  Would that be possible to do?
« Last Edit: 13 / August / 2013, 00:16:05 by SticK »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #533 on: 13 / August / 2013, 00:27:02 »
@srsa_4c

On the 100c with V1.2 ........

rmem 0x330d8 12

   00 cf 00 80 f6 ff 00 00 00 24 02

does not change even if I rotate the camera.  I made sure the orientation icon changed.


*

Offline reyalp

  • ******
  • 13942
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #534 on: 13 / August / 2013, 01:09:03 »
Thanks for the nice post and code.  Re-writing just the header is OK ... so we have a backup plan in case srsa can't pull off the elegant solution.
Per my edit above, exiftool probably re-writes the whole image.

Quote
In case I have to fall back on your solution, how would that work with the new USB direct file transfer with CHDK 1.2?  Does direct transfer implement file auto-numbering ?  If so, that should be easy.
It can use the camera image number. Writing using some other name generated by your code (for example, based on date/time) would be easy.

Quote
   ) The BBB has one USB2.   if I plug the camera there, can I run a version of CHDKPTP locally on its Linux, ie a Linux version? 
chdkptp runs OK on raspberry pi, so it should be possible to build and run it on similar systems. However, at this point I have not put much effort optimizing it for low spec systems.

Quote
  ) If so, is there a way I would be able to see *just* the liveview on a PC via the LAN with a stripped down lua app on the PC?  .. that is .. talk to the core BBB CHDKPTP by sending it text commands from my PC via the LAN into its conceptual "command line input" but view remotely on my PC?  Sort of like CHDKPTP that has been split into a client-server ?  Is some kind of arrangement like this possible?   Do you understand my question ?
I understand the question, and there is currently no support for anything like this. You can of course run a remote display like X or vnc, but performance will suffer badly.

I have toyed with some idea that could support something like this. The most obvious would be to just tunnel the PTP calls over a network.

However, my time is limited and there are a lot of higher priority issues, so it's unlikely I'll implement anything like this soon.
Quote
  ) In that scenario, I'd need the option to save image files either to PC over the LAN, or to an SD card on the BBB.  Would that be possible to do?
If you mount a network file system or sd card, chdkptp will not know the difference.
Don't forget what the H stands for.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #535 on: 13 / August / 2013, 01:37:20 »
@reyalp

Quote
chdkptp runs OK on raspberry pi, so it should be possible to build and run it on similar systems. However, at this point I have not put much effort optimizing it for low spec systems.
If it runs on the pi, then the BBB should be faster.  I am guessing since (in the future) "client-server" CHDKPTP graphics will be performed on the PC, performance should be pretty good, probably near-par to a camera on PC.

Quote
I have toyed with some idea that could support something like this. The most obvious would be to just tunnel the PTP calls over a network.
My thoughts were in that neighborhood too.

Quote
However, my time is limited and there are a lot of higher priority issues, so it's unlikely I'll implement anything like this soon
Yes I understand, I was just wondering what is available now and if not, is it possible.  It would have been more expeditious here to arrive a complete solution, if a configuration like that were available.  You've answered my questions OK.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #536 on: 13 / August / 2013, 15:19:53 »
@SticK
Attached diskboot.bin is meant to replace the same file in s90-100c-1.1.0-2729_disableisdriveerror_nodistcorr_no_startup_lens_check_isofix_novigncorr.zip .

If successful, it should force a certain (0°) orientation. The equivalent modification works on the a3200.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #537 on: 13 / August / 2013, 15:53:26 »
Attached diskboot.bin is meant to replace the same file in s90-100c  The equivalent modification works on the a3200..
Oh this is interesting ... I'm returning to the lab later and will be testing this evening // fingers crossed.


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #538 on: 13 / August / 2013, 16:02:22 »
@srsa_4c

Because this one has severe hardware hacks, I'd rather test it on the 101a.  Could you please build a 101a version and be so kind also to add an ID in the filename, like "0deg", to better keep track?

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #539 on: 13 / August / 2013, 16:16:28 »
Somehow I can never guess which cam you want to test on...  :-[
101a file attached, I'll consider proper naming once the test turns out to be successful.

 

Related Topics