Custom processing for JPEG (Tone curve, CA ...) - page 6 - Feature Requests - CHDK Forum

Custom processing for JPEG (Tone curve, CA ...)

  • 101 Replies
  • 75901 Views
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #50 on: 16 / June / 2008, 04:51:21 »
Advertisements
Pardon my French but...THIS SH** is COOL!!! Thanks to all of you who got this put together, now I dont have to carry around a grey cand, and color cards!

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #51 on: 16 / June / 2008, 20:00:00 »
The trick is to know what the black value is for your sensor.  This is the nominal value that the sensor records when there is no light.

You may be able to get the value in any case since there is part of the sensor that is not exposed. Possibly the average value of the first row.

Some publication also indicated that you can avoid the color shift and desaturation by using the following formula:

R = (Y'/Y*(R+Y) + R - Y)/2
G = (Y'/Y*(G+Y) + G - Y)/2
B = (Y'/Y*(B+Y) + B - Y)/2

Where Y is the luminance value before the change and Y' is the luminance value after the change.

It kind of partially works but cause some loss of contrast. Color correction seems a little bit more controllable.

I attached the code if you want to have some fun with it.

Note:
- I stored directly in the curvex[] table the (Y'/Y)*1024 value to avoid division which is not in ARM native instruction.
- I also cheated:
  Y = (R+G)/2 for the red line
  Y = (B+G)/2 for the blue line

Outdated attachment removed...
« Last Edit: 11 / July / 2008, 10:09:34 by toinech »

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #52 on: 16 / June / 2008, 20:08:52 »
Take a picture of a scene with a black object (inside of a pipe, say) and save the raw data.  Outside the camera I used dcraw -D -4 CRW_1815.CRW.  This produces a 16bit image of the raw data.  ImageJ can read such data.  Looking at the values in the pipe interior I saw that they averaged about 32 (ISO80,A720IS).  This seemed to be the same for the R,G,B sensors.  I think the black value is also the same for other ISO's, but will need to do more testing.
Now to increase or decrease the ev I set mult to what I want (say 2 for ev +1 or .5 for ev -1) and calculate offset = black - mult * black.  (i.e. this effectively subtracts black before doing the mult and adds it back after).

You may want to avoid all the pain if you use the GetPixel.exe that I attached in an earlier post.
Here again...

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #53 on: 17 / June / 2008, 10:30:24 »
You may want to avoid all the pain if you use the GetPixel.exe that I attached in an earlier post.

Hi,

I tried getpixel and it works great.  Question: how do you determine the raw coordinates of a pixel from the coordinates in an image?

Here is an example of in-camera raw develop.  I took some pictures at Chumash Painted Cave above Santa Barbara.  The entrance is blocked by an iron grate.  I had to stick my camera through the grate and take pictures from there.  At the deeper parts of the cave the wimpy flash on my A720 didn't reach.
EV0:

EV+2:


« Last Edit: 17 / June / 2008, 10:42:34 by hiker_jon »

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #54 on: 18 / June / 2008, 02:35:06 »
I tried getpixel and it works great.  Question: how do you determine the raw coordinates of a pixel from the coordinates in an image?

The pixel is determined the same way as for the curve_apply routine.
The pixel position is in fact the position in the Bayer matrix including all 4 colors (RGGB)
The following applies:
Pix(2a,2b) => Red
Pix(2a+1,3b) => Green
Pix(2a,2b+1) => Green
Pix(2a+1,2b+1)=> Blue

Nice pictures.

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #55 on: 04 / July / 2008, 15:24:08 »
Updated curves.c to include the black level adjust as per john_hiker recommendation.
This version multiply the channels with a set of  multipliers derived from the luminance.
This will help mitigate color shift when apply curves.

Remove binaries to make room in post.
« Last Edit: 12 / July / 2008, 17:29:24 by toinech »

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #56 on: 12 / July / 2008, 18:01:05 »
Since I'm often slightly under-exposing (-2/3 EV) to avoid blow-out, I'm looking for a curve to bring out the shadows (a-la D-Lighting in Nikon DSLRs).

I attached the changes in curve that will fit your need here.
Just need to set the curve mode to "Auto DR" use the standard EV comp feature by looking at the Zebra. The system will apply the proper amplification to the shadow based on the EV comp.

Side effect of "Auto DR": added 2 more steps on the ISO (+1EV and +2EV) - and unfortunately the noise...  :(

Hopefully Jucifer will have some time to push it in.

BTW: The SYSCURVES.CVF file has to be put in the A/CHDK directory
« Last Edit: 18 / July / 2008, 22:29:29 by toinech »

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #57 on: 15 / July / 2008, 13:10:54 »
Does anybody have a library of already-made curves or at least a link to a website where various useful/fun curves are shown visually?

Also, this is just a heads-up to let folks know that the Curve Editor works great in Linux under Wine, so long as you've used winetricks to install the VB runtime stuff.

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #58 on: 16 / July / 2008, 20:32:51 »
Does anybody have a library of already-made curves or at least a link to a website where various useful/fun curves are shown visually?

Not really - follow this though: Curve Anthology

Attached some curve samples below.
« Last Edit: 26 / July / 2008, 21:56:23 by toinech »

*

Offline acorrias

  • *
  • 20
  • [A650IS]
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #59 on: 27 / July / 2008, 05:49:24 »
HI
i'm experimenting with tone curve. Could you tell me about the differente between the CV and CVF files? Should I put them in the curves directory?

could you explain me how to use auto DR? you wrote: "Just need to set the curve mode to "Auto DR" use the standard EV comp feature by looking at the Zebra."

is this the correct workfow?

1) take a shoot with raw enabled
2) set tone curve to auto dr
3) develop the raw

my problem is how using zebra in the workflow. I dont understand how to use (or set) EV comp.

Another question: is it possoble to define a curve that simulates a velvia effect?

thanks in advance
alex
« Last Edit: 27 / July / 2008, 06:00:37 by acorrias »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal