supplierdeeply

AutoISO improvement

  • 6 Replies
  • 2492 Views
  • Publish
    AutoISO improvement
    « on: 16 / December / 2011, 01:48:34 »
    Advertisements
    About month ago I proposed in common thread big patch to improve AutoISO mechanizm. I would like to up this theme. Below is description of improvement. In attachment is patch from 1487 and almost live calculation spreadsheet. Welcome to feedback.


    Existed CHDK AutoISO greatly improve regular automode. But it could be even better.
    Why I improve AutoISO - I want to get nice shoot on all range of scenes (daylight, indoor, night scenes) without any readjustment. In most cases I have no time to adjust, or I am lazy about it, or my wife take a shoot and she would like to know nothing about adjusting.

    How AutoISO works in current CHDK in simple words:
      - Canon make his decision based on his firmware logic
      - CHDK try to adopt ISO to minISO with locked brightness. If result Tv is more than TVthreshold, then try to keep Tv on this threshold with increasing ISO (but not more than MaxISO)
      So we have three phases on Tv:
        * Tv adjusted to MinISO (until TVmin)
        * Tv is locked to TVmin and ISO is adjusted until required ISO< MaxISO
        * Tv adjusted to MaxISO


    What is done by this change:
       * Indoor Phase.
         If for ISO=ISOMax and Tv is more than TVmin, then not change only Tv but change slowly both Tv and ISO to reach TvMin2/ISOMax2.
         Example usage: I think that 1/125 is nice enough Tv for all cases and ISO=200 is nice ISO on my S95. This limits are good for daylight but they are bad for twilight/indoor.
             At same time I don't wont decrease Tv to 1/45 or ISO to 500 if I could avoid this. But this limits are still useful for me for mid-light condition.
             So I set ISOMax:TvMin to 200:1/125, also set ISOMax2:Tv2 to 500:1/45 and then if camera can't limit both values inside first range (good 200:1/125) will increase slightly both ISO and Tv.
             As result we got acceptable (for personal choose) both ISO and Tv. Surely this will not help in night scenes, when ISO will be locked as max acceptable 500 and compensated by Tv.
         This phase could be turned off in CHDK menu. In this case AutoISO mechanizm will work exactly as in previous version CHDK (except separated new "Overexposure correction" feature)

       * Day overexposure compensation
         On daylight (below ISOmax1) if more than X% of pixels are overexposed exposition (by zebra) will be changed on Y.
         Goal of this enhancement:
          a) Many camera has tendency to overexpose shots. This should be prevented
          b) better shots of cloudy days. Shadows could be easily restored from RAW while too bright image can't.
         Why daylight only: In my experiments in night time situation of high contrast scene (light sources and dark most image) is quite often and in this case such autocorrection often could decrease result image quality
         This feature could be turned off in CHDK menu. Type of correction (daylight-only or overall correction is adjustable in CHDK sources by #define OVEREXP_COMPENSATE_OVERALL)

         Attention: In opposition to main AutoISO mechanizm (adapt expo-pair but keep brightness), this feature WILL change brightness.
         Known failure: a) This feature could react on direct sun shooting. This could be unexpected by photographer.
                        b) Also this feature could negate premeditated too high expo-correction (with big overexposed areas).
         For my taste shoots which are fixed by this feature is better then without in most cases. Just do not set too high correction value. Or if you don't like this you could turn this feature off from menu.

       * Marketing ISO
         For me it is entangleous to set values in real ISO. I suspect that for most other peoples also.
         I easily know what is the quality of marketing ISO500 (because I see marketing value correspondence to result image often). And I don't want to calculate each time what real ISO it is.
         On my S95 correspondence is not exactly but quite linear, so it could be easily calculated by CHDK with acceptable error.
         This feature is adjustable in sources by #define USE_REAL_AUTOISO

  • Publish
    Re: AutoISO improvement
    « Reply #1 on: 23 / December / 2011, 10:59:28 »
    Hi tsvstar,

    genie01 - a developer from the german chdk forum - adapted your code to the SX230 and prepared it for beta testing. We appreciate your work - really a great piece of software. We discussed some further enhancements and want to ask for your opinion:

    1. we believe that the auto overexposure correction (which is indeed a brillant idea) just works in one step which is adjusted in settings. Is this true? We thought of a somehow more intelligent algorthm is more more useul: to adapt the exposure in little EV steps and check if exposure is fine. One can understand the correction value in settings as maximum correction value then.

    2. We are not totally sure if following idea is a great benefit, but we thought it could be a good idea to display the correction on the screen so that the user is informed about the influence of the correction algorithm.

    What do you think?

  • Publish
    Re: AutoISO improvement
    « Reply #2 on: 23 / December / 2011, 14:16:55 »
    Thanks. I like that my work is useful for people.

    1. we believe that the auto overexposure correction (which is indeed a brillant idea) just works in one step which is adjusted in settings. Is this true? We thought of a somehow more intelligent algorthm is more more useul: to adapt the exposure in little EV steps and check if exposure is fine. One can understand the correction value in settings as maximum correction value then.

    Yes. I like this idea. Unfortunatelly I have no idea how to implement it.

    Now it works in this way:
    - Canon firmware make it's precalculation of expopair based on brightness, white balance, etc
    - Then hook called in generic/shooting.c. There CHDK make all overrides and corrections. There base AutoISO and my changes are placed.
    - My OverExp algorithm use screenbuffer with simplified for speed histogram function to detect which percent of screen pixels are overexposed. Why this works: because canon firmware adapt onscreen picture to expopair on halfshoot stage.
    - Then control flow return back to firmware and it make shoot.

    What difficulties I see to implement this proposition:
    - No way to understand in one step what is beyond highest value and so what correction should be.
    - So it should be iterative process: algorithm make small step in expopair, ask canon to adapt screen picture to new values (I don't know how to do that), recalculate again histogram, repeat this sequence until limit reach
    - CHDK mostly work in condition "first - or - loose". Be fast or sync between task will broke. So we can't spend too much milliseconds on this, return control flow to firmware or wait until firmware adapt screen (if it adapt again at all before shoot finish)

    Maybe someone who know CHDK better (reyalp for example) could help with this.

    2. We are not totally sure if following idea is a great benefit, but we thought it could be a good idea to display the correction on the screen so that the user is informed about the influence of the correction algorithm.
    No problem. Personally I like to limit onscreen information. CHDK produce to much of it. But taste are differents. :)

    I see three possible kind of indicator:
    - Live warning. But zebra is more useful for this purpose.
    - Information on halfshoot. Surely is useful. At least photographer will not be surprised If overexp correction happens.
    - Output warning to console after shoot (If shoot button pressed without halfshoot stage). Limited usefulness and out of current CHDK visual conception.
    « Last Edit: 23 / December / 2011, 14:19:25 by tsvstar »

  • Publish
    Re: AutoISO improvement
    « Reply #3 on: 24 / December / 2011, 10:35:53 »
    Hmm, these are really difficulties. Another idea popped up in my mind, which is maybe much better:

    Lets say we have the algorithm as is. You detect the overexposure and adapt the exposure by whatever the setting is (lets say -1/3 EV).

    Now there are two possibilities:

    1. Exposure is fine now. We are through.
    2. The pic is still overexposed.
    In the second case you need to tell canon firmware that it has to reduce exposure even further but the agorithm is too complicated to implement, right? No worries: I have a much better idea for this case: CHDK can take another pic like bracketing. Either we can take several pics with reduced exposure as long as exposure is fine or you can take just one more pic where the exposure is adapted in a more intelligent way (a sort of interpolation).

    IMO this is a much better way since the user is able to select the best fitting image afterwards at the PC.

    Nevertheless, when CHDK decides to bracket the user has to be informed so that he knows that the camera has to be steady hold unless all images are taken. genie01 works a lot with those little on-screen pictograms and i find them really pretty nice.

    What do you think?


  • Publish
    Re: AutoISO improvement
    « Reply #4 on: 25 / December / 2011, 03:14:23 »
    In the second case you need to tell canon firmware that it has to reduce exposure even further but the agorithm is too complicated to implement, right?
    This is not a problem to reduce exposure more. Problem is that no information about first expo correction influence exists before shoot finishing.

    Quote
    No worries: I have a much better idea for this case: CHDK can take another pic like bracketing. Either we can take several pics with reduced exposure as long as exposure is fine or you can take just one more pic where the exposure is adapted in a more intelligent way (a sort of interpolation).
    I think that such feature is useful and technically is possible. But my vote - it should be separated feature. Probably in "bracketing" menu.
    Reason - this take much more time and additional card space(especially if any RAW - incamera or CHDK - is saved also).
    I often take shoots quickly (without halfshoot and so no warning) + I would like to get camera ready again quickly to take different shoot. My prefered kind of shoots is live moments and live people, which will no wait frozen while camera take couple of shoots to adjust exposure.:)  Current algoritm not affect to shooting time and so it should be exists too.
    « Last Edit: 25 / December / 2011, 03:24:43 by tsvstar »

  • Publish
    Re: AutoISO improvement
    « Reply #5 on: 04 / March / 2012, 06:29:19 »
    A great feature, first i thought chdk should work as this and my Camera Port is wrong ;-). good that you enhance it.

    I use the release 1 source and activate it in IXUS 1000 build.

    It work very good in exposure.I use always zebra and fast ev switch, and here can see it work very good and very simular to Canon exposure.

    I only get random crashes with it, sometimes work very long until crash, sometimes crash after boot on 1. image when i press shutter half to focus it crash 1 sec later.

    Seem the problem continues AF can not use with auto iso, because romlog show me a crash here.

    Have somebody on his camera too notice crash with autoiso, when continues AF, or is this only a Problem with my Camera. ?.

    I test longer time with continues AF off, and it have no crash.

    Code: [Select]
    ASSERT!! ContinuousAF.c Line 267
    Occured Time  2012:03:04 12:41:05
    Task ID: 25624630
    Task name: AfIntSrvTask0
    SP: 0x0039A228
    StackDump:
    0x00000000
    0xFF8FB3C4
    0x0000010B
    0x00000003
    0x00005950
    0x00000001
    0x00000000
    0x0000000D
    0x19980218
    0x19980218
    0x19980218
    0xFF8FB1BC
    0x00000000
    0x00000000
    0x000A034C
    0x0000070B
    0x0000070B
    0x19980218
    0x19980218
    0xFF8E9B84
    0x000A034C
    0x00000000
    0x0000000D
    0x0000070B
    0x19980218
    0xFF8E9ED8
    0x00000011
    0x000051C4
    0x00080D68
    0x00000000
    0x19980218
    0xFF8E8264
    0x00000001
    0x003731F4
    0x19980218
    0x19980218
    0x19980218
    0xFF816B74
    0x19980218
    0x19980218
    0x00001008
    ShootConDump:
    01 0f 0f 0f 0f 0f 0f 0f 0f 0f
    CameraConDump:
    06 01 0f 0f 0f 0f 0f 0f 0f 0f
    00001790: M:ZS_RST_E

    00001790: M:ZS_RST_S

    00001840: M:ZS_RST_E

    00002010: M:ZM_MVP_E

    00002020: M:FC_STB_E

    00002030: M:FIRST_E

    00002560: UI:ShootSeqToUI:0x202e:adr:0x3730cc,Para:3616972

    00002570: UI:ShootSeqToUI:0x201d:adr:0,Para:0

    00002570: UI:DispSwCon_TurnOnBackLight

    00002570: UI:DispSwCon_MuteOffPhysicalScreen

    00002570: UI:Reduce MuteOff

    00002570: UI:AC:SUpShowI

    00002570: UI:AC:EnryRecBt

    00002570: UI:AC:EBtn

    00002570: UI:StartRecMode

    00002570: UI:DispSwCon_MuteOffPhysicalScreen

    00002570: UI:Reduce MuteOff

    00002570: UI:LogicalEvent:0x3110:adr:0,Para:0

    00002570: UI:DispSwCon_TurnOnDisplayDevice

    00002580: UI:LogicalEvent:0x301c:adr:0,Para:0

    00002580: UI:UI_StrobeCon_Start

    00002590: UI:DSIC:c4,0

    00002600: UI:LogicalEvent:0x3135:adr:0,Para:0

    00002630: UI:_ManagePTMProperty

    00002630: UI:DSIC:a8,0

    00002710: SS:ModChg

    00002710: SS: Evf=0

    00002720: SS: 004b->8004

    00002730: SS: Asp 0000->0000

    00002740: SS:ModChg*

    00002740: UI:_DecideCaptureMode

    00002740: UI:_StartStill

    00002750: UI:DSIC:42,6

    00002770: UI:ScreenUnLock

    00002790: UI:Re MuteOff

    00002790: UI:MuteOffPhysicalScreen

    00002790: UI:_MuteOffStitch

    00002790: UI:TerminateDeliverToZoomController

    00002790: UI:ScreenLock

    00002810: UI:ScreenUnLock

    00002820: UI:OPTICAL_ZOOM_POS

    00002820: UI:UnpressZoomLever

    00002820: UI:DispSwCon_TurnOnDisplayDevice

    00002820: UI:LogicalEvent:0x313d:adr:0,Para:0

    00002830: UI:ScreenLock

    00002830: UI:DSIC:b4,0

    00002840: UI:ScreenUnLock

    00002850: UI:_EnrySRec

    00002850: UI:CaptModeChanger_CheckRTCRrepared

    00002850: UI:DispSw: Unlock

    00002850: UI:DispSwCon:Unlock

    00002850: UI:DispSwCon_MuteOffPhysicalScreen

    00002850: UI:MuteOffPhysicalScreen

    00002880: UI:DisplayPhysicalScreenCBR

    00002880: UI:DisplayPhysicalScreenCBR

    00002890: UI:_DecideModeDial

    00002890: UI:No Change Capture Mode

    00002890: UI:DSIC:c4,0

    00002890: UI:ScreenLock

    00002890: UI:ScreenUnLock

    00002910: UI:LogiEvnt_NotPowerType:0x09a4:adr:0,Para:0

    00002910: UI:LogiEvnt_NotPowerType:0x09a2:adr:0,Para:0

    00002910: UI:DisplayPhysicalScreenCBR

    00002930: UI:DisplayPhysicalScreenCBR

    00003070: UI:LogicalEvent:0x1164:adr:0,Para:0

    00004510: UI:Button:0x000009A1:PressSwOne

    00004510: UI:DSIC:26,0

    00004510: UI:ScreenLock

    00004510: UI:DSIC:b3,0

    00004520: UI:ScreenUnLock

    00004530: SS:PreBuf

    00004530: SS:BitR

    00004540: UI:ShootState:0x1

    00004540: UI:ShtCon_Activate

    00004540: UI:DispSw: Lock

    00004540: UI:ShtCon_PrepareCapture

    00004540: UI:DSIC:61,0

    00004540: UI:ScreenLock

    00004540: UI:ScreenUnLock

    00004570: UI:ScreenLock

    00004570: UI:Reduce ScreenUnLock

    00004570: UI:LogicalEvent:0x3135:adr:0,Para:0

    00004570: SS:LoadTest:10

    00004580: SS:PreCapt
    [/code
    Ixus 1000 HS

  • Publish
    Re: AutoISO improvement
    « Reply #6 on: 22 / March / 2012, 11:06:57 »
    I test it again with continues AF and new files and i get no crash.seem this help too

    http://trac.assembla.com/chdk/changeset/1741
    Ixus 1000 HS

     

    Related Topics