Author Topic: Custom processing for JPEG (Tone curve, CA ...)  (Read 26472 times)

Offline toinech

  • Jr. Member
  • **
  • Posts: 99
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #75 on: 21 / November / 2008, 13:01:03 »
  • Publish
  • I also tried curves and found some strange things (see attached picture, 100% crop at right border of image):
    - Some unprocessed vertical band at right side of image. Maybe, skippings of last 40 columns is too much.
    The same things reported in russian forum user of S3IS, his image:



    Here are the fixes for those columns and the deactivation of curve when RAW is activated.
    « Last Edit: 21 / November / 2008, 13:09:26 by toinech »

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #76 on: 19 / January / 2009, 09:25:58 »
  • Publish
  • Looking at this code to reduce memory use, I noticed a couple things:

    in curve_apply()
    Code: [Select]
    switch(conf.curve_enable) {
    ...
    case 2:
    case 3: // +1EV,  +2EV
    if (drcurve_loaded) drcurve_apply( conf.curve_enable >> 1 );

    the >> is useless since 10b >> 1 == 11b >> 1

    perhaps &1 does what was intended ?

    also
    Code: C
    1.                 f read(drcurve0, 1, 4*CURVE_SIZE*sizeof(unsigned short), fd); // load a set of 4 curves - only 2 are used
    2.  
    Any reason not to just load 2 ?
    Don't forget what the H stands for.

    Offline toinech

    • Jr. Member
    • **
    • Posts: 99
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #77 on: 22 / January / 2009, 10:02:24 »
  • Publish
  • Looking at this code to reduce memory use, I noticed a couple things:

    in curve_apply()
    Code: [Select]
    switch(conf.curve_enable) {
    ...
    case 2:
    case 3: // +1EV,  +2EV
    if (drcurve_loaded) drcurve_apply( conf.curve_enable >> 1 );

    the >> is useless since 10b >> 1 == 11b >> 1

    perhaps &1 does what was intended ?
    You are right. This was a leftover from some code that I experimented. That would explain why +2EV never get works for some user.

    Quote
    also
    Code: C
    1.                 f read(drcurve0, 1, 4*CURVE_SIZE*sizeof(unsigned short), fd); // load a set of 4 curves - only 2 are used
    2.  
    Any reason not to just load 2 ?

    You are also right here - some left over code from some experimentation.

    Thank you for your feed back. I am getting sloppy ...

    Offline PhyrePhoX

    • Global Moderator
    • Guru Member
    • *****
    • Posts: 2254
    • make RAW not WAR
      • PhyreWorX
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #78 on: 22 / January / 2009, 22:54:04 »
  • Publish
  • awrite, i guess reyalp is cleaning up the code... can't take long and he finds my messy loc, i should start hiding and renting a house in Hawa- erh, wouldnt make sense posting my hiding spot here, would it.

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #79 on: 23 / January / 2009, 06:21:53 »
  • Publish
  • Hrm:
    raw.c 203
    Code: [Select]
            finished();

            return (fd >= 0);
        }

    #ifdef OPT_CURVES
        if (conf.curve_enable) curve_apply();
    #endif
        return 0;

    if raw is enabled, curve is not applied to jpeg ?
    Don't forget what the H stands for.

    Offline toinech

    • Jr. Member
    • **
    • Posts: 99
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #80 on: 23 / January / 2009, 12:15:53 »
  • Publish
  • Hrm:
    raw.c 203
    Code: [Select]
            finished();

            return (fd >= 0);
        }

    #ifdef OPT_CURVES
        if (conf.curve_enable) curve_apply();
    #endif
        return 0;

    if raw is enabled, curve is not applied to jpeg ?


    Good point. I believe that you missed an early post that fixes this and other things.
    http://chdk.setepontos.com/index.php/topic,932.msg24656.html#msg24656
    I do not have access to SVN to update the code.

    Thank you for taking time to cleanup the code.

    Toine
    « Last Edit: 23 / January / 2009, 12:20:44 by toinech »

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #81 on: 26 / January / 2009, 05:59:52 »
  • Publish
  • Thanks for that. I saw there were several posts, but wasn't clear which ones had been merged.

    For the column fix, this processes the entire raw buffer, potentially modifying the border pixels, correct ? Any idea whether these becoming non-black affects canon processing ?
    Don't forget what the H stands for.

    Offline toinech

    • Jr. Member
    • **
    • Posts: 99
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #82 on: 26 / January / 2009, 12:03:07 »
  • Publish
  • Thanks for that. I saw there were several posts, but wasn't clear which ones had been merged.

    For the column fix, this processes the entire raw buffer, potentially modifying the border pixels, correct ? Any idea whether these becoming non-black affects canon processing ?

    For the column fix, this processes the entire raw buffer as you indicated. It is possible that a non black border pixel may effect on the canon processing. I am not sure if sometimes the manufacturer uses the non exposed border to estimate sensor noise level and use it in some noise reduction algorithm.

    I wrote the code (skipping columns) for my A610 which does not expose some of the last columns in the hope of saving some processing time. It looks like through other users that different cameras have different 'non exposed' areas.

    Please note that the first 8 rows are not processed.
    « Last Edit: 26 / January / 2009, 12:13:20 by toinech »

    Offline toinech

    • Jr. Member
    • **
    • Posts: 99
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #83 on: 29 / March / 2009, 05:46:35 »
  • Publish
  • Posted the black hole fix for the luminance curves. No change for RGB.
    Note the Green is now used as luminance instead of an average of G+B or G+R.
    Hopefully, the DR curve should be more sensitive for the correction of blown out highlight.

    Change made from trunk 725.

    CHDK Forum

    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #83 on: 29 / March / 2009, 05:46:35 »

    Offline orestes_mirayna

    • Newbie
    • *
    • Posts: 1
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #84 on: 19 / April / 2009, 19:52:34 »
  • Publish
  • <----New guy

    I can't download the curvetools program for creating custom curve profiles. Any help would be very much appreciated. Thanks in advance.

    Offline hotvedt

    • Full Member
    • ***
    • Posts: 106
    • A540/SX110IS/350D
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #85 on: 19 / April / 2009, 21:59:44 »
  • Publish
  • I have lost the original zip-file, but here you have the CurvesEditor4k.exe

    http://www.hot.ee/hotvedt/CurvesEditor4k.zip

    -
    Maybe some admin can check why i/we cannot access the attatchment in this post:
    http://chdk.setepontos.com/index.php/topic,932.msg10927.html#msg10927

    -
    Edit: heres a link with the updated editor that works: http://chdk.setepontos.com/index.php/topic,932.msg17419.html#msg17419
    « Last Edit: 19 / April / 2009, 22:07:47 by hotvedt »

    Offline fe50

    • Guru Member
    • ******
    • Posts: 2694
    • IXUS50 & 860, SX10 Star WARs-Star RAWs
      • fe50

    Offline toinech

    • Jr. Member
    • **
    • Posts: 99
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #87 on: 03 / May / 2009, 07:43:19 »
  • Publish
  • SYSCURVES update attached.
    Changed based on A610 response curves.
    The previous version was incorrectly configured
    Should help reduce significantly the high areas blown out.

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #88 on: 03 / May / 2009, 09:21:34 »
  • Publish
  • Added, svn 758
    Don't forget what the H stands for.

    Offline hiker_jon

    • Full Member
    • ***
    • Posts: 233
    Re: Custom processing for JPEG (Tone curve, CA ...)
    « Reply #89 on: 25 / June / 2009, 04:09:03 »
  • Publish
  • Hi,

    Anyone figure out how to modify curves for the SX10 12 bit raw?  I have looked at the code and it is a mystery to me.

    Jon

     


    SimplePortal 2.3.3 © 2008-2010, SimplePortal