"Fossies" - the Fresh Open Source Software Archive

Member "pfstools-2.2.0/src/camera/robertson02.h" (12 Aug 2021, 3017 Bytes) of package /linux/privat/pfstools-2.2.0.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * @brief Robertson02 algorithm for automatic self-calibration.
    3  *
    4  * 
    5  * This file is a part of PFS CALIBRATION package.
    6  * ---------------------------------------------------------------------- 
    7  * Copyright (C) 2004 Grzegorz Krawczyk
    8  * 
    9  *  This program is free software; you can redistribute it and/or modify
   10  *  it under the terms of the GNU General Public License as published by
   11  *  the Free Software Foundation; either version 2 of the License, or
   12  *  (at your option) any later version.
   13  *
   14  *  This program is distributed in the hope that it will be useful,
   15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17  *  GNU General Public License for more details.
   18  *
   19  *  You should have received a copy of the GNU General Public License
   20  *  along with this program; if not, write to the Free Software
   21  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   22  * ---------------------------------------------------------------------- 
   23  * 
   24  * @author Grzegorz Krawczyk, <gkrawczyk@users.sourceforge.net>
   25  *
   26  * $Id: robertson02.h,v 1.4 2011/02/15 15:46:27 ihrke Exp $
   27  */
   28 
   29 #ifndef _robertson02_h_
   30 #define _robertson02_h_
   31 
   32 #include <responses.h>
   33 
   34 struct noise_parameters
   35 {
   36   const char* camera_name;
   37   float color_coefficients[3];
   38   float std_readout;
   39   float std_adc;
   40 };
   41 
   42 
   43 /**
   44  * @brief Calculate camera response using Robertson02 algorithm
   45  *
   46  * @param xj [out]  estimated luminance values
   47  * @param imgs reference to vector containing source exposures
   48  * @param I [out] array to put response function
   49  * @param w weights
   50  * @param M max camera output (no of discrete steps)
   51  * @return number of saturated pixels in the HDR image (0: all OK)
   52  */
   53 int robertson02_getResponse( pfs::Array2D*       output,       /* output image (gray scale) */
   54                  const ExposureList &imgs,         /* differrent exposures */
   55                  float              *rcurve,       /* response curve */
   56                  const float        *weights,      /* weights */
   57                  int                 M             /* number of values in rcurve/weights */
   58                  );
   59 
   60 
   61 /**
   62  * @brief Create HDR image by applying response curve to given images
   63  * taken with different exposures
   64  *
   65  * @param xj [out] HDR image
   66  * @param imgs reference to vector containing source exposures
   67  * @param I camera response function (array size of M)
   68  * @param w weighting function for camera output values (array size of M)
   69  * @param M number of camera output levels
   70  * @return number of saturated pixels in the HDR image (0: all OK)
   71  */
   72 int robertson02_applyResponse( pfs::Array2D* xj, 
   73                    const ExposureList &imgs, 
   74                    const float* I, 
   75                    const float* w, 
   76                    int M );
   77 
   78 
   79 int robertson02_applyResponseRGB( pfs::Array2D *rgb_out[],         
   80   const ExposureList *imgs[], 
   81   const float *resp_curve[], 
   82   const float *weights, 
   83   int M,
   84   const noise_parameters *camera,
   85   const float deghosting_value = -1);
   86 
   87   
   88 #endif /* #ifndef _robertson02_h_ */