[Bug 142571] New: Auto-exposure result is different from the preview

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 142571] New: Auto-exposure result is different from the preview

Frédéric COIFFIER
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=142571         
           Summary: Auto-exposure result is different from the preview
           Product: digikamimageplugins
           Version: unspecified
          Platform: Gentoo Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: digikam-devel kde org
        ReportedBy: frederic.coiffier free fr


Version:           0.9.1-rc1 (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)
OS:                Linux

When the Auto-exposure mode is selected in Color correction, the preview seems good (lighter than the original, in my case). But, if I apply this correction, the result is different and darker.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 142571] Auto-exposure result is different from the preview

Bugzilla from joerg.kuehne@lycos.de
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=142571         




------- Additional Comments From joerg.kuehne lycos de  2007-03-08 22:34 -------
The Auto-exposure values calculated from prewiew picture are different from the values of the original picture (black/white point).
Try the following patch. It works fine for me.

----------------------------------------------------

Index: libs/whitebalance/whitebalance.cpp
===================================================================
--- libs/whitebalance/whitebalance.cpp (revision 640698)
+++ libs/whitebalance/whitebalance.cpp (working copy)
 @ -179,18 +179,13  @
       
     // Calculate optimal exposition and black level
     
-    int    stop, i, scale, w, h;
-    double sum;
+    double sum, stop;
+    int i;
     uint   rgbMax = sb ? 65536 : 256;
     
-    w     = width  / 400;
-    h     = height / 400;
-    scale = QMAX(w, h);
-    scale = QMAX(1, scale);
-    
     // Cutoff at 0.5% of the histogram.
     
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
+    stop = width * height / 200.0;
     
     for (i = rgbMax, sum = 0; (i >= 0) && (sum < stop); i--)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);
 @ -198,10 +193,6  @
     expo = -log((float)(i+1) / rgbMax) / log(2);
     DDebug() << "White level at:" << i << endl;
     
-    // Cutoff at 0.5% of the histogram.
-    
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
-    
     for (i = 1, sum = 0; (i < (int)rgbMax) && (sum < stop); i++)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);

--------------------------------------------------

Jörg
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 142571] Auto-exposure result is different from the preview

Gilles Caulier-4
In reply to this post by Frédéric COIFFIER
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=142571         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles gmail com  2007-03-12 09:28 -------
SVN commit 641661 by cgilles:

digikam from trunk : fix auto exposure computation algorithm. Patch from Joerg Kuehne.
BUG: 142571

 M  +4 -13     whitebalance.cpp  


--- trunk/extragear/graphics/digikam/libs/whitebalance/whitebalance.cpp #641660:641661
 @ -179,18 +179,13  @
       
     // Calculate optimal exposition and black level
     
-    int    stop, i, scale, w, h;
-    double sum;
+    int    i;
+    double sum, stop;
     uint   rgbMax = sb ? 65536 : 256;
-    
-    w     = width  / 400;
-    h     = height / 400;
-    scale = QMAX(w, h);
-    scale = QMAX(1, scale);
-    
+        
     // Cutoff at 0.5% of the histogram.
     
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
+    stop = width * height / 200;
     
     for (i = rgbMax, sum = 0; (i >= 0) && (sum < stop); i--)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);
 @ -198,10 +193,6  @
     expo = -log((float)(i+1) / rgbMax) / log(2);
     DDebug() << "White level at:" << i << endl;
     
-    // Cutoff at 0.5% of the histogram.
-    
-    stop = ((uint)(width / scale)*(uint)(height / scale)) / 200;
-    
     for (i = 1, sum = 0; (i < (int)rgbMax) && (sum < stop); i++)
         sum += histogram->getValue(Digikam::ImageHistogram::ValueChannel, i);
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel