The present disclosure is generally related to refining image data.
Advances in technology have resulted in smaller and more powerful computing devices. For example, there currently exist a variety of portable personal computing devices, including wireless telephones such as mobile and smart phones, tablets and laptop computers that are small, lightweight, and easily carried by users. These devices incorporate image sensors, such as digital still cameras and/or digital video cameras. Images captured by these image sensors may be used by individuals for aesthetic or commemorative reasons or may be used by computer vision systems to detect and/or recognize objects in a scene. Utility of the images captured by the image sensors for individuals or computer vision systems may depend in part on clarity of the images. Various conditions may affect the clarity of the images captured by the image sensors. For example, condensate on a lens of the image sensor or atmospheric conditions, such as fog, rain, smoke, or haze, may adversely affect the clarity of the images.
A system and a method for refining image data are disclosed. The image data may be descriptive of an input image and may be refined by generating modified image data descriptive of a plurality of modified images (e.g., a simulated low exposure image and a simulated high exposure image), by determining a weight for each modified image for each pixel of the input image, and by combining pixel values of the modified images based on the weights to generate refined image data. The refined image data may represent a refined version of the input image (e.g., a refined image). For example, the refined image may have enhanced contrast and features (e.g., objects) may be more easily detected in the refined image by humans and computer vision systems as compared to the input image.
In a particular aspect, a method is disclosed. The method includes receiving data representative of image at a computing device. The method further includes generating first modified image by changing a luma channel of the image according to a first function. The method further includes generating a second modified image by changing the luma channel of the image according to a second function. The method further includes determining weights based on values of pixels in the image. The method further includes generating a refined image by combining first pixel values of the first modified image and second pixel values of the second modified image based on the weights.
In another particular aspect, a computer readable storage device stores instructions, that when executed by a processor, cause the processor to perform operations. The operations include receiving data representative of image. The operations further include generating a first modified image by changing a luma channel of the image according to a first function. The operations further include generating a second modified image by changing the luma channel of the image according to a second function. The operations further include determining weights based on values of pixels in the image. The operations further include generating a refined image by combining first pixel values of the first modified image and second pixel values of the second modified image based on the weights.
In another particular aspect, an apparatus is disclosed. The apparatus includes a memory and a processor. The processor is configured to receive data representative of image at a computing device. The processor is further configured to generate a first modified image data by changing a luma channel of the image according to a first function. The processor is further configured to generate a second modified image by changing the luma channel of the image according to a second function. The processor is further configured to determine weights based on values of pixels in the image. The processor is further configured to generate a refined image data by combining first pixel values of the first modified image and second pixel values of the second modified image based on the weights.
Other aspects, advantages, and features of the present disclosure will become apparent after review of the entire application, including the following sections: Brief Description of the Drawings, Detailed Description, and the Claims.
Referring to
The computing device 102 may include an image modifier 103, a weight calculator 105, and an image refiner 106. The image modifier 103, the weight calculator 105, and the image refiner 106 may correspond to hardware modules of the computing device 102, to software modules executed by one or more processors of the computing device 102, or to a combination of hardware and software modules.
In the illustrated example, the computing device 102 is in communication with a display device 107. The display device 107 may be located remotely from the computing device 102 or may be located in a same housing as the computing device 102. For example, the computing device 102 may correspond to a mobile phone and the display device 107 may correspond to a display device of the mobile phone. In some examples, the computing device 102 may be in communication with a memory device or with another computing device.
In operation, the computing device 102 receives the image data 110. In the illustrated example, the image data 110 is received from the image sensor 104, but the image data 110 may be received from other sources, such as another computing device. For example, the image data 110 may be received as part of an image refining request from another computing device. The image data 110 may be received as part of an input video stream (e.g., the image data 110 may correspond to a frame of the input video stream). The image data 110 may represents one input image. The one input image may be an image of a scene (e.g., an image captured by the image sensor 104). For example, the image data 110 may include one or more values for each of a plurality of pixels. The image data 110 may be used by a display device, such as the display device 107, to activate a plurality of pixels of the display device based on the one or more values for each pixel to display the image of the scene. The one or more values may include a luma channel value (y), a blue chroma channel value (Cb), and a red chroma channel value (Cr). The luma channel value of a pixel may indicate a luminous intensity of light traveling through the pixel. Objects in the scene may be difficult to discern in the input image due to condensate on a lens of the image sensor that captured the input image, atmospheric conditions, such as fog, rain, smoke, or haze, or other conditions that may affect image clarity.
The image modifier 103 may generate first modified image data 130 and second modified image data 140 based on the image data 110. The image modifier 103 may generate the first modified image data 130 by applying a first function to pixel values described by the image data 110 to generate first modified pixel values. For example, the image modifier 103 may apply the first function to each pixel in a luma channel (y channel) described by the image data 110 to generate the first modified image data 130. To illustrate, a function F may receive a pixel value (e.g., a luma channel value) corresponding to a first pixel described by the image data 110 as input and output a new pixel value to be assigned to a second pixel described by the first modified image data 130 that corresponds to the first pixel. The first pixel may correspond to the second pixel based on the first pixel having particular coordinates in the input image and the second pixel having the particular coordinates in the first modified image. Other pixel values associated with the second pixel may be the same as the corresponding values of the first pixel. For example, the function F may be used by the image modifier 103 to generate new luma channel values for pixels described by the first modified image data 130 based on corresponding luma channel values of pixels described by the image data 110. The pixels described by the first modified image data 130 may have the same blue chroma channel and red chroma channel values as the corresponding pixels described by the image data 110. In a particular example, the function F may correspond to a lookup table that maps an input pixel value to an output pixel value. The function F may generally output a pixel value that is lower than an input pixel value. For example, the function F may be used to generate luma channel values for the first modified image data 130 that are lower than luma channel values of the input image data 110. That is, the first modified image data 130 may describe a simulated low exposure image of the scene. Particular areas of the simulated low exposure image corresponding to relatively brighter areas of the input image described by the image data 110 may have increased contrast as compared to the input image. Therefore, objects depicted in the particular areas may be more easily detectable by humans and computer vision systems as compared to objects depicted in the corresponding areas of the input image.
The image modifier 103 may generate the second modified image data 140 by applying a second function to the pixel values described by the image data 110 to generate second modified pixel values. For example, the image modifier 103 may apply the second function to each pixel in the luma channel (y channel) described by the image data 110 to generate the second modified image data 140. To illustrate, a function G may receive a pixel value (e.g., a luma channel value) corresponding to a first pixel described by the image data 110 as input and output a new pixel value to be assigned to a second pixel described by the second modified image data 140 that corresponds to the first pixel. The first pixel may correspond to the second pixel based on the first pixel having particular coordinates in the input image and the second pixel having the particular coordinates in the second modified image. For example, the function G may be used by the image modifier 103 to generate new luma channel values for pixels described by the second modified image data 140 based on corresponding luma channel values of pixels described by the image data 110. The pixels described by the second modified image data 140 may have the same blue chroma channel and red chroma channel values as the corresponding pixels described by the image data 110. In a particular example, the function G may correspond to a lookup table that maps an input pixel value to an output pixel value. The function G may generally output a pixel value that is higher than an input pixel value. For example, the function G may be used to generate luma channel values for the second modified image data 140 that are higher than luma channel values of the input image data 110. That is, the second modified image data 140 may describe a simulated high exposure image of the scene. Particular areas of the simulated high exposure image corresponding to relatively darker areas of the input image described by the image data 110 may have increased contrast as compared to the input image. Therefore, objects depicted in the particular areas may be more easily detectable by humans and computer vision systems as compared to objects depicted in the corresponding areas of the input image.
The first and second functions are described in more detail below with reference to
The weight calculator 105 may generate weights 150 based on the pixel values described by the image data 110. The weight calculator 105 may generate a weight corresponding to each pixel described by each of the sets of modified image data generated by the image modifier 103 (e.g., the first modified image data 130 and the second modified image data 140). The sets of modified image data may each describe a number of pixels equal to a number of pixels described by the image data 110. Thus, in the illustrated example, the weights 150 may include two weights (e.g., one corresponding to the first modified image data 130 and one corresponding to the second modified image data 140) for each pixel described in the image data 110. In a particular example, the weights favor a simulated low exposure image (e.g., the first modified image data 130) for pixels corresponding to relatively brighter areas described in the image data 110 and favor a simulated high exposure image (e.g., the second modified image data 140) for pixels corresponding to relatively darker areas described in the image data 110. Generation of the weights 150 is described in more detail below with reference to
The image refiner 106 may generate refined image data 160 by generating new pixel values based on the sets of modified image data generated by the image modifier 103 (e.g., the first modified image data 130 and the second modified image data 140) and the weights 150. For example, the image refiner 106 may combine the luma channel of the first modified image data 130 with the luma channel of the second modified image data 140 based on the weights 150 to generate new luma channel values for the refined image data 160. The refined image data 160 may describe a refined version of the image described by the image data 110 or may describe a refined portion of the image described by the image data 110. As explained above, the first modified image data 130 may represent a simulated low exposure image with increased contrast in areas corresponding to relatively brighter areas of the input image. The second modified image data 140 may represent a simulated high exposure image with increased contrast in areas corresponding to relatively darker areas of the input image. The weights 150 may favor the first modified image data 130 in areas corresponding to brighter areas of the input image and favor the second modified image data 140 in areas corresponding to relatively brighter areas of the input image. Thus, combining the first modified image data 130 and the second modified image data 140 based on the weights 150 may enable generation of a refined image with enhanced contrast in areas corresponding to both brighter and darker areas of the input image. Objects in the refined image may be more easily detectable and/or discernable by humans and computer vision systems due to the enhanced contrast. Generation of the refined image data 160 is described in more detail below with reference to
In the example illustrated in
Thus, the system 100 may receive image data and generate refined image data based on the received image data. The refined image data may describe an image that is clearer than an image described by the image data. Therefore, the system 100 may enable image enhancement that may be used to improve images for use by individuals and computer vision systems.
Referring to
An image modifier, such as the image modifier 103, may generate modified images based on the input image 212. In the illustrated example, a simulated low exposure image 230 and a simulated high exposure image 241 are generated. In other examples, more or different modified images may be generated. The simulated low exposure image 230 may be described by first modified image data, such as the first modified image data 130. The simulated low exposure image 230 includes pixels 232-240, which correspond to (e.g., are transformed versions of) the pixels 214-222 of the input image 212. Each pixel 232-240 of the simulated low exposure image 230 may be generated by applying a function F to the intensity value of a corresponding pixel 214-222 of the input image 212 to obtain a first modified intensity value. For example, the pixel 232 of the simulated low exposure image 230 may correspond to the pixel 214 in the input image 212 (e.g., have same x-y coordinate position within the simulated low exposure image 230). The function F may receive an input intensity value of a pixel 214-222 of the input image 212 and output an intensity value to be assigned to a corresponding pixel in the simulated low exposure image 230. In particular, the function F may generally output intensity values lower than received intensity values. Thus, a first modified intensity value of the pixel 232 may be obtained by applying the function F to the intensity value of the pixel 214 (e.g., i1). Accordingly, the first modified intensity value of the pixel 232 may equal F(i1)=x1. First modified intensity values of the pixels 233-240 may be generated similarly by applying the function F to the intensity values of the pixels 215-222, as shown. Values of the pixels 232-240 in other channels (e.g., a blue chroma component value, a red chroma component value, etc.) may be equal to the values of the corresponding pixels 214-222. For example, the pixel 214 may have a blue chroma value Cb1 and a red chroma value Cr1, and the corresponding pixel 232 may have the blue chroma value Cb1 and the red chroma value Cr1. In alternative examples, the function F may generate new blue chroma values and/or alternative red chroma values in addition or in the alternative to new luma channel values. In other examples, the pixels 214-222 may have alternate associated channels (e.g., red, green, and blue) and the function F may generate one or more new values in the alternate associated channels for the pixels 232-240. Contrast in areas of the simulated low exposure image 230 that correspond to relatively brighter areas (e.g., areas with relatively higher average luma values) in the input image 212 may be higher than in the corresponding areas in the input image 212.
The simulated high exposure image 241 may be described by second modified image data, such as the second modified image data 140. The simulated high exposure image 241 includes pixels 242-250, which correspond to (e.g., are transformed versions of) the pixels 214-222 of the input image 212. The simulated high exposure image 241 may be generated by applying a function G to the intensity value of a corresponding pixel 214-222 of the input image 212 to obtain a second modified intensity value. For example, the pixel 242 of the simulated high exposure image 241 may correspond to the pixel 214 in the input image 212 (e.g., have the same x-y coordinate position within the high exposure image 241). The function G may receive an input intensity value of a pixel 214-222 of the input image 212 and output an intensity value to be assigned to a corresponding pixel in the simulated high exposure image 241. In particular, the function G may generally output intensity values higher than received intensity values. Thus, a second modified intensity value of the pixel 242 may be obtained by applying the function G to the intensity value of the pixel 214 (e.g., i1). Accordingly, the second modified intensity value of the pixel 242 may equal G(i1)=x10. Second modified intensity values of the pixels 243-250 may be generated similarly by applying the function G to the intensity values of the pixels 215-222, as shown. Values of the pixels 242-250 in other channels (e.g., a blue chroma component value, a red chroma component value, etc.) may be equal to the values of the corresponding pixels 214-222. For example, the pixel 214 may have a blue chroma value Cb1 and a red chroma value Cr1, and the corresponding pixel 242 may have the blue chroma value Cb1 and the red chroma value Cr1. In alternative examples, the function G may generate new blue chroma values and/or alternative red chroma values in addition or in the alternative to new luma channel values. In other examples, the pixels 214-222 may have alternate associated channels (e.g., red, green, and blue) and the function G may generate one or more new values in the alternate associated channels for the pixels 242-250. Contrast in areas of the simulated high exposure image 241 that correspond to relatively darker areas (e.g., areas with relatively lower average luma values) in the input image 212 may be higher than in the corresponding areas in the input image 212.
A weight calculator, such as the weight calculator 105, may generate weights 251 corresponding to each of the pixels 214-222 for each of the modified images generated (e.g., the simulated low exposure image 230 and the simulated high exposure image 241). The weights 251 may correspond to the weights 150. The sum of the weights for each pixel may equal 1. For example, the weights 251 may include a plurality of sets of weights 252-260. Each of the sets of weights 252-260 may correspond to one of the pixels 214-222. Each of the sets of weights 252-260 may include a value for each modified image generated and a sum of the values may add up to 1. For example, a first set of weights 252 may include a first weight w1 and a second weight 1−w1 that correspond to the pixel 214. The first weight w1 may be associated with the simulated low exposure image 230. In particular, the first weight w1 may be associated with the pixel 232 of the simulated low exposure image 230. The second weight 1−w1 may be associated with the simulated high exposure image 241. In particular, the second weight 1−w1 may be associated with the pixel 242 of the simulated high exposure image 241. The sets of weights 253-260 may each include a weight per modified image (e.g., the simulated low exposure image 230 and the simulated high exposure image 241). In the illustrated example, there may be two weights per set because there are two modified images (e.g., the simulated low exposure image 230 and the simulated high exposure image 241). In other examples that include more modified images, the sum of the weights in a set of weights may add up to 1. In the illustrated example, the weights 251 may favor the simulated low exposure image 230 in areas corresponding to relatively brighter areas of the input image 212, and the weights 251 may favor the simulated high exposure image 241 in areas corresponding to relatively darker areas of the input image 212. Generation of the weights 251 is explained with more detail with reference to
An image refiner, such as the image refiner 106, may combine the simulated low exposure image 230 and the simulated high exposure image 241 based on the weights 251 to generate the refined image 261. The refined image 261 may be described by refined image data, such as the refined image data 160. The refined image 261 includes pixels 262-270. Values (e.g., intensity values) for each of the pixels 262-270 may be assigned based on a sum of a corresponding pixel from the simulated low exposure image 230 and a corresponding pixel from the simulated high exposure image 241, each weighted based on corresponding weights from the weights 251. For example, a luma channel value for each of the pixels 262-270 in the refined image 261 may be based on a weighted combination of luma channel values of a corresponding pixel 232-240 in the simulated low exposure image 230 and a corresponding pixel 242-250 in the simulated high exposure image 241. To illustrate, the pixel 262 in the refined image 261 may have a luma channel intensity value equal to a combination of the corresponding pixels 232 and 242 weighted by the corresponding set of weights 252 (e.g., x1w1+x10(1−w1)). Thus, each of the pixels 262-270 in the refined image 261 may have one or more values (e.g., a luma channel value) that is based on a weighted combination of one or more values of corresponding pixels in the low exposure image 230 and the high exposure image 241.
As explained above, the simulated low exposure image 230 may have relatively higher contrast in areas corresponding to brighter areas of the input image 212, and the high exposure image 241 may have relatively higher contrast in areas corresponding to darker areas of the input image 212. Since the refined image 261 is generated by combining the simulated low exposure image 230 and the simulated high exposure image 241 using the weights 251 that favor the simulated low exposure image 230 in areas corresponding to relatively brighter areas of the input image 212 and that favor the simulated high exposure image 241 in areas that correspond to relatively darker areas of the input image 212 to generate the refined image 261, the refined image 261 may have higher contrast than the input image 212 in both areas that correspond to relatively bright areas of the input image 212 and areas that correspond to relatively dark areas of the input image 212. Thus, objects may be easier to detect (e.g., by individuals or computer vision systems) in the refined image 261 as compared to the input image 212. Thus, the diagram 200 illustrates how an input image may be refined to clarify objects in the image.
Referring to
In a particular example, one or both of the first function 305 and the second function 306 may be determined (e.g., identified) based on the mode 303. The first function 305 may be determined so that output intensity values are lower than input intensity values, as illustrated. In some examples, the first function 305 may approximate a function E(input)=input (e.g., a function for which the output is equal to the input). The second function 306 may be determined so that output intensity values are higher than input intensity values, as illustrated. A derivative of the first function 305, F(y; m), may have a largest value at the mode 303, where m is the mode 303. In a particular example, the first function 305, F(y; m), is defined from F(0; m)=0 to F(1, m)=1 and may be obtained by integrating the derivative of F(y; m), where m is equal to the mode 303. The derivative of F(y; m), F′(y; m), may be equal to
where w is a user-specified width parameter and A is automatically determined so that F(1; m)=1 or so that an average value of F is 1 in the domain [0, 1]. Chroma values of the pixel values of the input image 212 may be modified based on the first function 305. For example, chroma channel values U in the input image 212 may be changed to U′ in the simulated low exposure image 230 based on the equation
Similarly, chroma channel values V in the input image 212 may be changed to V′ in the simulated low exposure image 230 based on the equation
The second function 306 may be a piecewise-sigmoid function defined as
when y<t and
when y>t, where t, w1, and w2 are threshold and width parameters that may be selected by a user. Chroma values of the pixel values of the input image 212 may be modified based on the second function 306.
In particular examples, the mode 303 and the functions 305, 306 may be determined by an image modifier, such as the image modifier 103. For example, the image modifier 103 may receive the image data 110 and determine the mode 303 based on values (e.g., luma channel values) of the pixels described by the image data 110. The image modifier 103 may determine the functions 305, 306 based on the mode 303. The mode 303 and the functions 305, 306 may be determined for each input image and may differ between each input image. For example, the mode 303 and the functions 305, 306 may be determined for each frame in an input video stream. In particular examples, the functions 305, 306 may correspond to lookup tables. For example, a first lookup table 310 may correspond to the first function 305 and a second lookup table 312 may correspond to the second function 306. In some examples, more than 2 functions are generated so that more than 2 modified images may be used to generate a refined image.
The mode 303 may be indicative of a luma channel value that corresponds to a distortion in an image due to various conditions affecting quality of the input image. For example, pixels affected by haze in the atmosphere may all have a similar luma channel value. In some examples, an adjusted mode is used to select the first function 305 and the second function 306. For example, the mode 303 may be shifted toward an expected mode (e.g., a value of 200). To illustrate, when the mode 303 is more than a threshold amount different than the expected mode, an adjusted mode may be generated by adding or subtracting a value to the mode 303 to move the adjusted mode toward the expected mode. The adjusted mode may be used instead of the mode 303 to generate the functions 305, 306.
Thus,
Referring to
For example, the set of weights 256 corresponding to the pixel 218 may be calculated based on an average of the luma channel intensity values of pixels that surround (e.g., a cluster of pixels) the pixel 218 (e.g., the pixels 214-222). In the example, shown in
The weights may cause a simulated low exposure image to be considered more (e.g., to be more heavily weighted) in determining a value of pixels in a refined image corresponding to bright regions of the input image while causing a simulated high exposure image to be considered more (e.g., to be more heavily weighted) in determining a value of pixels in the refined image corresponding to dark regions of the input image. For example, the first set of weights 252 may cause the image refiner 106 to consider the pixel 232 in the simulated low exposure image 230 more than the pixel 242 in the simulated high exposure image 241 when the pixel 214 is in a bright region of the input image 212. Similarly, the first set of weights 252 may cause the image refiner 106 to consider the pixel 242 in the simulated high exposure image 241 more than the pixel 232 in the simulated low exposure image 230 when the pixel 214 is in a dark region of the input image 212. More weights may be generated for a particular pixel when more modified images are used to generate a refined image. The sum of the weights corresponding to a particular pixel may be 1.
Thus,
Referring to
Referring to
The memory 632 may include data and instructions, such as computer-readable instructions or processor-readable instructions. The data and instructions may be associated with executing the image refining module 664.
In a particular aspect, an input device 630 and a power supply 644 are coupled to the system-on-chip device 622. Moreover, in a particular aspect, as illustrated in
In an aspect, an apparatus includes means for receiving data representative of image at a computing device. The means for receiving data may correspond to the image sensor 104, the camera 631, the computing device 102, the device 600, the antenna 642, the wireless interface 640, the memory 632, or a combination thereof. The apparatus further includes means for generating a first modified image by changing a luma channel of the image according to a first function. The means for generating first modified image may correspond to the computing device 102, the image modifier 103, the device 600, the processor 610, the image refining module 664, or to a combination thereof. The apparatus further includes means for generating a second modified image by changing the luma channel of the image according to a second function. The means for generating a second modified image may correspond to the computing device 102, the image modifier 103, the device 600, the processor 610, the image refining module 664, or to a combination thereof. The apparatus further includes means for determining weights based on values of pixels in the image. The means for determining weights may correspond to the computing device 102, the weight calculator 105, the device 600, the processor 610, the image refining module 664, or to a combination thereof. The apparatus further includes means for generating a refined image by combining first pixel values of the first modified image and second pixel values of the second modified image based on the weights. The means for generating a refined image may correspond to the computing device 102, the image refiner 106, the device 600, the processor 610, the image refining module 664, or to a combination thereof.
The previous description of the disclosed aspects is provided to enable a person skilled in the art to make or use the disclosed aspects. Various modifications to these aspects will be readily apparent to those skilled in the art, and the principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope possible consistent with the principles and novel features as defined by the following claims.
The present application claims priority to and the benefit of U.S. Provisional Patent Application No. 62/143,671 filed Apr. 6, 2015, the content of which is expressly incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
62143671 | Apr 2015 | US |