fixed point tonemapping in CHDK - I want to contribute; but it's feasible (?) - Feature Requests - CHDK Forum

fixed point tonemapping in CHDK - I want to contribute; but it's feasible (?)

  • 4 Replies
  • 4684 Views
Advertisements
Hi.
Few days ago I released a tonemapper for LDR images and I discussed about it, here:
http://chdk.setepontos.com/index.php/topic,3006.0.html

Somebody gave me the idea to put it into CHDK, to get tonemapping directly from the camera. So I started to think seriously about it and I would like to ask developers if this is feasible.
The tonemapping works in two steps:
A) desaturate and blur the image
B) combine each channel and the image blurred with a function

Here is what I think why it might be possible in chdk
1) Every step can be implemented in fixed point
2) It's not necessary to do a gaussian blur; a IIR blur it's enough
3) The blurred image can be scaled down, to keep low memory usage
4) The function can be computed very fast with a lookup table

In my program, I implemented the tonemapping for 8-bit images, but I think that it can be implemented for 12(10?) or 16 bit images (guess in the camera's step just before 8 bit quantization and converting to jpeg).

I don't know CHDK internals,  how fast is the camera's processor, or if it's possible to access (RGB?) data before writting to JPEG (or even better, before quantization to 8 bit).  I would like to hear an opinion of a CHDK developer.

Paul
« Last Edit: 24 / January / 2009, 06:57:00 by paulgfx »

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi

Quote
if it's possible to access (RGB?) data before writting to JPEG (or even better, before quantization to 8 bit).


it is. you have the RAW buffer, (10-bits) depth

But I think that before doing your tonemaping, you first  would have to handle the RAW processing (bayer pattern, apply the color matrix, white balance)...

that's not easy AT ALL!!


it is. you have the RAW buffer, (10-bits) depth

But I think that before doing your tonemaping, you first  would have to handle the RAW processing (bayer pattern, apply the color matrix, white balance)...

that's not easy AT ALL!!


But the buffer is available after RAW processing (bayer, color matrix, white balance)? If yes, it is still 10 bits? or these processes already quantize to 8 bits? I thought the quantization process is the last step before saving to jpeg.

*

Offline reyalp

  • ******
  • 14126

But the buffer is available after RAW processing (bayer, color matrix, white balance)? If yes, it is still 10 bits? or these processes already quantize to 8 bits? I thought the quantization process is the last step before saving to jpeg.
Not that we know of. It is likely that all of that, up to and including jpeg encoding is done on the DSP portion of the digic chip. The ARM CPU is far to slow.

edit:
I would add that I'm not really a fan of doing image processing on the camera. PCs are far more capable and easy to code for, and putting these features in CHDK takes memory away from other features.
« Last Edit: 24 / January / 2009, 16:29:15 by reyalp »
Don't forget what the H stands for.

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
I quite agree.
Also, image processing like tonemapping requires a good deal of trial-and-error (i.e. use some parameters, see result, adjust parameters, try again, etc)
Doing that camera-side has the only advantage of (in certain cases) allowing the deletion of RAW images and saving card space... I wouldn't want to do that anyway :-)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal