A Semiparametric Model for Accurate Camera Response Function Modeling and Exposure Estimati

  • 格式:pdf
  • 大小:2.76 MB
  • 文档页数:13

1138IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 14, NO. 8, AUGUST 2005A Semiparametric Model for Accurate Camera Response Function Modeling and Exposure Estimation From Comparametric DataFrank M. Candocia, Member, IEEE, and Daniel A. MandarinoAbstract—A fundamentally new approach that accurately estimates the camera response function from comparametric data, i.e., pixel data from two differently exposed images over a common field of view, is presented. It does so by solving for the camera response function from its associated comparametric relation. The approach offers several advantageous features, including having a complexity that is independent of the number of pixel data considered, allowing for the modeling of saturated pixels, enabling an inherently constrained optimization problem to be solved in an unconstrained manner, and the easy incorporation into an existing framework for joint image registration. This is accomplished by approximating the camera response function with a constrained piecewise linear model so that its solution, within the comparametric camera relation, can be obtained. This results in a semiparametric comparametric model, optimally determined from pixel data, which is directly parameterized in terms of the exposure parameter. Subsequently, it is shown how this semiparametric model is used for exposure estimation from captured images. Finally, we incorporate the semiparametric model within an existing and previously published framework for simultaneous and joint spatial and tonal image registration in order to illustrate the developed model’s performance. Index Terms—Camera response function, comparametric equation, exposure estimation, image registration, piecewise linear modeling, semiparametric model.I. INTRODUCTIONWE PRESENT an approach for the accurate modeling of a camera’s response function so that proper exposure estimates between multiple images can be obtained. Previous tonal alignment work has utilized optoelectronic conversion functions [1], polynomials [2], and both parametric [3], [4] and nonparametric local [5] and global [6] quantimetric [7] processing. Our approach uses the comparametric relation associated with a camera’s response function in the estimation as a convenient means of utilizing the pixel data available to us. In essence, we are solving for the camera response function from its associated comparametric relation. This comparametric relation, and quantimetric principle upon which it is based, has been well founded and established [4], [8]. A nice property of utilizing the quantimetric model is the straightforward mannerManuscript received May 10, 2004; revised September 7, 2004. This work was supported in part by the National Science Foundation under Grant HRD0317692. The associate editor coordinating the review of this manuscript and approving it for publication was Prof. Bruno Carpentieri. The authors are with the Department of Electrical and Computer Engineering, Florida International University, Miami, FL 33174 USA (e-mail: candocia@fi). Digital Object Identifier 10.1109/TIP.2005.851696in which spatial and exposure-based registration can be performed by exploiting the group structures inherent to the spatial and exposure transformation models considered. This has been done with success using comparametric models that have been directly [9], [10] and indirectly modeled in terms of the exposure parameter [11]. The advantage of the direct approach lies in its use of predefined and parameterized camera response/comparametric functions for which many have already been defined. Its disadvantages are that, though one of the predefined models might well approximate a camera’s exposure behavior, a highly accurate model—if, indeed, necessary—might not be available nor easily determined. In the indirect approach, the advantage was that a highly accurate comparametric model could be determined from image pixel data and this, in turn, allowed for the first general procedure that performed joint domain and range registration of differently exposed images [12], [13]. The disadvantages were that this model was not parameterized with respect to the exposure parameter (hence, indirect means for its estimation were required) and the associated camera response function could not be estimated from it. This work presents an approach that incorporates the advantages of the previously described direct and indirect approaches, that is, we have the ability of obtaining a camera response and corresponding comparametric function that is directly parameterized in terms of the exposure parameter as in [4] and it will be done directly from comparametric pixel data as in [10] so that a flexible and accurate modeling can be obtained. This is achieved by approximating the camera response function with a constrained, continuous, piecewise linear (PL) function and, subsequently, using this model in the comparametric relation that is directly parameterized with respect to the exposure parameter. This leads to a fundamentally different approach to camera response function estimation that offers several benefits. Specifically, the contributions of this work are in developing an approach that 1) can accurately model a camera response function from pixel data, 2) has a complexity that is independent of the number of pixel data considered, 3) allows for the modeling of saturated pixels, 4) enables an inherently constrained optimization problem to be solved in an unconstrained manner, and 5) is easily incorporated into an existing simultaneous and joint spatial and tonal image registration framework. The relation resulting from the functional composition of the PL modeled camera response function with its inverse leads to a semiparametric comparametric model that is part of an optimality measure to be minimized. Its semiparametric nature comes from1057-7149/$20.00 © 2005 IEEECANDOCIA AND MANDARINO: SEMIPARAMETRIC MODEL FOR ACCURATE CAMERA RESPONSE FUNCTION MODELING1139the model’s ability to allow for a very general class of functional forms and where the number of the model’s parameters can be increased in a systematic way to build ever more flexible models, but where the total number of parameters in the model can be varied independently from the size of the data set [14].1 The remainder of this paper discusses the camera response and exposure estimation approach. Section II describes the quantimetric exposure model and the associated comparametric relation about which this work is based. This is followed by a motivation for the piecewise linear model of the paper and its subsequent definition in Section III. In Section IV, we define our optimality measure and describe how the optimal camera response and exposure estimates are obtained from it. This is followed in Section V with experimental results on three different image sequences. Section VI presents some noteworthy issues and provides additional commentary concerning the approach before the paper concludes in Section VII with a summary and some final remarks. II. PROBLEM DESCRIPTION It is instructive to now describe and formulate the problem addressed in this paper. This brief presentation will establish the footing and motivation for the remainder of the paper. A. Quantimetric Exposure Model The exposure model upon which this work is based is generally described by (1) and is the quantimetric relation detailed in [4]. In this model, is the resulting pixel value at spatial coordinate is a dynamic range compression (DRC) function that limits the range of possible values sensed, embodies the exposure time that modifies the amount of light sensed by the camera , while and each represent pre-DRC noise related to the imaging process (electronically induced noise, lens distortion, point spread function effects, etc.) and post-DRC noise related to the final image representation (quantization, JPEG compression, is a monotonically increasing etc.), respectively. Note that function also known as the camera response function and that where in the absence of light, i.e., when no light is absorbed by the imaging sensor. The relation between and a differently exposed image (over the same field) would be as in (1), except that we would use in place of to account for a different amount of sensed light due to differences in exposure. In an ideal, noiseless setting, we can solve for in (1) and, likewise, for its counterpart , since is a monotonically increasing smooth function whose inverse exists. In the absence of noise, solving for in (1), both as related to and ,1This definition of a semiparametric model has been paraphrased from C.M. Bishop’s book [14, p. 33]. It is being used to stress the type of comparametric modeling being performed—even though the underlying model is of the camera response function.and equating these two expressions yields the comparametric description of exposure change between two images, namely (2) where and indirectly quantifies the exposure difference of image relative to image . Thus, (1) and (2) provide different, though ideally equivalent, descriptions by which the pixel values of two differently exposed images can be related, i.e., using a camera’s response function or its corresponding comparametric relation, respectively. Estimating the camera response function via (1) is not possible when only the pixel values of a captured image are available, and, it is evident from (2) that determining the camera response function from pixel values of two images is not a trivial task as the comparametric relation is composed of the functional composition of this camera response function with a scaled version of its inverse. This paper describes a semiparametric comparametric model that allows for the direct and optimal estimation of from one (or more) image pairs utilizing the relation of (2). As previously mentioned, this offers the advantage of having a model directly parameterized in terms of so that estimating the camera response function from a known value can be accomplished as easily as estimating from one or more image pairs given the camera response model. B. Motivating the Piecewise Linear Camera Response Model The decision to employ a PL camera response model approximation for our estimation problem resulted from many considerations. Initially, the fact that we needed a pixel-based model directly parameterized in terms of required the use of relation (2). Having established this, we needed a reasonable model for that could be used and where the existence of could be guaranteed without much effort. Polynomial models were considered but it became apparent that determining the inverse of such a function is not, in general, easy, and, if it could be done, would generally increase, leading to inthe model order of creased comparametric model order complexity. Further, constraints would have to be placed on the permissible values of could exist over the defined the coefficients of so that range of . Other function approximations such as linear transform decompositions were also considered, but it was not clear how could be guaranteed to be monotonically increasing via coefficient constraints. Drawing on previous experience with PL models, we found that employing such a model for the camera response function very nicely addressed many of the difficulties that seemed inexists, trinsic to the problem at hand. First, to guarantee that we need a parameterizable form for that can be constrained to enforce a monotonically increasing behavior for . Previous work had shown that this could be done by constraining the slopes of a PL function to be positive-valued [15], [16]. Second, was also PL. utilizing a PL form for , it was found that An even more welcomed result was that the functional comvia (2) was PL—hence, the comparaposition of with metric model was not “order-wise” intrinsically more complex than the camera response model. Third, by simply increasing the number of PL segments in , we could, in principle, arbitrarily1140IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 14, NO. 8, AUGUST 2005closely model this continuous function and, in turn, its corresponding comparametric function. Fourth, by appropriately parameterizing the PL model of , we could express the inherently constrained camera response function estimation problem as an unconstrained optimization problem. Due to these and other advantages that will soon be discussed, approximating the camera response function with a PL model so that we could solve for in (2) seemed most appropriate. III. PIECEWISE LINEAR MODELING The piecewise linear comparametric model employed in [11] for joint domain and range registration was slope parameterized, i.e., parameterized in terms of each PL segment’s slope and associated knot locations. In the work of this paper, we reparameterize this model to one that will be called intercept parameterized so that each PL segment’s “ intercept,” along with their corresponding knot locations, serve as the parameter set about which to optimize. At first, this might seem like a trivial change to our camera response function estimation problem but, as it turns out, has a very significant impact on the optimization setup and solution. This point is further addressed in Section IV-A. We now define the intercept parameterized PL camera response function that is employed throughout this paper. First, let us define an segment continuous and piecewise linear function on an interval asFig. 1. Diagram illustrating the variables used in parameterizing the piecewise linear model y (x) of (3) and (4) for the case of N = 3 piecewise linear segments. The (x) each represents a linear segment. The define linear segment intercept-related parameters and the x denote knot locations delimiting the linear segments. In general, we have a function defined over a domain [x ; x ) and, given y , we observe y = (x ); i = 1; . . . ; N .. . .(3). The significance of these relations will become evident in Section IV-A. In order to solve for the camera response in (2), we approxthat is consistent imate it with a range bounded PL function with the general increasing and bounded camera response propto the pixel range erties defined in [4]. First, by normalizing of [0, 1], as done in [4], we can extend slightly the definition of in (3) and (4) so thatwhere , enforces conti, are knots that nuity between segments and the constitute a partition over the previously given interval. Using three segments), we the diagram in Fig. 1 (illustrated for can see that, in general, depends on knots and “inwhere and where tercepts” . Given this parameterization in terms of and , we can express (3) as(6) Notice that, because is a continuous function for all , (6) imand this will be the case in the plies necessarily that remainder of the paper; hence, any use of (5) or others resulting from this point forward. Second, by from it assumes constraining the function to be increasing not only do we satisfy the camera response trait described in [4] but we also allow for the general existence of the camera response function inneeded in (2). Given this functionally increasing reverse can quirement and the definition in (6), the approximation be readily made to satisfy this criteria by constraining the inter, to be strictly positive. Enforcing cept values that is, like its this constraint leads to an inverse function , also continuous and piecewise linear over counterpart segments. It is given by. . .(4) . It is clear from (3) and (4) that, given our for parameterization, each linear segment can be expressed as (5) Further, it is apparent from Fig. 1 that . , so Likewise, we can define that and, for later convenience, we now also define the vector and vector. . .(7)CANDOCIA AND MANDARINO: SEMIPARAMETRIC MODEL FOR ACCURATE CAMERA RESPONSE FUNCTION MODELING1141where for and . Each segis found to simply be the functional inverse of its correment sponding linear segment , i.e., we must satisfy for . Using (5), we find that(8) The final and central model of this paper is the PL approximation to the general comparametric relation of (2). By piecewise linearly modeling, the camera response function, we now have a direct comparametric relation in terms of the exposure parameter that we did not have in previous PL comparametrically based work [11]. The advantages of retaining the properties inherent to PL models and of being able to accurately model the camera response function directly from observed pixel values, as previously mentioned, make this model a fundamentally new and attractive approach to, not just exposure estimation, but to the joint spatial and tonal registration of images that vary in exposure. Using the relations of (6) and (7), the approximation to (2) is given by (9), shown at the bottom of the page. Analyzing this comparametric equation approximation leads to some notable points. 1) The equation is PL. This is readily noted as the functional composition of two linear segments results in a linear segment. Using (5) and (8), we can see that for any, which resulting in a new set of knots then affects all knots in (9) by this very factor. One can then easily appreciate that multiplying all knots by in (10) does not change the equation as the s would cancel out. 3) Its evaluation requires determining which segments in and contribute to argument ’s algebraic image. The unique contributing segment in given argument is that one which satisfies and the unique contributing segment in is that one which satisfies for all . As a side note, not all PL segment will contribute to defining (9) as this depairs and , i.e., the camera pends on the exposure ratio and being modeled. This is demonstrated later in Fig. 4 and discussed in the results section. 4) The equation allows for modeling of camera response function saturation. Saturation occurs when image pormodel tions have been overexposed. The fact that the of (6) saturates (reaches the maximal range value of 1) past the largest knot value in this equation allows for this type of modeling. Given this, (9) is the central relation about which the remainder of this paper is based. It describes a semiparametric piecewise linear (SPL) relation from which we can use image pixel values to estimate both the camera response function and the exposure differences between images. Its main relevance is that it allows for a solution to in (2).2 IV. OPTIMAL PARAMETER ESTIMATION Having established our SPL comparametric model, we wish to use the pixel values of captured images in the estimation of either the camera response function or the exposure ratio between images. The former estimation requires prior knowledge of exposure ratios between the images and the latter estimation requires the established camera response function model. In either case, we will employ the standard sum of squared differences as our optimality measure as it has been deemed sufficiently simple and accurate to the estimation problem at hand.2This is somewhat analogous to numerically obtaining the solution of an ordinary differential equation, but rather than having a relation involving derivatives, we have one involving a functional composition and a functional inverse.(10) .” and this equation is in the familiar linear form “ 2) The function. results in a unique solution only up to a scale factor in . This behavior is consistent with the camera response modeling in [4] as noted therein. We can see this by scaling all knots in (6) by a constant factor ,(9)1142IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 14, NO. 8, AUGUST 2005Following the cost defined in [11], the optimality measure be expressed ascandefined to make expressing (13) more compact. These definitions are and (14) where the subscript “ ” in (14) denotes the summation of terms and dependence on is stressed by including the “ ” syntax in this equation. Note that the partial derivative in (13) depends on which PL segment in (9) the value of corresponds. Since this segment is defined by the composition of two PL segments from (6) and (7), respectively, we must express (13) over and . all possible The other necessary partial derivative that is needed for the camera response function modeling is(11)and that differ in exposure, , constitute comparagram pixel pairs, i.e., image pixel values of the same scene point captured at different camera exposure settings (one from image and the other from image ). Also, is the SPL comparametric model of (9) where the pixel values of and have been normalized to the interval [0, 1] according to the definition of (6). The optimum parameter values will necessarily be found at that point where the cost’s gradient with respect to each parameter value is identically 0, i.e., where . For each parameter value , this partial derivative is simply written aswhere, for two images(12)Note that, given two images, one can, in principle, attempt to solve for the and parameters simultaneously in . This, however, would make the camera response function estimation unnecessarily difficult. Instead, the two sections that follow detail how the camera response function can be estimated parameters, and once this is done, how expovia the and sure estimates from image pairs can be obtained. A. Camera Response is a vector of paIn this estimation problem, rameters that makes explicit the dependence of (9) on intercept related and knot interval-related parameter values as defined following (5). The gradient in our problem requires us to find the and . partial derivative of (11) for each Noting this and working through the differentiation, it can be shown that(15) where, similar to (13), , and where the also has been omitted for noparameter dependence of tational conciseness. The unit impulse and step function are is defined in (14) and we define as described in (13), along with (16) Equation (16) has been defined this way for notational conciseness and consistency with its counterpart in (14). We have now formulated the main derivatives necessary for our camera response modeling from comparametric data. However, as previously discussed, all parameters in the camera response function of (6) are required to be strictly positive quanti, as defined from ties. Furthermore, all knot interval lengths are, by (6)’s definition, also strictly positive. In the knots order to assure that the solution for the and parameters satisfy these constraints, we have opted to work with a parameterization of auxiliary variables that, through a nonlinear mapping, enforce the required positivity constraints. For this, we have chosen to use the softmax nonlinearity [18], common in probabilistic neural network applications, as our variable mapping. That is, we have defined (17)(13) and where the parameter dependence where of has been omitted for notational conciseness. Notice and are the discrete-time unit sample sequence that (impulse function) and discrete-time unit step sequences, and have been respectively [17]. In addition,CANDOCIA AND MANDARINO: SEMIPARAMETRIC MODEL FOR ACCURATE CAMERA RESPONSE FUNCTION MODELING1143and (18) as our nonlinear mapping where, from (17) for and (18), we can see that and are the auxiliary variables and knot interval lengths , rerelated to the intercepts spectively. The advantage of this variable transformation is that the solution for the auxiliary variables is unconstrained. This is seen by noting that the softmax function is defined over the real line in each independent variable; hence, there are no bounds on permissible values of and . Also, it is easily shown that the softmax mapping in (17) and (18) results in and , as well as and . This is, indeed, very convenient for values that sum to 1 result in two reasons. First, positive that is monotonically increasing, defined over the enan tire unit-range interval and whose functional inverse exists—all requisite conditions as previously discussed. Second, because in (9) is scale invariant, we can normalize all the solution to knots in (6) such that they form a partition on the unit interval and, thus, take advantage of an unconstrained solution to the values. It is for these reasons that the intercept-parameterized PL model being employed to approximate the camera response function, as mentioned earlier, is much preferred over its equivalent but slope parameterized version as given in [11]. That is, this straightforward analysis and unconstrained modeling is not easily possible with the slope-parameterized PL description. In order to solve the unconstrained problem, we define the parameter vector in (11) in terms of the auxiliary intercept and where knot interval parameters such that and . By noting that the softmax derivative in (17) [and similarly for (18)] is (19), the partial derivatives with respect to the for auxiliary intercept and knot interval lengths are seen to be (20) and (21) , since each and parameter depends for and values, respectively, as seen in (17) and (18). on all Finally, note that the partial derivatives in the sum of (20) are given in (13) and (19). Similarly, those in (21) are given by in (19) for and (15) and (19) [by exchanging the and , respectively]. In solving for the unconstrained and parameters, we have used a conjugate gradient approach with line search for the parameter optimization due to its well-established convergence properties and because costly Hessian matrix computations can be avoided [19]. B. Exposure Once the camera response function of (6) is estimated by determining the and parameters that minimize (11) by way of the and auxiliary variables, we can estimate the exposure ratio between two images from their pixel values using the cost function of (11). In this estimation problem, , i.e., there is only the parameter vector consists of one parameter that needs estimating. As dictated by (12), we determine the necessary derivative to be (22), shown at the bottom of the page, where we note (23), shown at the bottom of the page, and where (23) comes from utilizing (5) and (6). In arriving at the derivative in (22), note that at any given value of , there is one and one that determines the value and, similarly, one segment over which ofotherwiseotherwise (22)otherwiseotherwise otherwise (23)1144IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 14, NO. 8, AUGUST 2005is defined. However, given the segments each of these two product terms is defined over, we see that necessarily ; hence, the final derivative form shown in (22). Also noteworthy is that, since is a constant, evaluating it at as done in (22) does not alter its constancy; hence, the term, via (23), in the final form of (22). Of further interest in exposure estimation is when the SPL comparametric model is used in the joint domain and range registration of multiple images, as performed in [10]. Besides needing to evaluate the SPL comparametric function’s derivative with respect to the exposure parameter , we will also need to evaluate its (image ’s) derivative with respect to the other image. This derivative would supplant that of (18) in [10] as the SPL comparametric model would be substituted in place of the comparametric model of (3) in [10].3 This SPL comparametric derivative is given by (24), shown at the bottom of the page, is as given in (22) and where whereotherwise otherwise (25) and this results from the relations in (7) and (8). You will notice the result of (25) was also utilized in determining the final form of (24). In (24), as in (22), for any given value of , the product and implies that , hence, its of final form. V. EXPERIMENTAL RESULTS This section will report on results pertaining to three different image sequences. The first is an exposure sequence that will be used to estimate the camera response function and corresponding SPL comparametric relation. The second is also an exposure sequence used to test the approach’s exposure estimating3The comparametric model in [10] is written as f (g ; k ) for reasons addressed in that paper. However, in this work, it is expressed as g (f ; k ) as given by (2) and (9). By re-expressing (9) with f as the dependent variable, the form to substitute in [10] is simply r (r (g )=k ).ability. The third is a sequence captured while the camera was handheld, approximately moved about its optical center and automatically adjusted its exposure setting. Note that all images used in this paper have been resized to 240 320 pixels for generating the results reported. To model the camera response function, we first captured five images at different exposures with a Sony DCRTRV30 camcorder. This exposure sequence is depicted in Fig. 2 and will be denoted the “Flowers” sequence. Note that the five images, – , correspond to Fig. 2(a)–(e), respectively, and that there between any two successive imis an exposure ratio of and in this sequence. To estimate the camera reages sponse function, we simultaneously considered the four ordered , and in Fig. 2 image pairs , and for which exposure ratios of , respectively, are known. The comparagrams of these four image pairs are shown in the scatter plots of Fig. 2(f)–(i). These scatter plots visually depict the pixel-pair data referred to and needed for the optimization of (11). Also, note that more dense portions of the comparagrams are indicated by darker shades of gray. Examining the comparagram data in Fig. 2, we can notice a “wavy” comparametric behavior and pixel saturation resulting from those overexposed images. We can also notice that a curve has been superimposed on each of the four comparagrams of Fig. 2. This was done to illustrate how the SPL comparametric estimate has been able to model both the camera’s “wavy” comparametric behavior as well as the saturation of pixels. To arrive at this comparametric estiPL segments in the of (6), mate, we considered as well as all comparagram data from the four aforementioned image pairs—thus, processing all comparametric data simultaneously. This was used in (11) to solve for and using unconstrained conjugate gradient descent as discussed in Section IV-A. The and values of the PL camera response function were then obtained with the relations in (17) and (18). Having established our camera response function, we estimated the exposure ratio between the “training” image pairs in Fig. 2 as described in Section IV-B. These are noted in the top left corner of each of the four subplots of Fig. 2(f)–(i). We can see there is very good agreement between the estimated values of and the corresponding true values as the maximum relative error is around of 3%. The time to compute the camera response function fromotherwiseotherwise(24)。