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

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

  • 704 Replies
  • 134820 Views
*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #520 on: 09 / August / 2013, 12:34:01 »
Advertisements
Don't know what kind of image processing / viewing software are you using.
For now I'm using RawTherapee and IrfanView.  I use others like Paint for editing and viewing too, but those ignore rotation.

Quote
Have you tried to make them ignore the orientation flag in exif? For example, IrfanView has an option for that.
Both apps have rotation buttons.  I looked for the persistent option in IrfanView but I can't find it.

Maybe this could work ??  This could be naive, but, rather than trap the orientation flag and make it elegantly-settable deeper in the code as for other flags in CHDK, to clear-by-force when EXIF is created or written out?

edit: when you press a rotation button in RawTherapee with a RAW file, it has to recalculate demosaicing, because the algorithms are direction-sensitive.  In theory, that results in a difference between the rotated and unrotated versions.
« Last Edit: 09 / August / 2013, 15:59:42 by SticK »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #521 on: 09 / August / 2013, 16:38:32 »
S90 TEMPERATURE SENSORS RESOLUTION

Figure 1 shows the position of the two temperature sensors in the S90.   Both are standard 10K @ +25C. 

The "Opt" sensor is on the outside of the lens assembly, and appears in the logical position.  It accurately reports ambient temperature in CHDK.  However, on the S90 (and likely S95), the "CCD" sensor is actually located on the PCB, as shown in the left panel.  I measured its actual temperature with an IR thermometer going from PUP to full hot over 10 minutes, in REC MODE.  The temp range was +25C to +47C, and CHDK followed my thermometer degree-for-degree.  This is a very useful real-time measurement for once the imager gets installed.

Thus we can conclude that the OSD "CCD" reading in CHDK for this camera is actually the temperature of the PCB near the CCD connector.

So for the 101a, I attached the "Opt" sensor to the CCD instead (not pretty but functional, Fig 2) and now the IR thermometer (measuring the CCD surface) accurately agrees (ie, a step in the OSD when hitting 0.5C mark on the thermometer) with CHDK OSD "Opt" over a tested range of +18C to +30C, so far.  Hence the CHDK now reports actual CCD temp on 101a.

QUESTIONS (reyalp?) ...

Q1.  Can you give us one decimal place (the thermistors are accurate, but more, I can see stability), for example,  Opt: -10.3, and format an explicit plus sign so that temperatures above zero show as eg CCD: +38.7 (it just looks more elegant).  Not many folks know this, but one can write this C format string: "%+.1f" to display an explicit plus.

Q2.  Is there a way I can change the text, e.g. instead of "Opt" write "CCD", and change "CCD" to "CKT", for example?
« Last Edit: 09 / August / 2013, 16:41:50 by SticK »

*

Offline reyalp

  • ******
  • 13717
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #522 on: 09 / August / 2013, 17:00:50 »
Q1.  Can you give us one decimal place (the thermistors are accurate, but more, I can see stability), for example,  Opt: -10.3, and format an explicit plus sign so that temperatures above zero show as eg CCD: +38.7 (it just looks more elegant).  Not many folks know this, but one can write this C format string: "%+.1f" to display an explicit plus.
As I've said before, the value we display (assuming you haven't selected Fahrenheit) is exactly as returned from the Canon firmware, so no additional precision is available.

Reading the thermistor A/D values directly may be possible, some discussion can be found in http://chdk.setepontos.com/index.php?topic=10385.0

Edit: Specifically the GetAdChValue eventproc discussed in the last post.
Quote
Q2.  Is there a way I can change the text, e.g. instead of "Opt" write "CCD", and change "CCD" to "CKT", for example?
These strings are in core/gui_osd.c gui_osd_draw_temp(). You are free to change them in your own builds.

You could query the temperature functions (or thermistors, if you figure that out) in Lua and do whatever you like with the values, including returning them to chdkptp and displaying them in the GUI.
« Last Edit: 09 / August / 2013, 17:05:02 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #523 on: 09 / August / 2013, 17:12:05 »
I looked for the persistent option in IrfanView but I can't find it.
In v4.33: properties/settings window -> jpg / pcd / gif -> "auto-rotate image ..."

Quote
Maybe this could work ??  This could be naive, but, rather than trap the orientation flag and make it elegantly-settable deeper in the code as for other flags in CHDK, to clear-by-force when EXIF is created or written out?
Well. 1) should be easy for DNG 2) could be done for jpeg - in theory, in the filewrite hook for example 3) CR2 - no idea...

Perhaps on the PC side...

Quote
when you press a rotation button in RawTherapee with a RAW file, it has to recalculate demosaicing, because the algorithms are direction-sensitive.  In theory, that results in a difference between the rotated and unrotated versions.
I don't know. It's the same sensor, the only difference is the camera direction. Should the results really differ..?


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #524 on: 09 / August / 2013, 17:46:21 »
In v4.33: properties/settings window -> jpg / pcd / gif -> "auto-rotate image ..."
Thanks.

Quote
1) should be easy for DNG 2) could be done for jpeg - in theory, in the filewrite hook for example 3) CR2 - no idea... Perhaps on the PC side...
Sounds a bit tricky ... too much all-over-the-map as opposed to one code-focal point.

Quote
It's the same sensor, the only difference is the camera direction. Should the results really differ..?
If you did a byte-for-byte comparison of the rotated RAW and the unrotated version after demosacing each one, you see that they are different.  Photographically (from a distance and not examining individual pixels), you couldn't tell the difference, hence "in theory."  If my understanding is correct, that's because the algorithms start at one corner (say upper left) whether the image rotated or not.  Because each pixel operation is direction-sensitive and not "pixel-neighborhood-isotropic" (my own word concoction for succinctness) you do get a small difference.
« Last Edit: 09 / August / 2013, 17:53:31 by SticK »

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #525 on: 11 / August / 2013, 14:52:09 »
Sounds a bit tricky ... too much all-over-the-map as opposed to one code-focal point.
I know, and I don't plan to do that.
I have done a further experiment on the a3200. I used two CHDK override locations in capt_seq_task to override the orientation propcase. The propcase _is_ writable, and the CHDK propcase viewer shows the overridden value. But somehow the jpeg still has the true orientation flag.

There is a slim chance that the orientation sensor pins are handled as physw GPIO. To check this, use the rmem chdkptp command to print 3 words (word =32 bit) of RAM starting from 0x330d8. Note that some bits of these words are changing constantly.
If you manage to find 2 (or more?) bits in the above mentioned 3 words which seem to correspond to the camera position, those could be overridden. There's no guarantee that this would change the orientation propcase though.

If all else fails, there's still the batch processing way, with exiftool.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #526 on: 11 / August / 2013, 17:19:20 »
@srsa_4c

Quote
If all else fails, there's still the batch processing way, with exiftool.
I know // it would be a nuisance when trying to focus on the content of the images and specimen  search process during instrumentation use where one is inspecting image-by-image (the normal mode, tiling is done relatively infrequently) wants to get information in the smoothest way possible, rather than focus on image processing, if it can be avoided.  Hence thanks a million for your continued effort.  At present my 101a PC is still undergoing upgrades (Ubuntu and BBB cross-dev), so I should be able to get around to your requests I'd say by tomorrow sometime, if all goes well.
« Last Edit: 11 / August / 2013, 17:21:48 by SticK »

*

Offline srsa_4c

  • ******
  • 4450
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #527 on: 11 / August / 2013, 19:23:37 »
it would be a nuisance when trying to focus on the content of the images and specimen  search process during instrumentation use where one is inspecting image-by-image (the normal mode, tiling is done relatively infrequently) wants to get information in the smoothest way possible, rather than focus on image processing
I think it could be done right after downloading (by a script), and modifying exif tags is not strictly image processing.

Quote
At present my 101a PC is still undergoing upgrades
I would recommend to do this with your unmodified camera - rotating it will surely be simpler. You'll need to collect enough samples in each position (0 - 90 - 180 - 270 degrees) to be able to identify the bits of the orientation sensor (in case they are there). Some cameras can't identify the 180 degree case.


*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #528 on: 12 / August / 2013, 14:23:11 »
There is a slim chance that the orientation sensor pins are handled as physw GPIO.
On Digic II, the token is "SLANT".  Please see figure.  The HV sensor is a MEMS device hence I'm sure on the S90 it would separate too, driven by GPIO as here.

Quote
To check this, use the rmem chdkptp command to print 3 words (word =32 bit) of RAM starting from 0x330d8. Note that some bits of these words are changing constantly.
Does this help?  If not or you still need the pin data, I will do the test you request.

*

Offline reyalp

  • ******
  • 13717
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #529 on: 12 / August / 2013, 16:01:46 »
I think it could be done right after downloading (by a script), and modifying exif tags is not strictly image processing.
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

This seems like a much more sensible approach than trying to hack it out on the camera to me.

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. Something like the code I posted here http://chdk.setepontos.com/index.php?topic=10520.msg103844#msg103844 could be used to manipulate saved DNG files after the fact, though at that point you probably might as well shell out to exiftool.
Don't forget what the H stands for.

 

Related Topics