WO2015139454A1 - 一种高动态范围图像合成的方法及装置 - Google Patents

一种高动态范围图像合成的方法及装置 Download PDF

Info

Publication number
WO2015139454A1
WO2015139454A1 PCT/CN2014/089071 CN2014089071W WO2015139454A1 WO 2015139454 A1 WO2015139454 A1 WO 2015139454A1 CN 2014089071 W CN2014089071 W CN 2014089071W WO 2015139454 A1 WO2015139454 A1 WO 2015139454A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
image
value
hole
candidate
Prior art date
Application number
PCT/CN2014/089071
Other languages
English (en)
French (fr)
Inventor
高山
徐崚峰
区子廉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015139454A1 publication Critical patent/WO2015139454A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/111Transformation of image signals corresponding to virtual viewpoints, e.g. spatial image interpolation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/15Processing image signals for colour aspects of image signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N2013/0074Stereoscopic image analysis
    • H04N2013/0081Depth or disparity estimation from stereoscopic image signals

Definitions

  • the present invention relates to the field of image processing, and in particular, to a method and apparatus for high dynamic range image synthesis.
  • the high dynamic range image is an image obtained by fusing a plurality of different exposure time images by adjusting the exposure time of the camera, taking multiple exposure times of the same scene, and using image synthesis technology. Among them, the long-exposure image has clear details of the dark area, and the short-time exposure image has clear details of the bright area. Compared to normal images, high dynamic range images provide more dynamic range and image detail to better reflect the real environment.
  • the existing high dynamic range image synthesis technology is mainly divided into two categories: the first type is single camera high dynamic range image synthesis; the second type is multi camera high dynamic range image synthesis.
  • a multi-camera high dynamic range image synthesis technique first, a plurality of cameras simultaneously capture a plurality of images by simultaneously capturing the same object with different exposure times, and then select two images from the plurality of images, and then, according to the two images. a relationship between the corresponding points, acquiring a disparity map of the two images, and further, synthesizing one of the two images into a virtual image of the angle of view of the other image according to the disparity map and the two photos Finally, a final high dynamic range image is obtained from the virtual image and the image of the other perspective.
  • Embodiments of the present invention provide a method and apparatus for high dynamic range image synthesis to improve the quality of high dynamic range images.
  • an embodiment of the present invention provides a method for high dynamic range image synthesis, comprising: acquiring a first image and a second image; the first image and the second image are different exposures to the same object Obtaining at the same time; performing binocular stereo matching on the first image and the second image to obtain a disparity map; synthesizing the same view angle from the second image according to the disparity map and the first image a virtual view; obtaining a second grayscale image according to the second image, and obtaining a virtual view grayscale image according to the virtual view; and passing the high dynamic range according to the second grayscale image and the virtual view grayscale image Synthesizing an algorithm to obtain a high dynamic range grayscale image; obtaining a high according to the high dynamic range grayscale image, the second grayscale image, the virtual view grayscale image, the second image, and the virtual view Dynamic range image.
  • the method further includes: when synthesizing the virtual view having the same viewing angle as the second image according to the disparity map and the first image, Marking, in the virtual view, a pixel of the occlusion area as a hole pixel; the occlusion area is an area generated by the first image and the second image being photographed at different angles of the same object; or Deriving a disparity map and the first image, synthesizing a virtual view having the same viewing angle as the second image, obtaining a second grayscale image according to the second image, and obtaining a virtual view according to the virtual view Before the grayscale image, the method further includes: marking the noise pixel or the occlusion region in the virtual view as a hole pixel; the noise pixel is generated by a pixel in which the disparity value in the disparity map is calculated incorrectly;
  • the obtaining the virtual view grayscale image according to the virtual view comprises: obtaining a virtual view grayscale image marked with a hole pixel according to the virtual view
  • the pixel according to the first image, and each pixel of the first image Corresponding pixels in the second image and a candidate disparity value set of each pixel of the first image, obtaining each candidate view in the candidate disparity value set of each pixel of the first image
  • the matching energy E d (p,d i ) of the difference includes: using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the P of the pixels is obtained for each candidate disparity value difference d i in the set of candidate visual matching energy E d (p, d i); wherein the first fitting and a second parameter value Quasi
  • the value of the parameter b is a value corresponding to the matching energy E d (p, d i );
  • the w(p, q, d i ) w c (p, q, d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents one pixel block in the first image including the pixel p;
  • the pixel q is a pixel belonging to the first pixel block ⁇ p adjacent to the pixel p ;
  • the I 1 (q) represents a pixel value of the pixel q;
  • the I 2 (qd i ) represents a corresponding pixel q a pixel value of a pixel q
  • the pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the pixel according to the first image and each pixel of the first image Corresponding pixels in the second image and a candidate disparity value set of each pixel of the first image, obtaining each candidate view in the candidate disparity value set of each pixel of the first image
  • the matching energy E d (p,d i ) of the difference includes: using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • the I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • the I' 2 (pd i ) I 1 (p) sin ⁇ - I 2 (pd i ) cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • the candidate disparity value set according to each pixel of the first image a matching energy E d (p,d i ) of each of the candidate disparity values, and obtaining a disparity value of each pixel in the first image includes: according to a formula
  • the m is the total number of candidate disparity values in the candidate disparity value set of the pixel q; the smoothing coefficient ⁇ is a preset value; the difference between the parallax differences of the adjacent pixels V max is a preset value.
  • the second grayscale image, the virtual view grayscale image, the second image, and the virtual view, and acquiring the high dynamic range image includes: sequentially using the formula
  • the marking the noise pixel in the virtual view as a hole pixel includes: In the second image, at least two second pixels are determined; the second pixel refers to a pixel having the same pixel value; and the virtual is obtained according to the at least two second pixels in the second image At least two marked pixels in the view; at least two marked pixels in the virtual view are pixels respectively corresponding to the at least two second pixels in the second image in the virtual view; An average pixel value of at least two marked pixels in the virtual view; determining, in sequence, whether a difference between a pixel value of each of the at least two marked pixels in the virtual view and the average pixel value is greater than The noise threshold; if the difference between the pixel value of the marked pixel and the average pixel value is greater than the noise threshold, determining the labeled pixel as a noise pixel, and Sound pixels marked as holes pixels.
  • the acquiring the adjacent pixel of any one of the hole pixels r in the high dynamic range image includes: according to the formula
  • the s represents the pixel r in the high dynamic range image a pixel in the neighborhood ⁇ r ;
  • the I(s) represents a pixel value of the pixel s; and
  • the I 2 (s) represents a pixel of a pixel corresponding to the pixel s in the second image a value;
  • the rs represents a distance between the pixel r and the pixel s;
  • the ⁇ is a preset weight coefficient indicating a distance between the pixel r and the pixel s.
  • the acquiring, by the neighboring pixel of any one of the hole pixels r in the high dynamic range image, The similarity coefficient between adjacent pixels of the first pixel includes: according to the formula
  • the first proportional coefficient ⁇ 1 and the second proportional coefficient ⁇ 2 are in advance a set value; the s represents one of the neighborhoods ⁇ r of the pixel r in the high dynamic range image; the A represents the high dynamic range image; the a' n represents the first The similarity coefficient obtained when calculating the pixel value of the hole pixel.
  • the acquiring, by the neighboring pixel of any one of the hole pixels r in the high dynamic range image, The similarity coefficient between adjacent pixels of the first pixel includes: determining whether the hole pixel r has a first hole pixel; the first hole pixel is a hole having a pixel value in an adjacent hole pixel of the hole pixel r Pixel; if determined The first hole pixel is used, and the similarity coefficient of the first hole pixel is used as the similarity coefficient of the hole pixel r.
  • the k is the total number of candidate disparity values in the candidate disparity value set of the pixel p; according to the first Matching energy E of each candidate disparity value in the candidate disparity value set for each pixel of the image d (p, d i ), obtaining a disparity value of each pixel in the first image; combining the disparity values of each pixel in the first image to obtain the disparity map.
  • the pixel in the second image corresponding to each pixel of the first image, and each pixel corresponding to the first image, and a candidate disparity value set for each pixel of the first image, and obtaining a matching energy E d (p,d i ) of each candidate disparity value in each candidate disparity value set of each pixel of the first image Including: using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the P of the pixels is obtained for each candidate disparity value difference d i in the set of candidate visual matching energy E d (p, d i); wherein the first fitting and a second parameter value Quasi
  • the value of the parameter b is a value corresponding to the matching energy E d (p, d i );
  • the w(p, q, d i ) w c (p, q, d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents one pixel block in the first image including the pixel p;
  • the pixel q is a pixel belonging to the first pixel block ⁇ p adjacent to the pixel p ;
  • the I 1 (q) represents a pixel value of the pixel q;
  • the I 2 (qd i ) represents a corresponding pixel q a pixel value of a pixel q
  • the pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the second image is corresponding to each pixel of the first image and each pixel of the first image.
  • a pixel, and a candidate disparity value set for each pixel of the first image, to obtain a matching energy E d of each candidate disparity value in each candidate disparity value set of each pixel of the first image ( p, d i ) includes: using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • the I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • the I' 2 (pd i ) I 1 (p) sin ⁇ - I 2 (pd i ) cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • the candidate according to each pixel of the first image a matching energy E d (p, d i ) of each candidate disparity value in the disparity set, obtaining a disparity value of each pixel in the first image, including: according to a formula
  • the m is the total number of candidate disparity values in the candidate disparity value set of the pixel q; the smoothing coefficient ⁇ is a preset value; the difference between the parallax differences of the adjacent pixels V max is a preset value.
  • an embodiment of the present invention provides a high dynamic range image synthesizing device, including: an acquiring unit, configured to acquire a first image and a second image; and the first image and the second image are differently exposed. Degree of simultaneous shooting of the same object; parallax a processing unit, configured to perform binocular stereo matching on the first image acquired by the acquiring unit and the second image to obtain a disparity map, and a virtual view synthesizing unit, configured to obtain, according to the disparity processing unit a disparity map and the first image acquired by the acquiring unit, synthesizing a virtual view having the same view angle as the second image; and a grayscale extracting unit, configured to obtain, according to the second image acquired by the acquiring unit a grayscale image, and obtaining a virtual view grayscale image according to the virtual view synthesized by the virtual view unit; a high dynamic range fusion unit, configured to obtain the second grayscale image according to the grayscale extraction unit
  • the virtual view grayscale image is obtained by a high dynamic range synthesis
  • the method further includes: a hole pixel processing unit: the hole pixel processing unit, configured to mark the noise pixel or the occlusion region in the virtual view as a hole pixel;
  • the occlusion region is an area generated by the angle at which the first image and the second image are captured by the same object; the noise pixel is generated by a pixel that is incorrectly calculated by the disparity value in the disparity map;
  • a degree extraction unit configured to obtain a virtual view grayscale image marked with a hole pixel according to the virtual view marked with the hole pixel;
  • the high dynamic range fusion unit specifically for using the second grayscale image and the mark a virtual view grayscale image with a hole pixel, and a high dynamic range grayscale image marked with a hole pixel by a high dynamic range synthesis algorithm;
  • the color interpolation unit is specifically configured to use a high dynamic range of the labeled pixel according to the hole a grayscale image, the second grayscale image, the virtual view grayscale image labeled
  • the disparity processing unit includes: an obtaining module, a calculating module, a determining module, and a combining module;
  • the determining module is configured to perform according to each of the first images a matching energy of each of the candidate disparity values of the candidate disparity values of the pixels, to obtain a disparity value of each pixel in the first image; the combining module, configured to: each of the first images The disparity values of the pixels are combined to obtain the disparity map.
  • the calculating module is specifically configured to use, according to the candidate parallax set of the pixel p Difference, using formula
  • the P of the pixels is obtained for each candidate disparity value difference d i in the set of candidate visual matching energy E d (p, d i); wherein the first fitting and a second parameter value Quasi
  • the value of the parameter b is a value corresponding to the matching energy E d (p, d i );
  • the w(p, q, d i ) w c (p, q, d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents one pixel block in the first image including the pixel p;
  • the pixel q is a pixel belonging to the first pixel block ⁇ p adjacent to the pixel p ;
  • the I 1 (q) represents a pixel value of the pixel q;
  • the I 2 (qd i ) represents a corresponding pixel q a pixel value of a pixel q
  • the pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the calculating module is specifically configured to use, according to the candidate parallax set of the pixel p Difference, using formula
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • the I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • the I' 2 (pd i ) I 1 (p) sin ⁇ - I 2 (pd i ) cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • the determining module is specifically used according to a formula
  • the m is the total number of candidate disparity values in the candidate disparity value set of the pixel q; the smoothing coefficient ⁇ is a preset value; the difference between the parallax differences of the adjacent pixels V max is a preset value.
  • the color interpolation unit is specifically used to sequentially use the formula
  • the hole pixel processing unit is specifically configured to determine in the second image At least two second pixels; the second pixel is a pixel having the same pixel value; the hole pixel processing unit is configured to obtain, according to the at least two second pixels in the second image, At least two marked pixels in the virtual view; at least two marked pixels in the virtual view are pixels in the virtual view corresponding to the at least two second pixels in the second image respectively
  • the hole pixel processing unit is configured to acquire an average pixel value of at least two marked pixels in the virtual view; the hole pixel processing unit is specifically configured to sequentially determine at least two tags in the virtual view Whether a difference between a pixel value of each of the marked pixels in the pixel and the average pixel value is greater than the noise threshold; the noise threshold is a preset noise for determining noise
  • the hole pixel processing unit is specifically configured to determine the marked pixel as a noise pixel if a difference between a pixel value
  • the hole pixel processing unit is specifically configured according to a formula
  • the s represents the pixel r in the high dynamic range image a pixel in the neighborhood ⁇ r ;
  • the I(s) represents a pixel value of the pixel s; and
  • the I 2 (s) represents a pixel of a pixel corresponding to the pixel s in the second image a value;
  • the rs represents a distance between the pixel r and the pixel s;
  • the ⁇ is a preset weight coefficient indicating a distance between the pixel r and the pixel s.
  • the hole pixel processing unit is specifically configured according to a formula
  • the first proportional coefficient ⁇ 1 and the second proportional coefficient ⁇ 2 are in advance a set value; the s represents one of the neighborhoods ⁇ r of the pixel r in the high dynamic range image; the A represents the high dynamic range image; the a' n represents the first The similarity coefficient obtained when calculating the pixel value of the hole pixel.
  • the hole pixel processing unit is specifically configured to determine whether the hole pixel r has a first hole pixel
  • the first hole pixel is a hole pixel of a pixel value of the adjacent hole pixel of the hole pixel r; the hole pixel processing unit is specifically configured to determine the first hole pixel.
  • the similarity coefficient of a hole pixel is taken as the similarity coefficient of the hole pixel r.
  • an embodiment of the present invention provides an apparatus, including: an acquiring unit, configured to acquire a first image and a second image; and the first image and the second image are simultaneously captured by the same object;
  • the k is a candidate disparity value of the pixel p a total number of candidate disparity values in the set; the determining unit, configured to be based on the first image Depending on the difference between the set of candidate pixels in each candidate disparity value matching the energy E d (p, d i) , to obtain the first image disparity value for each pixel; a processing unit for the The disparity map of each pixel in the first image is combined to obtain the disparity map.
  • the calculating unit is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the P of the pixels is obtained for each candidate disparity value difference d i in the set of candidate visual matching energy E d (p, d i); wherein the first fitting and a second parameter value Quasi
  • the value of the parameter b is a value corresponding to the matching energy E d (p, d i );
  • the w(p, q, d i ) w c (p, q, d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents one pixel block in the first image including the pixel p;
  • the pixel q is a pixel belonging to the first pixel block ⁇ p adjacent to the pixel p ;
  • the I 1 (q) represents a pixel value of the pixel q;
  • the I 2 (qd i ) represents a corresponding pixel q a pixel value of a pixel q
  • the pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the calculating unit is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • the I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • the I' 2 (pd i ) I 1 (p) sin ⁇ - I 2 (pd i ) cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • the determining unit is specifically used according to the formula
  • the m is the total number of candidate disparity values in the candidate disparity value set of the pixel q; the smoothing coefficient ⁇ is a preset value; the difference between the parallax differences of the adjacent pixels V max is a preset value.
  • a method and apparatus for high dynamic range image synthesis obtains a first image and a second image with different exposures, and then performs binocular stereo matching on the first image and the second image, Obtaining a disparity map, and then synthesizing a virtual view having the same viewing angle as the second image according to the disparity map and the first image, and then acquiring a second grayscale image according to the second image, and according to the virtual Obtaining a virtual view grayscale image, and obtaining a high dynamic range grayscale image according to the second dynamic grayscale image and the virtual view grayscale image by a high dynamic range synthesis algorithm, and finally according to the high dynamic range grayscale
  • the image, the second grayscale image, the virtual view grayscale image, the second image, and the virtual view acquire a high dynamic range image, such that adjacent pixels are considered in performing virtual view synthesis The relationship between them improves the quality of high dynamic range images.
  • FIG. 1 is a schematic flowchart of a method for high dynamic range image synthesis according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a mapping curve according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a rotation of a coordinate system according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart diagram of another method for high dynamic range image synthesis according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of determining a noise pixel according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart diagram of a method for synthesizing a disparity map according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of functions of a high dynamic range image synthesizing device according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram showing the function of a parallax processing unit of the high dynamic range image synthesizing device shown in FIG. 8;
  • FIG. 10 is a schematic diagram of functions of another high dynamic range image synthesizing device according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of functions of a device according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for high dynamic range image synthesis, as shown in FIG. 1 , including:
  • the first image and the second image are simultaneously captured by the same object with different exposure degrees.
  • first image and the second image are corrected images, and only the horizontal direction or the vertical direction is displaced between the first image and the second image.
  • the exposure of the first image may be greater than the exposure of the second image, or the exposure of the second image may be greater than the first image.
  • the specific degree of exposure of the first image and the second image is not limited by the present invention.
  • the binocular stereo matching is a process of observing the parallax and obtaining the three-dimensional information of the object by observing the corresponding pixels from the images of the same object from two perspectives.
  • a method for performing binocular stereo matching on a first image and a second image to obtain a disparity map and a method for obtaining a disparity map of two images, such as WSAD (Weighted Sum of Absolute Differences, The weighted absolute difference sum algorithm, ANCC (Adaptive Normalized Cross-Correlation), and the like may also be the method proposed by the present invention.
  • WSAD Weighted Sum of Absolute Differences
  • ANCC Adaptive Normalized Cross-Correlation
  • the binocular stereo matching algorithm proposed by the present invention is specifically as follows, and includes:
  • the candidate disparity value set includes at least two candidate disparity values.
  • the candidate disparity value corresponds to the depth in the three-dimensional space. Since the depth has a certain range, the candidate disparity value also has a certain range. Each of the values in this range is a disparity candidate value that together constitutes a set of candidate disparity values for one pixel.
  • candidate disparity values in the candidate disparity value set of each pixel in the first image may be the same or different.
  • the invention is not limited thereto.
  • p denotes a pixel p, which is a pixel of a first image corresponding to the set of candidate disparity values.
  • k is the total number of candidate disparity values in the candidate disparity value set of pixel p.
  • the candidate disparity value set of each pixel includes at least two candidate disparity values, k ⁇ 2.
  • the present invention proposes two methods for calculating the matching energy E d (p,d i ) as follows:
  • the first method using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the value of the first fitting parameter a and the value of the second fitting parameter b are values corresponding to the matching energy E d (p, d i ) being the minimum value.
  • w(p,q,d i ) w c (p,q,d i )w s (p,q,d i )w d (p,q,d i ).
  • the first pixel block ⁇ p represents one pixel block containing the pixel p in the first image.
  • the pixel q is a pixel belonging to the first pixel block ⁇ p adjacent to the pixel p .
  • I 1 (q) represents the pixel value of the pixel q.
  • I 2 (qd i ) represents the pixel value of the pixel qd i in the second image corresponding to the pixel q.
  • w c (p, q, d i ) represents a pixel weight value;
  • w s (p, q, d i ) represents a distance weight value;
  • w d (p, q, d i ) represents a parallax weight value.
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I 1 (p) represents a pixel value of the pixel p
  • I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • the first weighting coefficient ⁇ 1 and the second weighting coefficient ⁇ 2 The third weighting factor ⁇ 3 and the fourth weighting factor ⁇ 4 are preset values.
  • the first pixel block ⁇ p represents one pixel block including the pixel p in the first image.
  • the first pixel block may be a 3 neighborhood of the pixel p, or may be a 4 neighborhood of the pixel p, and the first pixel block may be centered on the pixel p or may not be centered on the pixel p, for the first pixel
  • the specific size of the block and the specific location of the pixel p in the first pixel block are not limited in the present invention.
  • I 2 (j) represents the pixel value of any one of the pixels j in the second image
  • I 1 (f) represents the pixel value of the pixel f corresponding to the pixel j in the second image in the first image
  • a and b are A fitting parameter that varies as the pixel position changes. That is to say, the first fitting parameter a and the second fitting parameter b are also different for different pixels.
  • f-d can be used for calculation. Representing a pixel corresponding to any pixel f in the second image in the first image. At this time, d represents a disparity value between the response pixels of any pixel f in the first image with respect to the second image. It should be noted that since the time parallax between the pixel in the first image and the corresponding pixel in the second image is unknown at this time, the actual disparity value is approximated by the candidate disparity value.
  • a plurality of candidate disparity values are set for each pixel in the first image, and the candidate disparity value set of each pixel constitutes a candidate disparity value set of the pixel, and then the pixel is selected.
  • the candidate disparity value of the candidate disparity value set that has the smallest difference between the candidate disparity value and the actual disparity value is used as the calculated disparity value of the pixel. That is to say, the disparity value of the pixel calculated in the embodiment of the present invention is not the actual disparity value of the pixel, but a value of the candidate disparity value set of the pixel that is similar to the actual disparity value.
  • tangent n is a straight line with a slope of tan ⁇ . Since the coordinate system is rotated ⁇ counterclockwise, the slope of the tangent n in the new coordinate system is reduced to tan( ⁇ - ⁇ ).
  • the slope of the tangent n on the new coordinate axis is greatly reduced to become tan ( ⁇ -45°) ⁇ 1.
  • the pixel weight value w c (p, q, d i ) can be based on the formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • I' 2 (pd i ) I 1 (p) sin ⁇ -I 2 (pd i )cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • Pixel value weight w c (p,q,d i ) exp[- ⁇ 1 ⁇
  • the candidate disparity value of each pixel in the corresponding first image is determined as The disparity value of each pixel.
  • I represents a first image
  • the second pixel block N p represents a pixel block containing pixels p in the first image
  • V p,q (d i ,d j ) ⁇ min(
  • m is the total number of candidate disparity values in the candidate disparity value set of the pixel q;
  • the smoothing coefficient ⁇ is a value set in advance; the maximum value V max of the difference in parallax between adjacent pixels is a value set in advance.
  • the candidate energy includes two aspects, the first aspect is the sum of the matching energies of each pixel in the first image, and the second aspect is the smoothing energy V p,q of each pixel in the first image.
  • the second pixel block N p may be the same as the first pixel block or may be different from the first pixel block, which is not limited in the present invention.
  • Min(x, y) represents a function that takes the smaller of x and y.
  • , V max ) represents a difference between the candidate disparity value d i of the pixel p in the first image and the candidate disparity value of the pixel q and a preset interval between adjacent pixels The smaller of the maximum time difference.
  • Vmax is a predefined cutoff value, the purpose is to prevent the smoothing energy from being too large, thus affecting the accurate assignment of the parallax between the foreground and the background edge.
  • the smaller the candidate energy the greater the similarity with the second image in the first image. That is, the better the matching between the pixels in the first image and the second image.
  • the disparity value of each pixel of the first image determined in this step is a combination of candidate disparity values of each pixel in the first image, and the obtained candidate energy is the minimum value, corresponding to
  • the candidate disparity value for each pixel in the first image is the disparity value of the pixel.
  • the candidate disparity value of each pixel in the first image can be quickly obtained by using the existing graph cuts method, and it is not necessary to traverse all the candidate disparity values of each pixel at this time.
  • the disparity map is an image obtained by arranging the disparity values of each pixel in the first image in the order in which the original pixels are arranged.
  • the exposure ratio of the first image to the second image is 16:1, the exposure ratio of the first image to the second image is 4:1, and the ratio of the first image to the second image.
  • the error rates of the first method and the second method proposed in the embodiments of the present invention and the existing WSAD algorithm and the ANCC algorithm are compared.
  • Figure 4 shows the comparison results. It can be seen from the figure that the ratio of exposure between the first image and the second image is particularly large, at 16:1, the WSAD and ANCC algorithms are very A large error rate, and the results of the first method and the second method proposed in this embodiment are very accurate. In the case of the other two exposure ratios, the first method and the second method proposed in this embodiment are always superior to the results of WSAD and ANCC.
  • the first method and the second method proposed in the embodiments of the present invention have greatly reduced the error rate in calculating the disparity map, there are still a small portion of the pixels calculated by the disparity value and the actual value.
  • the disparity values differ greatly, so these pixels are treated as the pixels of the disparity map in which the disparity values are calculated incorrectly.
  • the virtual view of an arbitrary angle can be synthesized.
  • the virtual view having the same viewing angle as the second image is synthesized by using the disparity map and the first image.
  • the virtual view having the same viewing angle as the second image may be synthesized by using the first image and the disparity map by using the prior art.
  • the formula can be utilized Find the pixel value of each pixel in the virtual view.
  • I 1 (x, y) represents the pixel value of the pixel in which the abscissa is x and the ordinate is y in the first image
  • d represents the parallax value of the pixel in which the abscissa is x and the ordinate is y in the first image.
  • the pixel value of the pixel corresponding to the pixel in the virtual view The pixel in the first image is displaced in the horizontal direction to a pixel value corresponding to the pixel after the parallax value d is translated.
  • the formula can be utilized Find the pixel value of each pixel in the virtual view.
  • I 1 (x, y) represents the pixel value of the pixel in which the abscissa is x and the ordinate is y in the first image
  • d represents the parallax value of the pixel in which the abscissa is x and the ordinate is y in the first image.
  • the pixel value of the pixel corresponding to the pixel in the virtual view The pixel in the first image is displaced in the vertical direction to a pixel value corresponding to the pixel after the parallax value d is translated.
  • the second grayscale image and the virtual view grayscale image may be acquired by a method of acquiring a grayscale image of the image according to a color image of one image in the prior art.
  • the grayscale image may also be other methods for obtaining a grayscale image by a color image in the prior art, and the present invention is not limited thereto.
  • R represents the red component of any pixel in the color image
  • G represents the green component of the pixel
  • B represents the blue component of the pixel
  • Grey represents the gradation of the pixel corresponding to the pixel in the grayscale image.
  • a high dynamic range grayscale image is obtained by a high dynamic range synthesis algorithm.
  • the high dynamic range synthesis algorithm refers to an algorithm that combines multiple pictures to obtain a high dynamic range image.
  • the second grayscale image and the virtual view grayscale image may be merged to obtain a high dynamic range grayscale by using an existing single camera high dynamic range image synthesis method or a multi-camera high dynamic range image synthesis method.
  • the red, green, and blue colors of the image to be synthesized are separately processed.
  • the synthesis will be required.
  • the gray scale of the image can be processed.
  • this step uses the second image with the color and the virtual view to determine the high dynamic range gray.
  • the red component value, the green component value, and the blue component value of each pixel in the graph is not included in the high dynamic range grayscale image acquired in the previous step.
  • this step includes:
  • the red component values I red (e), the green component values I green (e), and the blue component values I blue (e) of each pixel in the high dynamic range image are obtained.
  • e represents a pixel e in a high dynamic range image
  • I grey (e) represents the pixel value of the pixel corresponding to the pixel e in the high dynamic range gray scale image, a pixel value indicating a pixel corresponding to the pixel e in the second grayscale image, a pixel value representing a pixel corresponding to the pixel e in the virtual view grayscale image; and Representing a red component value, a green component value, and a blue component value of a pixel corresponding to the pixel e in the second image; and The red component value, the green component value, and the blue component value of the pixel corresponding to the pixel e in the virtual view are respectively indicated.
  • ⁇ (e) represents a weight coefficient for adjusting the ratio of the color of the second image to the color of the virtual view when synthesizing the high dynamic range image.
  • ⁇ (e) is a value calculated by the relationship between the second grayscale image, the virtual view grayscale image, and the corresponding pixel on the high dynamic range grayscale image.
  • T2 obtaining, according to a red component value, a green component value, and a blue component value of each pixel in the high dynamic range image, a pixel value of each pixel in the high dynamic range image;
  • the pixel value of each pixel in the high dynamic range image is obtained, and the red component value of one pixel is known in the prior art.
  • the method of obtaining the pixel value of the pixel is the same as the green component value and the blue component value, and the present invention will not be repeated here.
  • T3 Combine the pixel values of each pixel in the high dynamic range image to obtain a high dynamic range image.
  • the high dynamic range image is formed by combining a plurality of pixels in an array, and each pixel can be expressed by a pixel value.
  • a method for high dynamic range image synthesis first obtains a first image and a second image with different exposures, and then performs binocular stereo matching on the first image and the second image to obtain a disparity map, and then And synthesing a virtual view having the same viewing angle from the second image according to the disparity map and the first image, and then acquiring the second gray image according to the second image, and acquiring the virtual view gray image according to the virtual view, and according to the second gray image And the virtual view gray image, through the high dynamic range synthesis algorithm, obtaining a high dynamic range gray image, and finally according to the high dynamic range gray image, the second gray image, the virtual view gray image, the second image, and the virtual view, The high dynamic range image is obtained, so that the quality of the high dynamic range image is improved since the relationship between adjacent pixels is taken into consideration when performing virtual view synthesis.
  • a method for high dynamic range image synthesis provided by an embodiment of the present invention, as shown in FIG. 5, includes:
  • the first image and the second image are simultaneously captured by the same object with different exposure degrees.
  • step 101 For details, refer to step 101, and details are not described herein again.
  • step 102 For details, refer to step 102, and details are not described herein again.
  • the timing of marking the pixels of the occlusion area as the hole pixels may be after synthesizing the virtual view or after synthesizing the virtual view.
  • different steps are performed according to the timing at which the pixel of the occlusion region is marked as a hole pixel. If the pixel of the occlusion area is marked as a hole pixel while synthesizing the virtual view, steps 503a-504a and steps 505-509 are performed; if the pixel of the occlusion area is marked as a hole pixel when the noise pixel is determined after synthesizing the virtual view, Steps 503b-504b and steps 505-509 are performed.
  • the occlusion area is an area generated by the angle at which the first image and the second image are captured by the same object.
  • the virtual view having the same view angle as the second image is the same as step 103, and details are not described herein again.
  • the pixels in the first image cannot be correspondingly matched to the first image.
  • these regions without corresponding pixels are mapped into the virtual image to form an occlusion region.
  • the method of marking the occlusion area as a hole pixel may be that all the pixel values of the pixels corresponding to the noise area are set to a fixed number, such as 1 or 0, in the virtual view; An image having the same view size, the pixel value of the position corresponding to the occlusion area is set to 0, and the pixel value of the position corresponding to the non-occlusion area is set to 1; other methods for marking pixels in the prior art may also be used, and the present invention does not limit.
  • step 103 For details, refer to step 103, and details are not described herein again.
  • the noise pixel is generated by a pixel in which the disparity value in the disparity map is calculated incorrectly.
  • a candidate disparity value is selected from the candidate disparity value set as the disparity value of the pixel, so that the calculated disparity value may have a certain error.
  • the error of a certain pixel exceeds a certain limit, we determine the pixel as the pixel in which the disparity value in the disparity map is calculated incorrectly.
  • the virtual view having the same viewing angle as the second image is synthesized according to the disparity map and the first image, since the disparity image in the disparity map calculates an erroneous image, noise is generated in the synthesized virtual view.
  • the pixels corresponding to these noises are defined as noise pixels.
  • the pixel value of the pixel in the second image and the virtual view thereof there is a corresponding law between the pixel values of the corresponding pixels. For example, when the pixel value of a pixel in the second image is smaller in the pixel values of all pixels of the second image, then the pixel value of the pixel corresponding to the pixel in the virtual image is smaller in the pixel value of all pixels of the virtual image. When the pixel value of a pixel in the second image is larger in the pixel values of all pixels of the second image, then the pixel value of the pixel corresponding to the pixel in the virtual image is larger in the pixel value of all the pixels of the virtual image. .
  • the embodiment of the present invention utilizes this rule to mark pixels that do not conform to this rule as noise pixels.
  • the virtual view includes noise pixels.
  • one pixel in the virtual view corresponds to one pixel in the second image, and the pixel value in the second image is used as the horizontal axis.
  • the pixel value in the virtual view is taken as the vertical axis, and the pixel values of the pixels at the same position in the map are mapped to the map, and the dot matrix in the right axis of FIG. 6 is obtained. It can be observed that most of the points form a smooth increasing curve. A small number of points are far from the mapping curve, and these points are noise. In our algorithm, we first use all the points to estimate the mapping curve, and then calculate the distance from each point to the mapping curve. If the distance is large, the corresponding pixel in the virtual view is determined as a noise pixel.
  • the method of selecting a noise pixel and marking a noise pixel can refer to the following steps:
  • the second pixel refers to a pixel having the same pixel value.
  • all the pixels of the second image are grouped into pixels according to the pixel value, and all the pixels divided into the same group are called second pixels.
  • the at least two marked pixels in the virtual view are pixels respectively corresponding to at least two second pixels in the second image in the virtual view.
  • Q4 Determine, in sequence, whether a difference between a pixel value and an average pixel value of each of the at least two marked pixels in the virtual view is greater than a noise threshold.
  • the pixel is determined as a noise pixel; if the pixel value of a labeled pixel When the difference between the corresponding average pixel values is not greater than a preset noise threshold, it is determined that the pixel is not a noise pixel.
  • the marked pixel is determined as a noise pixel, and the noise pixel is marked as a hole pixel.
  • the method for marking the occlusion region may be the same as or different from the method for marking the noise pixel, and the present invention is not limited thereto.
  • the method for determining and marking the noise pixel may refer to the method for determining and marking the noise pixel in step 504a, and details are not described herein again.
  • the second grayscale image is obtained according to the second image in step 104, and the virtual view grayscale image is obtained according to the virtual view, and details are not described herein again.
  • a hole pixel in a virtual view marked with a hole pixel a pixel corresponding thereto is directly marked as a hole pixel in the virtual view gray image.
  • a high dynamic range grayscale image marked with a hole pixel is obtained by a high dynamic range synthesis algorithm.
  • the high dynamic range gray image is obtained by the high dynamic range synthesis algorithm according to the second gray image and the virtual view gray image in step 105, and details are not described herein again.
  • a hole pixel in a virtual view grayscale image marked with a hole pixel a pixel corresponding thereto is directly marked as a hole pixel in a high dynamic range grayscale image.
  • the processing method of the non-hole pixel refer to the high dynamic range gray image, the second gray image, the virtual view gray image, the second image, and the virtual view in step 106 to obtain a high dynamic range image. This will not be repeated here.
  • the hole pixel in the high dynamic range grayscale image marked with the hole pixel is obtained according to the hole pixel in the virtual view grayscale image marked with the hole pixel, and the virtual view gray marked with the hole pixel is grayed out.
  • the hole pixels in the degree image are obtained according to the virtual view marked with the hole pixel, so the hole pixel in the high dynamic range gray image marked with the hole pixel, the hole pixel in the virtual view gray image marked with the hole pixel and The position of the hole pixels in the virtual view marked with the hole pixels is the same.
  • the high dynamic range gray scale image marked with the hole pixel and the virtual view gray scale image marked with the hole pixel are the same as the position of the hole pixel in the virtual view marked with the hole pixel, this can be selected. Any of the three images is used as a standard, and pixels corresponding to the hole pixels in the image are directly marked as hole pixels in the high dynamic range image.
  • each hole pixel in the high dynamic range image marked with the hole pixel has a first pixel corresponding thereto in the second image.
  • a similarity coefficient between adjacent pixels of any one of the hole pixels r in the high dynamic range image and adjacent pixels of the first pixel is obtained.
  • s represents one of the neighborhoods ⁇ r of the pixel r in the high dynamic range image
  • I(s) represents the pixel value of the pixel s
  • I 2 (s) represents the pixel corresponding to the pixel s in the second image
  • the pixel value; rs represents the distance between the pixel r and the pixel s; ⁇ is a predetermined weighting coefficient indicating the distance between the pixel r and the pixel s.
  • the neighborhood ⁇ r of the pixel r may be a region centered on the pixel r, or may not be a region centered on the pixel r.
  • the present invention is not limited.
  • the similarity coefficient needs to be calculated once. That is, the similarity coefficients for each hole pixel in a high dynamic range image are different.
  • a similarity coefficient between adjacent pixels of any one of the hole pixels r in the high dynamic range image and adjacent pixels of the first pixel is obtained.
  • the first proportional coefficient ⁇ 1 and the second proportional coefficient ⁇ 2 are preset values; s represents one of the neighborhood ⁇ r of the pixel r in the high dynamic range image; A represents a high dynamic range image; n represents the similarity coefficient obtained when the pixel value of the hole pixel is first calculated.
  • the pixel block ⁇ r is a region smaller than the pixel block ⁇ r .
  • the neighborhood ⁇ r of the pixel r may be a region centered on the pixel r, or may not be a region centered on the pixel r.
  • the specific relationship between the neighborhood ⁇ r and the pixel r is not limited by the present invention.
  • a′ n is a value determined by combining the pixel values of each pixel in the high dynamic range image when calculating the first hole pixel, and in order to simplify the calculation, the first hole pixel can be calculated.
  • the determined a'n is stored, and the value can be directly utilized when calculating the pixel value of the hole pixel.
  • C1 and B1 are related to the coefficients of the first half of the formula, so they are related to the pixel s;
  • C2 and B2 are related to the second half of the formula.
  • the coefficients in the second half of the equation have nothing to do with the pixel s, so C2 and B2 are not related to p.
  • C2, B2 is the same, does not require repeated calculations, so that the calculated when the determined first pixel aperture a 'n in the following calculations can be multiplexed is not necessary to calculate .
  • the first proportional coefficient ⁇ 1 is a value larger than the second proportional coefficient ⁇ 2 .
  • the value of the first proportional coefficient ⁇ 1 may be set to 1, and the second proportional coefficient ⁇ 2 is determined to be set to 0.001.
  • the first hole pixel is a hole pixel of the adjacent hole pixel of the hole pixel r that has obtained the pixel value.
  • the similarity coefficient of the first hole pixel is taken as the similarity coefficient of the hole pixel r.
  • the third method is to use the similarity coefficient of the hole pixel in which the pixel value has been calculated around a hole pixel as the similarity coefficient of the hole pixel to simplify the step of calculating the similarity coefficient.
  • first method or the second method can be combined with the third method to calculate the similarity coefficient of each hole pixel in the high dynamic range image.
  • obtaining the pixel value of the hole pixel r includes: according to the formula The pixel value of the hole pixel r is obtained.
  • I(r) represents the pixel value of the hole pixel r
  • I 2 (r) represents the pixel value of the pixel corresponding to the hole pixel r in the second image
  • a n represents the similarity coefficient of the hole pixel r
  • n 0, 1, ... N
  • N is a preset value.
  • the corresponding pixels in the two images represent pixels having the same position in the two images.
  • a method for high dynamic range image synthesis first obtains a first image and a second image with different exposures, and then performs binocular stereo matching on the first image and the second image to obtain a disparity map, and then And synthesing a virtual view having the same viewing angle from the second image according to the disparity map and the first image, and then acquiring the second gray image according to the second image, and acquiring the virtual view gray image according to the virtual view, and according to the second gray image And the virtual view gray image, through the high dynamic range synthesis algorithm, obtaining a high dynamic range gray image, and finally according to the high dynamic range gray image, the second gray image, the virtual view gray image, the second image, and the virtual view, Obtaining a high dynamic range image, in the process of acquiring a high dynamic range image, marking the occlusion area and the noise pixel having a large influence on the picture as a hole pixel, and finally passing the adjacent pixel of the hole pixel and the hole pixel in the second image Correlating
  • An embodiment of the present invention provides a method for synthesizing a disparity map, as shown in FIG. 7, including:
  • the first image and the second image are simultaneously captured by the same object.
  • step 101 For details, refer to step 101, and details are not described herein again.
  • the candidate disparity value set includes at least two candidate disparity values.
  • p represents a pixel p, which is a pixel of a first image corresponding to the candidate disparity value set;
  • k The total number of candidate disparity values in the candidate disparity value set for pixel p.
  • the candidate disparity value set of each pixel includes at least two candidate disparity values, k ⁇ 2.
  • the present invention proposes two methods for calculating the matching energy E(p,d i ) as follows:
  • the first method using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the value of the first fitting parameter a and the value of the second fitting parameter b correspond to a value corresponding to the minimum value of the matching energy E d (p, d i );
  • w(p, q, d i ) w c (p,q,d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents a pixel block containing the pixel p in the first image;
  • p and q is a pixel adjacent to the pixel belonging to the first block of pixels [Omega] p;
  • I 1 (q) denotes a pixel value of a pixel of q;
  • I 2 (qd i) represents the second pixel corresponding to a pixel q qd i
  • w c (p, q, d i ) represents the pixel weight value;
  • pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the second method using a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be based on the formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • I' 2 (pd i ) I 1 (p) sin ⁇ -I 2 (pd i )cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • the candidate disparity value of each pixel in the corresponding first image is determined as The disparity value of each pixel.
  • I represents a first image
  • the second pixel block N p represents a pixel block containing pixels p in the first image
  • V p,q (d i ,d j ) ⁇ min(
  • m is the total number of candidate disparity values in the candidate disparity value set of the pixel q;
  • the smoothing coefficient ⁇ is a value set in advance; the maximum value V max of the difference in parallax between adjacent pixels is a value set in advance.
  • An embodiment of the present invention provides a method for synthesizing a disparity map, acquiring a first image and a second image, and acquiring a candidate disparity value set of each pixel of the first image, and then according to each pixel of the first image, and Obtaining, in the second image corresponding to each pixel of the first image, a candidate disparity value set of each pixel of the first image, acquiring each candidate in the candidate disparity value set of each pixel of the first image.
  • the matching energy E(p,d i ) of the disparity value is then obtained according to the matching energy E d (p,d i ) of each candidate disparity value in the candidate disparity value set of each pixel of the first image.
  • the disparity value of each pixel in the first image is finally combined with the disparity value of each pixel in the first image to obtain a disparity map, so that when the disparity value of each pixel is calculated, the final result is obtained.
  • the error between the disparity value and the disparity value is greatly reduced, thereby improving the quality of the high dynamic range image.
  • FIG. 8 is a schematic diagram showing the function of a high dynamic range image synthesizing device according to an embodiment of the present invention.
  • the high dynamic range image synthesis apparatus includes an acquisition unit 801, a parallax processing unit 802, a virtual view synthesis unit 803, a grayscale extraction unit 804, a high dynamic range fusion unit 805, and a color interpolation unit 806.
  • the obtaining unit 801 is configured to acquire the first image and the second image.
  • the first image and the second image are simultaneously captured by the same object with different exposure degrees.
  • the disparity processing unit 802 is configured to perform binocular stereo matching on the first image acquired by the acquiring unit 801 and the second image to obtain a disparity map.
  • the disparity processing unit 802 includes: an obtaining module 8021 , a calculating module 8022 , a determining module 8023 , and a combining module 8024 .
  • the obtaining module 8021 is configured to acquire a candidate disparity value set of each pixel of the first image.
  • the candidate disparity value set includes at least two candidate disparity values.
  • the calculating module 8022 is configured to obtain a first image according to each pixel of the first image, a pixel in the second image corresponding to each pixel of the first image, and a candidate disparity value set of each pixel of the first image.
  • p denotes a pixel p, which is a pixel of a first image corresponding to the set of candidate disparity values.
  • k is the total number of candidate disparity values in the candidate disparity value set of pixel p.
  • the calculating module 8022 acquires the matching energy E d (p,d i ) of each of the candidate disparity values of each pixel of the first image by the following two methods:
  • the first method, the calculation module 8022 is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p.
  • pixel weight value w c (p, q, d i ) may be according to a formula
  • the distance weight value w s (p, q, d i ) can be according to a formula
  • the disparity weight value w d (p, q, d i ) may be according to a formula
  • I 1 (p) represents a pixel value of the pixel p
  • the I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • a weight coefficient ⁇ 1 , the second weight coefficient ⁇ 2 , the third weight coefficient ⁇ 3 , and the fourth weight coefficient ⁇ 4 are preset values.
  • the second method, the calculating module 8022, is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be based on the formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • I' 2 (pd i ) I 1 (p) sin ⁇ -I 2 (pd i )cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • a determining module 8023 configured to obtain a view of each pixel in the first image according to a matching energy E d (p, d i ) of each of the candidate disparity values of each pixel of the first image. Difference.
  • the determining module 8023 is specifically configured according to a formula
  • the candidate disparity value of each pixel in the corresponding first image is determined as The disparity value of each pixel.
  • I represents a first image
  • the second pixel block N p represents a pixel block containing pixels p in the first image
  • V p,q (d i ,d j ) ⁇ min(
  • m is the total number of candidate disparity values in the candidate disparity value set of the pixel q;
  • the smoothing coefficient ⁇ is a value set in advance; the maximum value V max of the difference in parallax between adjacent pixels is a value set in advance.
  • the combining module 8024 is configured to combine the disparity values of each pixel in the first image to obtain a disparity map.
  • the virtual view synthesizing unit 803 is configured to synthesize the disparity map obtained by the disparity processing unit 802 and the first image acquired by the acquiring unit 801, and synthesize a virtual view having the same viewing angle as the second image.
  • the gradation extraction unit 804 is configured to obtain a second grayscale image according to the second image acquired by the acquiring unit 801, and obtain a virtual view grayscale image according to the virtual view synthesized by the virtual view unit 803.
  • the grayscale extracting unit 804 is specifically configured to acquire a virtual view grayscale image marked with a hole pixel according to the virtual view marked with the hole pixel.
  • the high dynamic range fusion unit 805 is configured to obtain a high dynamic range grayscale image by using a high dynamic range synthesis algorithm according to the second grayscale image and the virtual view grayscale image obtained by the grayscale extraction unit 804.
  • the high dynamic range fusion unit 805 is specifically configured to obtain a high dynamic range grayscale image marked with a hole pixel by using a high dynamic range synthesis algorithm according to the second grayscale image and the virtual view grayscale image marked with the hole pixel. .
  • the color interpolation unit 806 is configured to obtain a high dynamic range image according to the high dynamic range grayscale image, the second grayscale image, the virtual view grayscale image, the second image, and the virtual view.
  • color interpolation unit 806 is specifically configured to sequentially use the formula
  • the red component values I red (e), the green component values I green (e), and the blue component values I blue (e) of each pixel in the high dynamic range image are obtained.
  • e represents a pixel e in a high dynamic range image
  • I grey (e) represents the pixel value of the pixel corresponding to the pixel e in the high dynamic range gray scale image, a pixel value indicating a pixel corresponding to the pixel e in the second grayscale image, a pixel value representing a pixel corresponding to the pixel e in the virtual view grayscale image; and Representing a red component value, a green component value, and a blue component value of a pixel corresponding to the pixel e in the second image; and The red component value, the green component value, and the blue component value of the pixel corresponding to the pixel e in the virtual view are respectively indicated.
  • the color interpolation unit 806 is specifically configured to acquire pixel values of each pixel in the high dynamic range image according to the red component value, the green component value, and the blue component value of each pixel in the high dynamic range image.
  • the color interpolation unit 806 is specifically configured to combine the pixel values of each pixel in the high dynamic range image to obtain a high dynamic range image.
  • the color interpolation unit 806 is specifically configured to: according to the high dynamic range grayscale image marked with the hole pixel, the second grayscale image, the virtual view grayscale image marked with the hole pixel, the second image, and the pixel marked with the hole pixel A virtual view that yields a high dynamic range image labeled with hole pixels.
  • the high dynamic range image synthesizing device further includes: a hole pixel processing unit 807.
  • the hole pixel processing unit 807 is configured to mark the noise pixel or the occlusion area in the virtual view as a hole pixel.
  • the occlusion region is an area generated by the angle at which the first image and the second image are captured by the same object; the noise pixel is generated by a pixel whose erroneous calculation is incorrect in the disparity map.
  • the hole pixel processing unit 807 is specifically configured to determine at least two second pixels in the second image.
  • the second pixel refers to a pixel having the same pixel value.
  • the hole pixel processing unit 807 is specifically configured to obtain at least two marked pixels in the virtual view according to at least two second pixels in the second image.
  • the at least two marked pixels in the virtual view are pixels respectively corresponding to at least two second pixels in the second image in the virtual view.
  • the hole pixel processing unit 807 is specifically configured to acquire an average pixel value of at least two marked pixels in the virtual view.
  • the hole pixel processing unit 807 is specifically configured to sequentially determine whether a difference between a pixel value and an average pixel value of each of the at least two marked pixels in the virtual view is greater than a noise threshold.
  • the noise threshold is a value that is set in advance to determine noise.
  • the hole pixel processing unit 807 is specifically configured to determine the marked pixel as a noise pixel and mark the noise pixel as a hole pixel if the difference between the pixel value of the marked pixel and the average pixel value is greater than the noise threshold.
  • the hole pixel processing unit 807 is further configured to determine, in the second image, the first pixel corresponding to each hole pixel in the high dynamic range image marked with the hole pixel.
  • the hole pixel processing unit 807 is further configured to acquire a similarity coefficient between adjacent pixels of each hole pixel in the high dynamic range image and adjacent pixels of the first pixel; and obtain high dynamics according to the similarity coefficient and the first pixel A pixel value of each hole pixel in at least one of the hole pixels in the range image.
  • the hole pixel processing unit 807 acquires adjacent pixels of each hole pixel in the high dynamic range image, and the similarity coefficient between the adjacent pixels of the first pixel may have the following three methods:
  • the first method, the hole pixel processing unit 807, is specifically used according to the formula
  • a similarity coefficient between adjacent pixels of any one of the hole pixels r in the high dynamic range image and adjacent pixels of the first pixel is obtained.
  • s represents one of the neighborhoods ⁇ r of the pixel r in the high dynamic range image
  • I(s) represents the pixel value of the pixel s
  • I 2 (s) represents the pixel corresponding to the pixel s in the second image
  • the pixel value; rs represents the distance between the pixel r and the pixel s; ⁇ is a predetermined weighting coefficient indicating the distance between the pixel r and the pixel s.
  • the second method, the hole pixel processing unit 807, is specifically used according to the formula
  • a similarity coefficient between adjacent pixels of any one of the hole pixels r in the high dynamic range image and adjacent pixels of the first pixel is obtained.
  • the first proportional coefficient ⁇ 1 and the second proportional coefficient ⁇ 2 are preset values; s represents one of the neighborhood ⁇ r of the pixel r in the high dynamic range image; A represents a high dynamic range image; n represents the similarity coefficient obtained when the pixel value of the hole pixel is first calculated.
  • the hole pixel processing unit 807 is specifically configured to determine whether the hole pixel r has a first hole pixel; in the case where the first hole pixel is determined, the similarity coefficient of the first hole pixel is used as the similarity of the hole pixel r coefficient.
  • the first hole pixel is a hole pixel of the adjacent hole pixel of the hole pixel r that has obtained the pixel value.
  • the hole pixel processing unit 807 is specifically configured according to a formula The pixel value of the hole pixel r is obtained.
  • I(r) represents the pixel value of the hole pixel r
  • I 2 (r) represents the pixel value of the pixel corresponding to the hole pixel r in the second image
  • a n represents the similarity coefficient of the hole pixel r
  • n 0, 1, ... N
  • N is a preset value.
  • a high dynamic range image synthesizing device first obtains a first image and a second image with different exposure degrees, and then performs binocular stereo matching on the first image and the second image to obtain a disparity map, and then according to Forming a parallax map and the first image, synthesizing a virtual view having the same viewing angle as the second image, and then acquiring the second grayscale image according to the second image, and acquiring the virtual view grayscale image according to the virtual view, and according to the second grayscale image and
  • the virtual view gray image is obtained by the high dynamic range synthesis algorithm to obtain a high dynamic range gray image, and finally obtained according to the high dynamic range gray image, the second gray image, the virtual view gray image, the second image, and the virtual view.
  • a high dynamic range image in the process of acquiring a high dynamic range image, the occlusion area and the noise pixel having a large influence on the picture are marked as hole pixels, and finally the adjacent pixels passing through the hole pixel correspond to the hole pixels in the second image.
  • the relationship between adjacent pixels of the pixel, and the pixel between the hole and the corresponding pixel in the second image is estimated Relationship, and then find the pixel values of the pixels of the hole. In this way, since the relationship between adjacent pixels is considered in the virtual view synthesis, and the occlusion area and the noise pixels are further processed, the quality of the high dynamic range image is improved.
  • FIG. 11 is a schematic diagram of functions of a device according to an embodiment of the present invention.
  • the device includes an acquisition unit 1101, a calculation unit 1102, a determination unit 1103, and a processing unit 1104.
  • the acquiring unit 1101 is configured to acquire the first image and the second image.
  • first image and the second image are simultaneously captured by the same object
  • the obtaining unit 1101 is further configured to acquire a candidate disparity value set of each pixel of the first image.
  • the candidate disparity value set includes at least two candidate disparity values.
  • the calculating unit 1102 is configured to obtain a first image according to each pixel of the first image, a pixel in the second image corresponding to each pixel of the first image, and a candidate disparity value set of each pixel of the first image.
  • p represents a pixel p, which is a pixel of a first image corresponding to the candidate disparity value set;
  • k The total number of candidate disparity values in the candidate disparity value set for pixel p.
  • the calculating unit 1102 obtains the matching energy E(p,d i ) of each candidate disparity value in each candidate disparity value set of each pixel of the first image by the following two methods:
  • the first method, the calculating unit 1102 is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the value of the first fitting parameter a and the value of the second fitting parameter b correspond to a value corresponding to the minimum value of the matching energy E d (p, d i );
  • w(p, q, d i ) w c (p,q,d i )w s (p,q,d i )w d (p,q,d i );
  • the first pixel block ⁇ p represents a pixel block containing the pixel p in the first image;
  • p and q is a pixel adjacent to the pixel belonging to the first block of pixels [Omega] p;
  • I 1 (q) denotes a pixel value of a pixel of q;
  • I 2 (qd i) represents the second pixel corresponding to a pixel q qd i
  • w c (p, q, d i ) represents the pixel weight value;
  • the pixel weight value w c (p, q, d i ) can be according to a formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I 1 (p) represents a pixel value of the pixel p
  • I 2 (pd i ) represents a pixel value of the pixel pd i in the second image corresponding to the pixel p
  • the first weighting coefficient ⁇ 1 and the second weighting coefficient ⁇ 2 The third weighting factor ⁇ 3 and the fourth weighting factor ⁇ 4 are preset values.
  • the second method, the calculating unit 1102 is specifically configured to use a formula according to each candidate disparity value in the candidate disparity set of the pixel p
  • the pixel weight value w c (p, q, d i ) can be based on the formula
  • the distance weight value w s (p, q, d i ) can be based on the formula
  • the parallax weight value w d (p, q, d i ) can be based on the formula
  • I' 1 (p) I 1 (p)cos ⁇ -I 2 (pd i )sin ⁇ ;
  • I' 2 (pd i ) I 1 (p) sin ⁇ -I 2 (pd i )cos ⁇ ;
  • the adjustment angle ⁇ is a value that is set to be greater than 0° and less than 90° in advance.
  • a determining unit 1104 configured to obtain a view of each pixel in the first image according to a matching energy E d (p, d i ) of each candidate disparity value in each candidate disparity value set of each pixel of the first image. Difference.
  • determining unit 1104 is specifically configured according to a formula
  • the candidate disparity value of each pixel in the corresponding first image is determined as The disparity value of each pixel.
  • I represents a first image
  • the second pixel block N p represents a pixel block containing pixels p in the first image
  • V p,q (d i ,d j ) ⁇ min(
  • m is the total number of candidate disparity values in the candidate disparity value set of the pixel q;
  • the smoothing coefficient ⁇ is a value set in advance; the maximum value V max of the difference in parallax between adjacent pixels is a value set in advance.
  • the processing unit 1105 is configured to combine the disparity values of each pixel in the first image to obtain a disparity map.
  • An embodiment of the present invention provides an apparatus for acquiring a first image and a second image, and acquiring a candidate disparity value set of each pixel of the first image, and then, according to each pixel of the first image, and the first image.
  • Acquiring a pixel in the second image corresponding to each pixel, and a candidate disparity value set of each pixel of the first image acquiring each candidate disparity value in the candidate disparity value set of each pixel of the first image Matching the energy E(p,d i ), and then acquiring the first image according to the matching energy E d (p,d i ) of each of the candidate disparity values of each pixel of the first image
  • the disparity value of each pixel is finally combined to obtain the disparity map by combining the disparity values of each pixel in the first image, so that the final disparity value is obtained when calculating the disparity value of each pixel.
  • the error between the disparity value and the disparity value is greatly reduced, thereby improving the quality of the high dynamic range image
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or Not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional units described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, and the program code can be stored. Medium.

Abstract

一种高动态范围图像合成的方法及装置,涉及图像处理领域,用以改善高动态范围图像的质量。所述方法,包括:获取第一图像与第二图像;对所述第一图像与所述第二图像进行双目立体匹配,得到视差图;根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图;根据第二图像得到第二灰度图像,并根据虚拟视图得到虚拟视图灰度图像;根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图;根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,得到高动态范围图像。适用于高动态范围图像合成的场景。

Description

一种高动态范围图像合成的方法及装置
本申请要求于2014年03月18日提交中国专利局、申请号为201410101591.1、发明名称为“一种高动态范围图像合成的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及图像处理领域,尤其涉及一种高动态范围图像合成的方法及装置。
背景技术
高动态范围图像是通过调节相机的曝光时间,对同一个场景进行多次不同曝光时间的拍摄,并通过图像合成技术,把多幅不同曝光时间的图像进行融合获取的图像。其中,长时间曝光的图像有清晰的暗区域的细节,短时间曝光的图像有清晰的亮区域的细节。相比普通的图像,高动态范围图像可以提供更多的动态范围和图像细节,能够更好的反映真实环境。
现有的高动态范围图像合成技术主要分为两类:第一类是单相机高动态范围图像合成;第二类是多相机高动态范围图像合成。
在多相机高动态范围图像合成技术中,首先多个相机利用不同曝光时间对同一物体同时拍摄获得多个图像,然后从所述多个图像中选取两个图像,接着,根据所述两个图像的对应点之间的关系,获取所述两个图像的视差图,进而,根据所述视差图及所述两张照片,将两张图像中的一个图像合成到另一图像的视角的虚拟图像,最后,根据所述虚拟图像与所述另一视角的图像获得最终的高动态范围图像。
在实现上述多相机高动态范围图像合成的过程中,发明人发现现有技术中至少存在如下问题:由于在曝光比较大的情况下,获取视差图时对过暗及过亮区域的深度提取不够准确,会对最终的高动 态范围图像带来噪声,并且由于现有技术中在进行虚拟图像合成时,只利用了当前图像的邻域信息进行插值进而导致了高动态范围图像存在色差,进一步影响了高动态范围图像的质量。
发明内容
本发明的实施例提供一种高动态范围图像合成的方法及装置,用以改善高动态范围图像的质量。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,本发明实施例提供了一种高动态范围图像合成的方法,包括:获取第一图像与第二图像;所述第一图像与所述第二图像是采用不同曝光度对同一物体同时拍摄得到的;对所述第一图像与所述第二图像进行双目立体匹配,得到视差图;根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图;根据所述第二图像得到第二灰度图像,并根据所述虚拟视图得到虚拟视图灰度图像;根据所述第二灰度图像及所述虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图;根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像。
在第一方面的第一种可能的实现方式中,所述方法还包括:在所述根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图时,将所述虚拟视图中的遮挡区域的像素标记为孔洞像素;所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域;或者,在所述根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图之后,在所述根据所述第二图像得到第二灰度图像,并根据所述虚拟视图得到虚拟视图灰度图像之前,所述方法还包括:将所述虚拟视图中的噪声像素或所述遮挡区域标记为孔洞像素;所述噪声像素是由所述视差图中视差值计算错误的像素产生的;所述根据所述虚拟视图得到虚拟视图灰度图像包括:根据标记有孔洞像素的虚拟视图得到标记有孔洞像素的虚拟视图灰度图像;所述根据所述第二灰度图像及所 述虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图包括:根据所述第二灰度图像及所述标记有孔洞像素的虚拟视图灰度图像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图;所述根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像包括:根据所述标记有孔洞像素的高动态范围灰度图、所述第二灰度图像、所述标记有孔洞像素的虚拟视图灰度图像、所述第二图像以及所述标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像;在所述根据所述高动态范围灰度图、所述第二图像及所述虚拟视图灰度图像,得到高动态范围图像之后,所述方法还包括:在所述第二图像中,确定所述标记有孔洞像素的高动态范围图像中每个孔洞像素对应的第一像素;获取所述高动态范围图像中每个孔洞像素的相邻像素,与所述第一像素的相邻像素间的相似系数;并根据所述相似性系数及所述第一像素,得到所述高动态范围图像中每个孔洞像素的像素值。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述对所述第一图像与所述第二图像进行双目立体匹配,得到视差图包括:获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p的候选视差值集合中候选视差值的总数;根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),获取所述第一图像中每一像素的视差值;将所述第一图像中的每个像素的视差值进行组合获取所述视差图。
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000001
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
结合第一方面的第二种可能的实现方式,在第一方面的第五种可能的实现方式中,所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000002
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
所述调整角度θ是预先设定大于0°且小于90°的值。
结合第一方面的第二至第五任一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值包括:根据公式
Figure PCTCN2014089071-appb-000003
求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
结合第一方面或第一方面的第一至第六任一种可能的实现方式,在第一方面的第七种可能的实现方式中,所述根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,获取高动态范围图像包括:依次利用公式
Figure PCTCN2014089071-appb-000004
Figure PCTCN2014089071-appb-000005
Figure PCTCN2014089071-appb-000006
求得所述高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e);其中,所述e表示所述高动态范围图像中的像素e;所述
Figure PCTCN2014089071-appb-000007
Igrey(e)表示在所述高动态范围灰度图中与所述像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000008
表示在所述第二灰度图像中与所述像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000009
表示在所述虚拟视图灰度图像中与所述像素e对应的像素的像素值;所述
Figure PCTCN2014089071-appb-000010
所述
Figure PCTCN2014089071-appb-000011
及所述
Figure PCTCN2014089071-appb-000012
分别表示在所述第二图像中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;所述
Figure PCTCN2014089071-appb-000013
所述
Figure PCTCN2014089071-appb-000014
及所述
Figure PCTCN2014089071-appb-000015
分别表示在所述虚拟视图中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;根据所述高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,获取所述高动态范围图像中的每个像素的像素值;将所述高动态范 围图像中的每个像素的像素值组合获取所述高动态范围图像。
结合第一方面的第一至第七任一种可能的实现方式,在第一方面的第八种可能的实现方式中,所述将所述虚拟视图中的噪声像素标记为孔洞像素包括:在所述第二图像中,确定出至少两个第二像素;所述第二像素是指像素值相同的像素;根据所述第二图像中的所述至少两个第二像素,得到所述虚拟视图中的至少两个标记像素;所述虚拟视图中的至少两个标记像素是在所述虚拟视图中,与所述第二图像中的所述至少两个第二像素分别对应的像素;获取所述虚拟视图中的至少两个标记像素的平均像素值;依次确定所述虚拟视图中的至少两个标记像素中每一个标记像素的像素值与所述平均像素值之间的差值是否大于所述噪声门限值;若所述标记像素的像素值与所述平均像素值之间的差值大于所述噪声门限值,则将所述标记像素确定为噪声像素,并将所述噪声像素标记为孔洞像素。
结合第一方面的第一至第八任一种可能的实现方式,在第一方面的第九种可能的实现方式中,对于根据所述高动态范围图像中任一孔洞像素r的相似系数及所述第一像素,得到所述孔洞像素r的像素值包括:根据公式
Figure PCTCN2014089071-appb-000016
得到所述孔洞像素r的像素值;其中,所述I(r)表示所述孔洞像素r的像素值;所述I2(r)表示在所述第二图像中与所述孔洞像素r对应的像素的像素值;所述an表示所述孔洞像素r的相似系数;所述n=0,1,......N;所述N为预先设定的值。
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现方式中,对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:根据公式
Figure PCTCN2014089071-appb-000017
Figure PCTCN2014089071-appb-000018
得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,所述s表示所述高动态范围图像中所述像素r的邻域Ψr中的一个像素;所述I(s)表示所述像素s的像素值;所述I2(s)表示在所述第二图像中与所述像素s对应的像素的像素值;所述r-s表示所述像素r与所述像素s间的距离;所述γ是预先设定的,表示所述像素r与所述像素s间的距离的权重系数。
结合第一方面的第九种可能的实现方式,在第一方面的第十一种可能的实现方式中,对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:根据公式
Figure PCTCN2014089071-appb-000019
得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;所述s表示所述高动态范围图像中所述像素r的邻域Φr中的一个像素;所述A表示所述高动态范围图像;所述a′n表示在第一次计算孔洞像素的像素值时获取的相似系数。
结合第一方面的第九种可能的实现方式,在第一方面的第十二种可能的实现方式中,对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:确定所述孔洞像素r是否有第一孔洞像素;所述第一孔洞像素是所述孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素;若确定 有所述第一孔洞像素,则将所述第一孔洞像素的相似系数作为所述孔洞像素r的相似系数。
第二方面,本发明实施例提供了一种合成视差图的方法,包括:获取第一图像与第二图像;所述第一图像与所述第二图像是对同一物体同时拍摄得到的;获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p的候选视差值集合中候选视差值的总数;根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值;将所述第一图像中的每个像素的视差值进行组合获取所述视差图。
在第二方面的第一种可能的实现方式中,所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000020
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述 w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
结合第二方面,在第二方面的第三种可能的实现方式中,所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000021
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
所述调整角度θ是预先设定大于0°且小于90°的值。
结合第二方面或第二方面的第一至第三任一种可能的实现方式,在第二方面的第四种可能的实现方式中,所述根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值包括:根据公式
Figure PCTCN2014089071-appb-000022
求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
第三方面,本发明实施例提供了一种高动态范围图像合成设备,包括:获取单元,用于获取第一图像与第二图像;所述第一图像与所述第二图像是采用不同曝光度对同一物体同时拍摄得到的;视差 处理单元,用于对所述获取单元获取的所述第一图像与所述第二图像进行双目立体匹配,得到视差图;虚拟视图合成单元,用于根据所述视差处理单元得到的所述视差图与所述获取单元获取的所述第一图像,合成与所述第二图像有相同视角的虚拟视图;灰度提取单元,用于根据所述获取单元获取的所述第二图像得到第二灰度图像,并根据所述虚拟视图单元合成的所述虚拟视图得到虚拟视图灰度图像;高动态范围融合单元,用于根据所述灰度提取单元得到的所述第二灰度图像及所述虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图;颜色插值单元,用于根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像。
在第三方面的第一种可能的实现方式中,还包括:孔洞像素处理单元:所述孔洞像素处理单元,用于将所述虚拟视图中的噪声像素或所述遮挡区域标记为孔洞像素;所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域;所述噪声像素是由所述视差图中视差值计算错误的像素产生的;所述灰度提取单元,具体用于根据标记有孔洞像素的虚拟视图得到标记有孔洞像素的虚拟视图灰度图像;所述高动态范围融合单元,具体用于根据所述第二灰度图像及所述标记有孔洞像素的虚拟视图灰度图像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图;所述颜色插值单元,具体用于根据所述标记有孔洞像素的高动态范围灰度图、所述第二灰度图像、所述标记有孔洞像素的虚拟视图灰度图像、所述第二图像以及所述标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像;所述孔洞像素处理单元,还用于在所述第二图像中,确定所述标记有孔洞像素的高动态范围图像中每个孔洞像素对应的第一像素;所述孔洞像素处理单元,还用于获取所述高动态范围图像中每个孔洞像素的相邻像素,与所述第一像素的相邻像素间的相似系数;并根据所述相似性系数及所述第一像素,得到所述高动态范围图像中每个孔洞像素的像素值。
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述视差处理单元包括:获取模块、计算模块、确定模块、组合模块;所述获取模块,用于获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;所述计算模块,用于根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量;其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p的候选视差值集合中候选视差值的总数;所述确定模块,用于根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量,得到所述第一图像中每一像素的视差值;所述组合模块,用于将所述第一图像中的每个像素的视差值进行组合得到所述视差图。
结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,所述计算模块,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000023
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距 离权重值;所述wd(p,q,di)表示视差权重值。
结合第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
结合第三方面的第二种可能的实现方式,在第三方面的第五种可能的实现方式中,所述计算模块,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000024
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
所述调整角度θ是预先设定大于0°且小于90°的值。
结合第三方面的第二至第五任一种可能的实现方式,在第三方面的第六种可能的实现方式中,所述确定模块,具体用于根据公式
Figure PCTCN2014089071-appb-000025
求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
结合第三方面或第三方面的第一至第六任一种可能的实现方式,在第三方面的第七种可能的实现方式中,所述颜色插值单元,具体用于依次利用公式
Figure PCTCN2014089071-appb-000026
Figure PCTCN2014089071-appb-000027
Figure PCTCN2014089071-appb-000028
求得所述高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e);其中,所述e表示所述高动态范围图像中的像素e;所述
Figure PCTCN2014089071-appb-000029
Igrey(e)表示在所述高动态范围灰度图中与像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000030
表示在所述第二灰度图像中与所述像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000031
表示在所述虚拟视图灰度图像中与所述像素e对应的像素的像素值;所述
Figure PCTCN2014089071-appb-000032
所述
Figure PCTCN2014089071-appb-000033
及所述
Figure PCTCN2014089071-appb-000034
分别表示在所述第二图像中与像素e对应的 像素的红色分量值、绿色分量值及蓝色分量值;所述
Figure PCTCN2014089071-appb-000035
所述
Figure PCTCN2014089071-appb-000036
及所述
Figure PCTCN2014089071-appb-000037
分别表示在所述虚拟视图中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;所述颜色插值单元,具体用于根据所述高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,获取所述高动态范围图像中的每个像素的像素值;所述颜色插值单元,具体用于将所述高动态范围图像中的每个像素的像素值组合获取所述高动态范围图像。
结合第三方面的第一至七任一种可能的实现方式,在第三方面的第八种可能的实现方式中,所述孔洞像素处理单元,具体用于在所述第二图像中,确定出至少两个第二像素;所述第二像素是指像素值相同的像素;所述孔洞像素处理单元,具体用于根据所述第二图像中的所述至少两个第二像素,得到所述虚拟视图中的至少两个标记像素;所述虚拟视图中的至少两个标记像素是在所述虚拟视图中,与所述第二图像中的所述至少两个第二像素分别对应的像素;所述孔洞像素处理单元,具体用于获取所述虚拟视图中的至少两个标记像素的平均像素值;所述孔洞像素处理单元,具体用于依次确定所述虚拟视图中的至少两个标记像素中每一个标记像素的像素值与所述平均像素值之间的差值是否大于所述噪声门限值;所述噪声门限值是预先设定的用于判断噪声的值;所述孔洞像素处理单元,具体用于在所述标记像素的像素值与所述平均像素值之间的差值大于所述噪声门限值的情况下,将所述标记像素确定为噪声像素,并将所述噪声像素标记为孔洞像素。
结合第三方面的第一至八任一种可能的实现方式,在第三方面的第九种可能的实现方式中,所述孔洞像素处理单元,具体用于根据公式
Figure PCTCN2014089071-appb-000038
得到所述孔洞像素r的像素值;其中,所述I(r)表示所述孔洞像素r的像素值;所述I2(r)表示在所述第二图像中与所述孔洞像素r对应的像素的像素值;所述an表示所述孔洞像素r的相似系数;所述n=0,1,......N;所述N为预先设定的值。
结合第三方面的第九种可能的实现方式,在第三方面的第十种 可能的实现方式中,所述孔洞像素处理单元,具体用于根据公式
Figure PCTCN2014089071-appb-000039
得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,所述s表示所述高动态范围图像中所述像素r的邻域Ψr中的一个像素;所述I(s)表示所述像素s的像素值;所述I2(s)表示在所述第二图像中与所述像素s对应的像素的像素值;所述r-s表示所述像素r与所述像素s间的距离;所述γ是预先设定的,表示所述像素r与所述像素s间的距离的权重系数。
结合第三方面的第九种可能的实现方式,在第三方面的第十一种可能的实现方式中,所述孔洞像素处理单元,具体用于根据公式
Figure PCTCN2014089071-appb-000040
得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;所述s表示所述高动态范围图像中所述像素r的邻域Φr中的一个像素;所述A表示所述高动态范围图像;所述a′n表示在第一次计算孔洞像素的像素值时获取的相似系数。
结合第三方面的第九种可能的实现方式,在第三方面的第十二种可能的实现方式中,所述孔洞像素处理单元,具体用于确定所述孔洞像素r是否有第一孔洞像素;所述第一孔洞像素是所述孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素;所述孔洞像素处理单元,具体用于在确定有所述第一孔洞像素的情况下,将所述第 一孔洞像素的相似系数作为所述孔洞像素r的相似系数。
第四方面,本发明实施例提供了一种设备,包括:获取单元,用于获取第一图像与第二图像;所述第一图像与所述第二图像是对同一物体同时拍摄得到的;所述获取单元,还用于获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;计算单元,用于根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p的候选视差值集合中候选视差值的总数;所述确定单元,用于根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值;处理单元,用于将所述第一图像中的每个像素的视差值进行组合获取所述视差图。
在第四方面的第一种可能的实现中,所述计算单元,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000041
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素 q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
结合第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
结合第四方面,在第四方面的第三种可能的实现方式中,所述计算单元,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000042
求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
所述调整角度θ是预先设定大于0°且小于90°的值。
结合第四方面或第四方面的第一至三任一种可能的实现方式,在第四方面的第四种可能的实现方式中,所述确定单元,具体用于根据公式
Figure PCTCN2014089071-appb-000043
求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
本发明实施例提供的一种高动态范围图像合成的方法及装置,获取曝光度不同的第一图像与第二图像,然后对所述第一图像与所述第二图像进行双目立体匹配,得到视差图,接着根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图,继而根据所述第二图像获取第二灰度图像,并根据所述虚拟视图获取虚拟视图灰度图像,并根据所述第二灰度图像及所述虚拟视图灰度图像,通过高动态范围合成算法,获取高动态范围灰度图,最终根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,获取高动态范围图像,这样,由于在进行虚拟视图合成时考虑了相邻像素之间的关系,从而提高了高动态范围图像的质量。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种高动态范围图像合成的方法的流程示意图;
图2为本发明实施例提供的一种映射曲线示意图;
图3为本发明实施例提供的一种坐标系旋转示意图;
图4为本发明实施例提供的一种不同立体匹配算法的错误率示意图;
图5为本发明实施例提供的另一种高动态范围图像合成的方法的流程示意图;
图6为本发明实施例提供的一种确定噪声像素的示意图;
图7为本发明实施例提供的一种合成视差图的方法的流程示意图;
图8为本发明实施例提供的一种高动态范围图像合成设备的功能示意图;
图9为图8所示的高动态范围图像合成设备的视差处理单元的功能示意图;
图10为本发明实施例提供的另一种高动态范围图像合成设备的功能示意图;
图11为本发明实施例提供的一种设备的功能示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种高动态范围图像合成的方法,如图1所示,包括:
101、获取第一图像与第二图像。
其中,第一图像与第二图像是采用不同曝光度对同一物体同时拍摄得到的。
需要说明的是,第一图像与第二图像间有重叠区域。
需要说明的是,第一图像和第二图像是经过矫正后的图像,第一图像与第二图像之间只有水平方向或者垂直方向的位移。
需要说明的是,对于第一图像与第二图像间的曝光度的大小,可以是第一图像的曝光度大于第二图像是的曝光度,也可以是第二图像的曝光度大于第一图像的曝光度。对于第一图像与第二图像将曝光度具体的大小,本发明对此不做限制。
102、对所述第一图像与所述第二图像进行双目立体匹配,得到视差图。
需要说明的是,双目立体匹配就是从两个视角观察同一物体的图像中,匹配出对应的像素,从而计算出视差并获得物体三维信息的过程。
具体的,对第一图像与第二图像进行双目立体匹配得到视差图的方法,可以用现有技术中任一种获取两幅图像的视差图的方法,例如WSAD(Weighted Sum of Absolute Differences,加权绝对差值和算法)、ANCC(Adaptive Normalized Cross-Correlation,自适应归一化互相关算法)等,还可以是本发明提出的方法。
本发明提出的双目立体匹配算法具体如下所示,包括:
S1、获取第一图像的每个像素的候选视差值集合。
其中,候选视差值集合中包含至少两个候选视差值。
需要说明的是,候选视差值对应三维空间中的深度。由于深度有一定的范围,因此候选视差值也有一定的范围。这个范围中的每一个值均为视差候选值,这些候选视差值共同组成一个像素的候选视差值集合。
需要说明的是,第一图像中每一个像素的候选视差值集合中的候选视差值可以相同,也可以不相同。本发明对此不做限制。
S2、根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,得到第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)。
其中,p表示像素p,是与候选视差值集合对应的第一图像的像素。di表示像素p的第i个候选视差值,i=1,......,k。k为像素p的候选视差值集合中候选视差值的总数。
需要说明的是,由于每一个像素的候选视差值集合中包含至少两个候选视差值,所以,k≥2。
进一步的,本发明提出了两种计算匹配能量Ed(p,di)的方法,如下所示:
第一种方法:根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000044
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,第一拟合参数a的值与第二拟合参数b的值为使匹配能量Ed(p,di)为最小值时对应的值。w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di)。第一像素块Ωp表示第一图像中包含像素p的一个像素块。像素q是与像素p相邻的属于第一像素块Ωp中的像素。I1(q)表示像素q的像素值。I2(q-di)表示像素q对应的第二图像中的像素q-di的像素值。wc(p,q,di)表示像素权重值;ws(p,q,di)表示距离权重值;wd(p,q,di)表示视差权重值。
进一步的,像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,I1(p)表示像素p的像素值;I2(p-di)表示像素p对应的第二图像中的像素p-di的像素值;第一权重系数β1、第二权重系数β2、第三权重系数β3及第四权重系数β4是预先设定的值。
需要说明的是,将像素权重值wc(p,q,di)、距离权重值ws(p,q,di)以及视差权重值wd(p,q,di)的计算公式代入,获取w(p,q,di)=exp[-(β23)×(p-q)2-(β14)×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]。可以根据经验将β23的值设为0.040,β14的值设为0.033。
需要说明的是,第一像素块Ωp表示第一图像中包含像素p的一个像素块。第一像素块可以是以像素p的3邻域,还可以是以像素p的4邻域,第一像素块可以是以像素p为中心,也可以不以像素p为中心,对于第一像素块的具体大小与像素p在第一像素块中的具体位置,本发明不做限制。
需要说明的是,第一像素块包含的区域越大,也就是像素q的取值越多,计算出的结果与实际的结果相差越小。
需要说明的是,当两幅图片已经被拍摄后,两幅图像中相对应点的像素值间的关系有对应关系,在这里假设用一个平滑的映射函数表示通过一幅图像中任意一个像素值求相对应的另一幅图像中像素的像素值之间的关系。本发明实施例中选取直线方程
I1(f)=a×I2(g)+b表示该应设函数。其中,I2(j)表示第二图像中的任意一个像素j的像素值,I1(f)表示第一图像中与第二图像中像素j对应的像素f的像素值,a和b是随着像素位置变化而变化的拟合参数。也就是说,对于不同的像素来说,第一拟合参数a与第二拟合参数b也是不同的。
需要说明的是,由于根据上述公式计算时需要确定第二图像中每一个像素对应的第二图像中的匹配点,为了便于计算可以用f-d 表示第一图像中任一像素f在第二图形中对应的像素,此时,d表示第一图像中任一像素f的相对于第二图像的响应像素间的视差值。需要说明的是,由于此时第一图像中的像素与第二图像中与其对应的相应像素之间的时间视差值未知,所以用候选视差值近似表示实际视差值。
需要说明的是,在此为第一图像中的每一个像素设定了多个候选视差值,每一个像素的候选视差值集合组成该像素的候选视差值集合,然后选取出该像素的候选视差值集合中候选视差值与实际视差值相差最小的候选视差值,作为计算出的该像素的视差值。也就是说,本发明实施例中计算得出的像素的视差值不是该像素的实际视差值,而是该像素的候选视差值集合中与实际视差值近似的一个值。
需要说明的是,本发明实施例中用
像素值权重
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|],
表示第一图像中的像素p与像素q的颜色越接近,像素值权重越大;
距离权重
ws(p,q,di)=exp[-β2×(p-q)2],
表示第一图像中的像素p与像素q的实际距离越接近,距离权重越大;
视差值权重
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|],
表示第一图像中的像素p与像素q的视差值越接近,视差值权重越大。
需要说明的是,如图2所示,图中表示对于过亮区域和过暗区域中,对于同一个位置,第一图像中的一个像素对应第二图像中的一个像素,将第二图像中的像素值作为横轴,第一图像中的像素值作为纵轴,并将位于同一位置的像素的像素值映射到图中,就得到 图3下半部分中点阵,并对点阵所形成的映射曲线做两条切线,n和m。从图中可以看出当切线的斜率较大的时候,映射曲线更容易被噪声影响。为了降低这种影响,可以将图2中的坐标系逆时针旋转0-90°,得到图3,在图2坐标系里切线n是一条斜率为tanα的直线。由于坐标系逆时针旋转了θ,切线n在新坐标系中的斜率减小为tan(α-θ)。
示例性的,如果切线n在原先的坐标轴中斜率过大,比如α≈90°。假设新坐标轴旋转了45°,则切线n在新坐标轴的斜率大大减小,变为tan(α-45°)≈1。
进一步的,在第一种方法上优化得到第二种方法:
根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000045
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
调整角度θ是预先设定大于0°且小于90°的值。
需要说明的是,由于调整角度θ是大于0°且小于90°的值,所以 cosθ与sinθ的值介于0到1之间。
需要说明的是,
像素值权重wc(p,q,di)=exp[-β1×|I′1(p)-I1(q)|×|I′2(p-di)-I′2(q-di)|],
表示第一图像中的像素p与像素q的颜色越接近,像素值权重越大;
距离权重
ws(p,q,di)=exp[-β2×(p-q)2],
表示第一图像中的像素p与像素q的实际距离越接近,距离权重越大;
视差值权重
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I1(q)|×|I′2(p-di)-I′2(q-di)|],
表示第一图像中的像素p与像素q的视差值越接近,视差值权重越大。
S3、根据第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到第一图像中每一像素的视差值。
进一步的,根据公式
Figure PCTCN2014089071-appb-000046
求出将使像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的第一图像中每一个像素的候选视差值确定为每一个像素的视差值。
其中,I表示第一图像;第二像素块Np表示第一图像中包含像素p的一个像素块;Vp,q(di,dj)=λ×min(|di-dj|,Vmax);dj表示像素q的第j个候选视差值,j=1,......,m;m为像素q的候选视差值集合中候选视差值的总数;平滑系数λ是预先设定的值;相邻像素视差之差最大值Vmax是预先设定的值。
需要说明的是,候选能量包含了两个方面,第一方面是第一图像中每一个像素的匹配能量之和,第二个方面是第一图像中每一个像素平滑能量Vp,q(di,di)之和。
需要说明的是,第二像素块Np可以与第一像素块相同,也可以与第一像素块不同,本发明对此不做限制。
需要说明的是,公式min(x,y)表示取x和y中较小值的函数。min(|di-dj|,Vmax)表示取值为第一图像中像素p的候选视差值di与像素q的候选视差值间的差值和预设的相邻像素间的时差最大值中较小的值。其中,Vmax为一个预先定义的一个截断值,目的是防止平滑能量过大,从而影响前景与背景边缘的视差的准确赋值。
需要说明的是,候选能量越小表示第一图像中与第二图像的相似性越大。也就是说,第一图像中的像素和第二图像中匹配的越好。
需要说明的是,本步骤中确定出的第一图像的每个像素的视差值是将第一图像中的每一个像素的候选视差值组合,求出的候选能量为最小值时,对应的第一图像中的每一个像素的候选视差值为该像素的视差值。从该像素的候选视差值集合中选择出的与实际视差值最接近的候选视差值。也就是说,假设第一图像中的像素有N个,且每一像素的候选视差值有M个,那么算出的候选能量值共有MN个,从MN个候选能量中选出最小值,此时,对应的各个像素的候选视差值为最终求出的各个像素的视差值。
进一步的,为了简化计算,可以用现有graph cuts(图像分割)方法快速求出第一图像中每一像素的候选视差值,此时并不需要遍历每一个像素的所有候选视差值。
S4、将第一图像中的每个像素的视差值进行组合获取视差图。
需要说明的是,视差图就是第一图像中每一个像素的视差值按照原像素的排列顺序进行排列获取的图像。
需要说明的是,分别在第一图像与第二图像的曝光度比值为16∶1,在第一图像与第二图像的曝光度比值为4∶1,以及在第一图像与第二图像的曝光度相同的情况下,将本发明实施例中提出的第一种方法、第二种方法和现有的WSAD算法和ANCC算法的错误率进行了比较。图4显示了对比结果。从图中可以看出在第一图像与第二图像的曝光度比值特别大,为16∶1时,WSAD和ANCC算法都有很 大的错误率,而本实施例提出的第一种方法和第二种方法的结果则十分准确。在其他两个曝光度比值的情况下,本实施例提出的第一种方法和第二种方法始终优于WSAD以及ANCC的结果。
需要说明的是,虽然本发明实施例中提出的第一种方法、第二种方法在计算视差图是的错误率已大大降低,但是仍然会有一小部分的像素计算出的视差值与实际视差值相差较大,所以将这些像素当做视差图中视差值计算错误的像素。
103、根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图。
需要说明的是,在已知第一图像、第二图像与第一图像与第二图像间的视差图的情况下可以合成任意角度的虚拟视图。本发明实施例中,为了后续图像处理方法的简便,利用视差图与第一图像合成了与第二图像具有相同视角的虚拟视图。
需要说明的是,可以利用现有技术通过第一图像与视差图合成与第二图像具有相同视角的虚拟视图。
具体的,本发明实施例中的第一图像与第二图像之间只有水平或者垂直方向上的位移。当第一图像与第二图像之间只有水平方向的位移时,可以利用公式
Figure PCTCN2014089071-appb-000047
求得虚拟视图中每一像素的像素值。其中,I1(x,y)表示第一图像中横坐标为x,纵坐标为y的像素的像素值,d表示第一图像中横坐标为x,纵坐标为y的像素的视差值,虚拟视图中与该像素对应的像素的像素值
Figure PCTCN2014089071-appb-000048
为第一图像中该像素沿水平方向位移为视差值d平移后的像素对应的像素值。当第一图像与第二图像之间只有垂直方向的位移时,可以利用公式
Figure PCTCN2014089071-appb-000049
求得虚拟视图中每一像素的像素值。其中,I1(x,y)表示第一图像中横坐标为x,纵坐标为y的像素的像素值,d表示第一图像中横坐标为x,纵坐标为y的像素的视差值,虚拟视图中与该像素对应的像素的像素值
Figure PCTCN2014089071-appb-000050
为第一图像中该像素沿垂直方向位移为视差值d平移后的像素对应的像素值。
104、根据第二图像得到第二灰度图像,并根据虚拟视图得到虚 拟视图灰度图像。
需要说明的是,可以利用现有技术中根据一个图像的彩色图像获取该图像的灰度图像的方法获取第二灰度图像与虚拟视图灰度图像。
需要说明的是,可以根据公式Grey=R*0.299+G*0.587+B*0.114求得彩色图像的灰度图像,也可以根据公式Grey=(R+G+B)/3求得彩色图像的灰度图像,还可以是现有技术中通过彩色图像获取灰度图像的其他方法,本发明在此不作限制。
其中,R表示彩色图像中任一像素的红色分量,G表示该像素的绿色分量,B表示该像素的蓝色分量,Grey表示灰度图中与该像素对应位置的像素的灰度。
105、根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图。
需要说明的是,所述高动态范围合成算法是指对多幅图片进行融合,得到高动态范围图像的算法。
需要说明的是,此步骤中,可以利用现有单相机高动态范围图像合成方法或者多相机高动态范围图像合成方法对第二灰度图像与虚拟视图灰度图像进行融合获取高动态范围灰度图。
需要说明的是,现有技术中是将需要合成的图像的红色、绿色以及蓝色分别进行处理,本发明实施例在利用现有技术计算高动态范围灰度图时,只需要将将需要合成的图像的灰度进行处理即可。
106、根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,得到高动态范围图像。
需要说明的是,由于上一步骤中获取的高动态范围灰度图不包含红色、绿色以及蓝色的相关信息,所以本步骤是利用有色彩的第二图像与虚拟视图,确定高动态范围灰度图中的每一个像素的红色分量值、绿色分量值以及蓝色分量值。
具体的,此步骤包括:
T1、依次利用公式
Figure PCTCN2014089071-appb-000051
Figure PCTCN2014089071-appb-000052
Figure PCTCN2014089071-appb-000053
求得高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e)。
其中,e表示高动态范围图像中的像素e;
Figure PCTCN2014089071-appb-000054
Igrey(e)表示在高动态范围灰度图中与像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000055
表示在第二灰度图像中与像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000056
表示在虚拟视图灰度图像中与像素e对应的像素的像素值;
Figure PCTCN2014089071-appb-000057
Figure PCTCN2014089071-appb-000058
Figure PCTCN2014089071-appb-000059
分别表示在第二图像中与像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;
Figure PCTCN2014089071-appb-000060
Figure PCTCN2014089071-appb-000061
分别表示在虚拟视图中与像素e对应的像素的红色分量值、绿色分量值及蓝色分量值。
需要说明的是,η(e)表示一个权重系数,用来调整在合成高动态范围图像时,利用第二图像的颜色与虚拟视图的颜色的比例。η(e)是通过第二灰度图像、虚拟视图灰度图像与高动态范围灰度图上相应像素之间的关系计算得出的值。
需要说明的是,需要是针对高动态范围图像中的每一个像素计算出各自的η(e),进而计算出每一个像素的红色分量值Ired(e)、绿色分量值Igree(e)及蓝色分量值Iblue(e)。
T2、根据高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,得到高动态范围图像中的每个像素的像素值;
需要说明的是,根据每个像素的红色分量值、绿色分量值及蓝色分量值,获取高动态范围图像中的每个像素的像素值,与现有技术中已知一个像素的红色分量值、绿色分量值及蓝色分量值,获取该像素的像素值的方法相同,本发明在此不再赘述。
T3、将高动态范围图像中的每个像素的像素值组合得到高动态范围图像。
需要说明的是,高动态范围图像是由多个像素按照排列组合而形成的,每一个像素可以用像素值表达。
本发明实施例提供的一种高动态范围图像合成的方法,首先获取曝光度不同的第一图像与第二图像,然后对第一图像与第二图像进行双目立体匹配,得到视差图,接着根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图,继而根据第二图像获取第二灰度图像,并根据虚拟视图获取虚拟视图灰度图像,并根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,获取高动态范围灰度图,最终根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,获取高动态范围图像,这样,由于在进行虚拟视图合成时考虑了相邻像素之间的关系,因此提高了高动态范围图像的质量。
本发明实施例提供的一种高动态范围图像合成的方法,如图5所示,包括:
501、获取第一图像与第二图像。
其中,第一图像与第二图像是采用不同曝光度对同一物体同时拍摄得到的。
具体的,可参考步骤101,在此不再赘述。
502、根据第一图像与第二图像,通过双目立体匹配算法,获取视差图。
具体的,可参考步骤102,在此不再赘述。
需要说明的是,将遮挡区域的像素标记为孔洞像素的时机可以是在合成虚拟视图时,也可以是合成虚拟视图之后。确定噪声像素时根据将遮挡区域的像素标记为孔洞像素的时机不同,执行不同的步骤。若在合成虚拟视图的同时将遮挡区域的像素标记为孔洞像素,则执行步骤503a-504a以及步骤505-509;若在合成虚拟视图之后确定噪声像素时将遮挡区域的像素标记为孔洞像素,则执行步骤503b-504b以及步骤505-509。
503a、根据视差图与第一图像,合成与第二图像有相同视角的 虚拟视图,并将虚拟视图中的遮挡区域的像素标记为孔洞像素。
其中,所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域。
需要说明的是,根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图与步骤103相同,在此不再赘述。
需要说明的是,由于第一图像与第二图像的视角不同,所以在将第一图像映射到与第二图像有相同视角的虚拟视图时,不能将第一图像中的像素一一对应到第二图像的像素上,这些没有对应像素的区域映射到虚拟图像中形成了遮挡区域。
需要说明的是,将遮挡区域标记为孔洞像素的方法,可以是在虚拟视图中将噪声区域对应位置的像素的像素值全部设置为一个固定的数,如1或者0;还可以是用与虚拟视图大小相同的图像,将遮挡区域对应的位置的像素值设置为0,非遮挡区域对应的位置的像素值设置为1;还可以现有技术中标记像素的其他方法,本发明对此不做限制。
503b、根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图。
具体的,可参考步骤103,在此不再赘述。
504a、将虚拟视图中的噪声像素标记为孔洞像素。
其中,所述噪声像素是由所述视差图中视差值计算错误的像素产生的。
需要说明的是,由于在计算一个像素的视差值是从候选视差值集合中选取出一个候选视差值,作为该像素的视差值,所以可能计算出的视差值会存在一定误差,当某像素的误差超过一定限度时,我们就将该像素确定为所述视差图中视差值计算错误的像素。然后在根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图时,由于所述视差图中有视差值计算错误的像,所以合成的虚拟视图中会产生噪声,在此将这些噪声对应的像素定义为噪声像素。
需要说明的是,第二图像中的像素的像素值和虚拟视图中与其 对应的像素的像素值之间大致存在相应的规律。比如,当第二图像中某像素的像素值在第二图像的所有像素的像素值中较小时,那么虚拟图像中与其对应的像素的像素值在虚拟图像的所有像素的像素值中也较小;当第二图像中某像素的像素值在第二图像的所有像素的像素值中较大时,那么虚拟图像中与其对应的像素的像素值在虚拟图像的所有像素的像素值中也较大。本发明实施例就是利用这种规律,将不符合此规律的像素标记为噪声像素。
示例性的,如图6所示,虚拟视图中包含了噪声像素,对于同一个位置,虚拟视图中的一个像素对应第二图像中的一个像素,将第二图像中的像素值作为横轴,虚拟视图中的像素值作为纵轴,并将靓图中位于同一位置的像素的像素值映射到图中,就得到图6右边坐标轴中的点阵。从中可以观察到,大部分的点形成了一个平滑的递增曲线,这个曲线,少量的点离映射曲线较远,这些点即为噪声。在我们的算法中,我们首先利用所有的点,估计出映射曲线,然后计算每一个点到映射曲线的距离,如果距离较大,则将该点在虚拟视图中对应的像素确定为噪声像素。
具体的,选定噪声像素与标记噪声像素的方法可参考以下步骤:
Q1、在第二图像中,确定出至少两个第二像素。
其中,第二像素是指像素值相同的像素。
具体的,将第二图像的所有像素按照像素值,将具有相同像素值的像素分为一组,被分为同一组中的所有像素叫做第二像素。
需要说明的是,当某一像素的像素值在第二图像中的所有像素中是唯一时,也就是说,第二图像中没有与该像素的像素值相同的像素时,对其不做处理。
Q2、根据第二图像中的至少两个第二像素,得到虚拟视图中的至少两个标记像素。
其中,虚拟视图中的至少两个标记像素是在虚拟视图中,与第二图像中的至少两个第二像素分别对应的像素。
具体的,在虚拟视图中依次找到第二图像中具有相同像素值的 像素对应的像素。
Q3、获取虚拟视图中的至少两个标记像素的平均像素值。
具体的,首先获取至少两个标记像素中每一像素的像素值,然后将岁至少两个标记像素中每一像素的像素值求和,并除以标记像素的个数,求得至少两个标记像素的平均像素值。
Q4、依次确定虚拟视图中的至少两个标记像素中每一个标记像素的像素值与平均像素值之间的差值是否大于噪声门限值。
需要说明的是,若一个标记像素的像素值与其对应的平均像素值之间的差值大于预先设定的噪声门限值时,则将该像素确定为噪声像素;若一个标记像素的像素值与其对应的平均像素值之间的差值不大于预先设定的噪声门限值时,则确定该像素不是噪声像素。
Q5、若标记像素的像素值与平均像素值之间的差值大于噪声门限值,则将标记像素确定为噪声像素,并将噪声像素标记为孔洞像素。
需要说明的是,标记遮挡区域的方法与标记噪声像素的方法可以相同,也可以不同,本发明对此不作限制。
504b、将虚拟视图中的噪声像素和遮挡区域标记为孔洞像素。
具体的,标记遮挡区域的方法,可参考步骤503a中标记遮挡区域的方法,在此不再赘述。
具体的,确定并标记噪声像素的方法,可参考步骤504a中确定并标记噪声像素的方法,在此不再赘述。
505、根据第二图像得到第二灰度图像,并根据标记有孔洞像素的虚拟视图得到标记有孔洞像素的虚拟视图灰度图像。
具体的,对于非孔洞像素的处理方法,可参考步骤104中根据第二图像得到第二灰度图像,并根据虚拟视图得到虚拟视图灰度图像,在此不再赘述。
需要说明的是,对于标记有孔洞像素的虚拟视图中的孔洞像素,在虚拟视图灰度图像中直接将与其对应的像素标记为孔洞像素。
506、根据第二灰度图像及标记有孔洞像素的虚拟视图灰度图 像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图。
具体的,对于非孔洞像素的处理方法,可参考步骤105中根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图,在此不再赘述。
需要说明的是,对于标记有孔洞像素的虚拟视图灰度图像中的孔洞像素,在高动态范围灰度图中直接将与其对应的像素标记为孔洞像素。
507、根据标记有孔洞像素的高动态范围灰度图、第二灰度图像、标记有孔洞像素的虚拟视图灰度图像、第二图像以及标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像。
具体的,对于非孔洞像素的处理方法,可参考步骤106中根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,得到高动态范围图像,在此不再赘述。
需要说明的是,由于标记有孔洞像素的高动态范围灰度图中的孔洞像素是是根据标记有孔洞像素的虚拟视图灰度图像中的孔洞像素获取的,同时标记有孔洞像素的虚拟视图灰度图像中的孔洞像素是根据标记有孔洞像素的虚拟视图获取的,所以标记有孔洞像素的高动态范围灰度图中的孔洞像素、标记有孔洞像素的虚拟视图灰度图像中的孔洞像素与标记有孔洞像素的虚拟视图中的孔洞像素的位置是相同的。
需要说明的是,由于标记有孔洞像素的高动态范围灰度图、标记有孔洞像素的虚拟视图灰度图像与标记有孔洞像素的虚拟视图中的孔洞像素的位置是相同的,所以可以选择这三幅图像中的任意图像作为标准,在高动态范围图像中直接将与该图像中的孔洞像素对应的像素标记为孔洞像素。
508、在第二图像中,确定标记有孔洞像素的高动态范围图像每个孔洞像素对应的第一像素。
具体的,对于标记有孔洞像素的高动态范围图像中的孔洞像素, 在第二图像中直接将与其对应的像素标记为孔洞像素。
需要说明的是,标记有孔洞像素的高动态范围图像中每一个孔洞像素在第二图像中都有与其对应的第一像素。
509、获取高动态范围图像中每个孔洞像素的相邻像素,与第一像素的相邻像素间的相似系数,并根据相似性系数及第一像素,得到高动态范围图像中的至少一个孔洞像素中每个孔洞像素的像素值。
需要说明的是,本实施例中利用高动态范围图像中孔洞像素的相邻像素和第二图像中对应的第一像素的相邻像素之间相似关系,作为该孔洞像素与它的第一像素间的相似关系,然后利用这个相似关系与第一像素的像素值,最终获得孔洞像素的像素值。
需要说明的是,相似关系具体可以用相似系数表示。
进一步的,对于得到高动态范围图像中任一个孔洞像素r的相邻像素,与第一像素的相邻像素间的相似系数,可以有以下三种方法。
第一种方法:
根据公式
Figure PCTCN2014089071-appb-000062
得到高动态范围图像中任一个孔洞像素r的相邻像素,与第一像素的相邻像素间的相似系数。
其中,s表示高动态范围图像中像素r的邻域Ψr中的一个像素;I(s)表示像素s的像素值;I2(s)表示在第二图像中与像素s对应的像素的像素值;r-s表示像素r与像素s间的距离;γ是预先设定的,表示像素r与像素s间的距离的权重系数。
需要说明的是,像素r的邻域Ψr可以是以像素r为中心的区域, 也可以不是以像素r为中心的区域。对于邻域Ψr与像素r的具体关系,本发明不做限制。
需要说明的是,公式x=arg min F(x),表示x的取值为使F(x)取最小值时对应的x的值。
需要说明的是,此时,对于高动态范围图像中的每一个孔洞像素,都需要计算一次相似系数。也就是说,对于高动态范围图像中的每一个孔洞像素的相似系数都不相同。
第二种方法:
根据公式
Figure PCTCN2014089071-appb-000063
得到高动态范围图像中任一个孔洞像素r的相邻像素,与第一像素的相邻像素间的相似系数。
其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;s表示高动态范围图像中像素r的邻域Φr中的一个像素;A表示高动态范围图像;a′n表示在第一次计算孔洞像素的像素值时获取的相似系数。
需要说明的是,像素块Φr是比像素块Ψr更小的一个区域。
需要说明的是,像素r的邻域Φr可以是以像素r为中心的区域,也可以不是以像素r为中心的区域。对于邻域Φr与像素r的具体关系,本发明不做限制。
需要说明的是,a′n是在计算第一个孔洞像素时,综合了高动态范围图像中的每个像素的像素值确定出的值,为了简化计算,可以将计算第一个孔洞像素时确定出的a′n进行存储,在计算之后的孔洞像素的像素值时可以直接利用该值。
需要说明的是,可以把上述公式
Figure PCTCN2014089071-appb-000064
求导,变量是AN=[a0,a1,.......,aN],将其他的参数进行整合,就可以获取(C1+C2)*AN=(B1+B2).其中,C1,B1与公式前半段的系数相关,因此与像素s相关;C2,B2与公式后半段相关。但是,公式后半段中的系数与像素s没有关系,因此C2与B2与p不相关。在计算不同的p时,C2,B2是一样的,不需要重复计算,所以说将计算第一个孔洞像素时确定出的a′n在之后的计算中是可以复用的,不需要重新计算。
需要说明的是,第一比例系数ρ1是大于第二比例系数ρ2的值。例如,可以将第一比例系数ρ1的值设定为1,而第二比例系数ρ2得知设定为0.001。
第三种方法:
首先,确定孔洞像素r是否有第一孔洞像素。
其中,第一孔洞像素是孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素。
其次,若确定有第一孔洞像素,则将第一孔洞像素的相似系数作为孔洞像素r的相似系数。
需要说明的是,第三种方法是利用一个孔洞像素周围已经计算出像素值的孔洞像素的相似系数,作为该孔洞像素的相似系数,以简化计算相似系数的步骤。
需要说明的是,可以将第一种方法或第二种方法与第三种方法结合起来计算高动态范围图像中每一孔洞像素的相似系数。
进一步的,对于根据高动态范围图像中的至少一个孔洞像素中任一孔洞像素r的相似系数及第一像素,得到孔洞像素r的像素值包括:根据公式
Figure PCTCN2014089071-appb-000065
得到孔洞像素r的像素值。
其中,I(r)表示孔洞像素r的像素值;I2(r)表示在第二图像中与孔洞像素r对应的像素的像素值;an表示孔洞像素r的相似系数;n=0,1,......N;N为预先设定的值。
需要说明的是,发明实施例中两图像中对应像素表示在两图像中具有相同位置的像素。
需要说明的是,N的值设定的越大,计算出的结果越精确,但同时计算复杂程度相应增加。
本发明实施例提供的一种高动态范围图像合成的方法,首先获取曝光度不同的第一图像与第二图像,然后对第一图像与第二图像进行双目立体匹配,得到视差图,接着根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图,继而根据第二图像获取第二灰度图像,并根据虚拟视图获取虚拟视图灰度图像,并根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,获取高动态范围灰度图,最终根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,获取高动态范围图像,在整个获取高动态范围图像的过程中,将遮挡区域和对画面影响较大的噪声像素标记为孔洞像素,最后通过孔洞像素的相邻像素与第二图像中与孔洞像素对应的像素的相邻像素之间的关系,估计出该孔洞像素与第二图像中与其对应的像素间的关系,进而求出孔洞像素的像素值。这样,由于在进行虚拟视图合成时考虑了相邻像素之间的关系,并且对遮挡区域及噪声像素做了进一步的处理,从而提高了高动态范围图像的质量。
本发明实施例提供了一种合成视差图的方法,如图7所示,包括:
701、获取第一图像与第二图像。
其中,第一图像与第二图像是对同一物体同时拍摄得到的。
具体的,可参考步骤101,在此不再赘述。
702、获取第一图像的每个像素的候选视差值集合。
其中,候选视差值集合中包含至少两个候选视差值。
具体的,可参考步骤102中的S1,在此不再赘述。
703、根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,得到第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)。
其中,p表示像素p,是与候选视差值集合对应的第一图像的像素;di表示像素p的第i个候选视差值,i=1,......,k;k为像素p的候选视差值集合中候选视差值的总数。
需要说明的是,由于每一个像素的候选视差值集合中包含至少两个候选视差值,所以,k≥2。
进一步的,本发明提出了两种计算匹配能量E(p,di)的方法,如下所示:
第一种方法:根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000066
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,第一拟合参数a的值与第二拟合参数b的值为使匹配能量Ed(p,di)为最小值时对应的值;w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);第一像素块Ωp表示第一图像中包含像素p的一个像素块;像素q是与像素p相邻的属于第一像素块Ωp中的像素;I1(q)表示像素q的像素值;I2(q-di)表示像素q对应的第二图像中的像素q-di的像素值;wc(p,q,di)表示像素权重值;ws(p,q,di)表示距离权重值;wd(p,q,di)表示视差权重值。
进一步的,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
具体的,可参考步骤102中的S2的第一种方法,在此不再赘述。
第二种方法:根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000067
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量E(p,di)。
其中,w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
调整角度θ是预先设定大于0°且小于90°的值。
具体的,可参考步骤102中的S2的第二种方法,在此不再赘述。
704、根据第一图像的每个像素的候选视差值集合中的每一个候 选视差值的匹配能量Ed(p,di),得到第一图像中每一像素的视差值。
进一步的,根据公式
Figure PCTCN2014089071-appb-000068
求出将使像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的第一图像中每一个像素的候选视差值确定为每一个像素的视差值。
其中,I表示第一图像;第二像素块Np表示第一图像中包含像素p的一个像素块;Vp,q(di,dj)=λ×min(|di-dj|,Vmax);dj表示像素q的第j个候选视差值,j=1,......,m;m为像素q的候选视差值集合中候选视差值的总数;平滑系数λ是预先设定的值;相邻像素视差之差最大值Vmax是预先设定的值。
具体的,可参考步骤102中的S3,在此不再赘述。
705、将第一图像中的每个像素的视差值进行组合获取视差图。
具体的,可参考步骤102中的S4,在此不再赘述。
本发明实施例提供了一种合成视差图的方法,获取第一图像与第二图像,并获取第一图像的每个像素的候选视差值集合,然后根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,获取第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量E(p,di),接着根据第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),获取第一图像中每一像素的视差值,最后将第一图像中的每个像素的视差值进行组合获取视差图,这样,由于在计算每一个像素的视差值时,使得最终求出的视差值与视差值间的误差大幅减小,从而提高了高动态范围图像的质量。
如图8所示,其为本发明实施例所提供的一种高动态范围图像合成设备的功能示意图。参考图8所示,该高动态范围图像合成设备包括:获取单元801、视差处理单元802、虚拟视图合成单元803、灰度提取单元804、高动态范围融合单元805以及颜色插值单元806。
获取单元801,用于获取第一图像与第二图像。
其中,第一图像与第二图像是采用不同曝光度对同一物体同时拍摄得到的。
视差处理单元802,用于对所述获取单元801获取的所述第一图像与所述第二图像进行双目立体匹配,得到视差图。
进一步的,如图9所示,所述视差处理单元802包括:获取模块8021、计算模块8022、确定模块8023、组合模块8024。
获取模块8021,用于获取第一图像的每个像素的候选视差值集合。
其中,候选视差值集合中包含至少两个候选视差值。
计算模块8022,用于根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,得到第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)。
其中,p表示像素p,是与候选视差值集合对应的第一图像的像素。di表示像素p的第i个候选视差值,i=1,......,k。k为像素p的候选视差值集合中候选视差值的总数。
具体的,计算模块8022获取第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)有以下两种方法:
第一种方法,计算模块8022,具体用于根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000069
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一 图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
进一步的,所述像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
所述距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
所述视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
第二种方法,计算模块8022,具体用于根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000070
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)}×|I′2(p-di)-I′2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
调整角度θ是预先设定大于0°且小于90°的值。
确定模块8023,用于根据第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到第一图像中每一像素的视差值。
具体的,确定模块8023,具体用于根据公式
Figure PCTCN2014089071-appb-000071
求出将使像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的第一图像中每一个像素的候选视差值确定为每一个像素的视差值。
其中,I表示第一图像;第二像素块Np表示第一图像中包含像素p的一个像素块;Vp,q(di,dj)=λ×min(|di-dj|,Vmax);dj表示像素q的第j个候选视差值,j=1,......,m;m为像素q的候选视差值集合中候选视差值的总数;平滑系数λ是预先设定的值;相邻像素视差之差最大值Vmax是预先设定的值。
组合模块8024,用于将第一图像中的每个像素的视差值进行组合得到视差图。
虚拟视图合成单元803,用于所述视差处理单元802得到的所述视差图与所述获取单元801获取的所述第一图像,合成与第二图像有相同视角的虚拟视图。
灰度提取单元804,用于根据所述获取单元801获取的第二图像得到第二灰度图像,并根据所述虚拟视图单元803合成的虚拟视图得到虚拟视图灰度图像。
进一步的,灰度提取单元804,具体用于根据标记有孔洞像素的虚拟视图获取标记有孔洞像素的虚拟视图灰度图像。
高动态范围融合单元805,用于根据所述灰度提取单元804得到的第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图。
进一步的,高动态范围融合单元805,具体用于根据第二灰度图像及标记有孔洞像素的虚拟视图灰度图像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图。
颜色插值单元806,用于根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,得到高动态范围图像。
进一步的,颜色插值单元806,具体用于依次利用公式
Figure PCTCN2014089071-appb-000072
Figure PCTCN2014089071-appb-000073
Figure PCTCN2014089071-appb-000074
求得高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e)。
其中,e表示高动态范围图像中的像素e;
Figure PCTCN2014089071-appb-000075
Igrey(e)表示在高动态范围灰度图中与像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000076
表示在第二灰度图像中与像素e对应的像素的像素值,
Figure PCTCN2014089071-appb-000077
表示在虚拟视图灰度图像中与像素e对应的像素的像素值;
Figure PCTCN2014089071-appb-000078
Figure PCTCN2014089071-appb-000079
Figure PCTCN2014089071-appb-000080
分别表示在第二图像中与像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;
Figure PCTCN2014089071-appb-000081
Figure PCTCN2014089071-appb-000082
分别表示在虚拟视图中与像素e对应的像素的红色分量值、绿色分量值及蓝色分量值。
颜色插值单元806,具体用于根据高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,获取高动态范围图像中的每个像素的像素值。
颜色插值单元806,具体用于将高动态范围图像中的每个像素的像素值组合获取高动态范围图像。
进一步的,颜色插值单元806,具体用于根据标记有孔洞像素的高动态范围灰度图、第二灰度图像、标记有孔洞像素的虚拟视图灰度图像、第二图像以及标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像。
进一步的,如图10所示,所述高动态范围图像合成设备还包括:孔洞像素处理单元807。
孔洞像素处理单元807,用于将所述虚拟视图中的噪声像素或所述遮挡区域标记为孔洞像素。
其中,所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域;所述噪声像素是由所述视差图中视差值计算错误的像素产生的。
具体的,孔洞像素处理单元807,具体用于在第二图像中,确定出至少两个第二像素。
其中,第二像素是指像素值相同的像素。
孔洞像素处理单元807,具体用于根据第二图像中的至少两个第二像素,得到虚拟视图中的至少两个标记像素。
其中,虚拟视图中的至少两个标记像素是在虚拟视图中,与第二图像中的至少两个第二像素分别对应的像素。
孔洞像素处理单元807,具体用于获取虚拟视图中的至少两个标记像素的平均像素值。
孔洞像素处理单元807,具体用于依次确定虚拟视图中的至少两个标记像素中每一个标记像素的像素值与平均像素值之间的差值是否大于噪声门限值。
其中,噪声门限值是预先设定的用于判断噪声的值。
孔洞像素处理单元807,具体用于在标记像素的像素值与平均像素值之间的差值大于噪声门限值的情况下,将标记像素确定为噪声像素,并将噪声像素标记为孔洞像素。
孔洞像素处理单元807,还用于在第二图像中,确定标记有孔洞像素的高动态范围图像中每个孔洞像素对应的第一像素。
孔洞像素处理单元807,还用于获取高动态范围图像中每个孔洞像素的相邻像素,与第一像素的相邻像素间的相似系数;并根据相似性系数及第一像素,得到高动态范围图像中的至少一个孔洞像素中每个孔洞像素的像素值。
具体的,孔洞像素处理单元807获取高动态范围图像中每个孔洞像素的相邻像素,与第一像素的相邻像素间的相似系数可以有以下三种方法:
第一种方法,孔洞像素处理单元807,具体用于根据公式
Figure PCTCN2014089071-appb-000083
得到高动态范围图像中任一个孔洞像素r的相邻像素,与第一像素的相邻像素间的相似系数。
其中,s表示高动态范围图像中像素r的邻域Ψr中的一个像素;I(s)表示像素s的像素值;I2(s)表示在第二图像中与像素s对应的像素的像素值;r-s表示像素r与像素s间的距离;γ是预先设定的,表示像素r与像素s间的距离的权重系数。
第二种方法,孔洞像素处理单元807,具体用于根据公式
Figure PCTCN2014089071-appb-000084
得到高动态范围图像中任一个孔洞像素r的相邻像素,与第一像素的相邻像素间的相似系数。
其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;s表示高动态范围图像中像素r的邻域Φr中的一个像素;A表示高动态范围图像;a′n表示在第一次计算孔洞像素的像素值时获取的相似 系数。
第三种方法,孔洞像素处理单元807,具体用于确定孔洞像素r是否有第一孔洞像素;在确定有第一孔洞像素的情况下,将第一孔洞像素的相似系数作为孔洞像素r的相似系数。
其中,第一孔洞像素是孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素。
具体的,孔洞像素处理单元807,具体用于根据公式
Figure PCTCN2014089071-appb-000085
得到孔洞像素r的像素值。
其中,I(r)表示孔洞像素r的像素值;I2(r)表示在第二图像中与孔洞像素r对应的像素的像素值;an表示孔洞像素r的相似系数;n=0,1,......N;N为预先设定的值。
本发明实施例提供的一种高动态范围图像合成设备,首先获取曝光度不同的第一图像与第二图像,然后对第一图像与第二图像进行双目立体匹配,得到视差图,接着根据视差图与第一图像,合成与第二图像有相同视角的虚拟视图,继而根据第二图像获取第二灰度图像,并根据虚拟视图获取虚拟视图灰度图像,并根据第二灰度图像及虚拟视图灰度图像,通过高动态范围合成算法,获取高动态范围灰度图,最终根据高动态范围灰度图、第二灰度图像、虚拟视图灰度图像、第二图像以及虚拟视图,获取高动态范围图像,在整个获取高动态范围图像的过程中,将遮挡区域和对画面影响较大的噪声像素标记为孔洞像素,最后通过孔洞像素的相邻像素与第二图像中与孔洞像素对应的像素的相邻像素之间的关系,估计出该孔洞像素与第二图像中与其对应的像素间的关系,进而求出孔洞像素的像素值。这样,由于在进行虚拟视图合成时考虑了相邻像素之间的关系,并且对遮挡区域及噪声像素做了进一步的处理,因此提高了高动态范围图像的质量。
如图11所示,其为本发明实施例所提供的一种设备的功能示意图。参考图11所示,该设备包括:获取单元1101、计算单元1102、确定单元1103以及处理单元1104。
获取单元1101,用于获取第一图像与第二图像.
其中,第一图像与第二图像是对同一物体同时拍摄得到的;
获取单元1101,还用于获取第一图像的每个像素的候选视差值集合.
其中,候选视差值集合中包含至少两个候选视差值。
计算单元1102,用于根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,得到第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)。
其中,p表示像素p,是与候选视差值集合对应的第一图像的像素;di表示像素p的第i个候选视差值,i=1,......,k;k为像素p的候选视差值集合中候选视差值的总数。
进一步的,计算单元1102得到第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量E(p,di)有以下两种方法:
第一种方法,计算单元1102,具体用于根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000086
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,第一拟合参数a的值与第二拟合参数b的值为使匹配能量Ed(p,di)为最小值时对应的值;w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);第一像素块Ωp表示第一图像中包含像素p的一个像素块;像素q是与像素p相邻的属于第一像素块Ωp中的像素;I1(q)表示像素q的像素值;I2(q-di)表示像素q对应的第二图像中的像素q-di的像素值;wc(p,q,di)表示像素权重值;ws(p,q,di)表示距离权重值;wd(p,q,di)表示视差权重值。
进一步的,像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
其中,I1(p)表示像素p的像素值;I2(p-di)表示像素p对应的第二图像中的像素p-di的像素值;第一权重系数β1、第二权重系数β2、第三权重系数β3及第四权重系数β4是预先设定的值。
第二种方法,计算单元1102,具体用于根据像素p的候选视差集合中的每一个候选视差值,利用公式
Figure PCTCN2014089071-appb-000087
求得像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di)。
其中,w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
像素权重值wc(p,q,di)可以根据公式
wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
距离权重值ws(p,q,di)可以根据公式
ws(p,q,di)=exp[-β2×(p-q)2]获得;
视差权重值wd(p,q,di)可以根据公式
wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
调整角度θ是预先设定大于0°且小于90°的值。
确定单元1104,用于根据第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到第一图像中每一 像素的视差值。
进一步的,确定单元1104,具体用于根据公式
Figure PCTCN2014089071-appb-000088
求出将使像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的第一图像中每一个像素的候选视差值确定为每一个像素的视差值。
其中,I表示第一图像;第二像素块Np表示第一图像中包含像素p的一个像素块;Vp,q(di,dj)=λ×min(|di-dj|,Vmax);dj表示像素q的第j个候选视差值,j=1,......,m;m为像素q的候选视差值集合中候选视差值的总数;平滑系数λ是预先设定的值;相邻像素视差之差最大值Vmax是预先设定的值。
处理单元1105,用于将第一图像中的每个像素的视差值进行组合得到视差图。
本发明实施例提供了一种设备,获取第一图像与第二图像,并获取第一图像的每个像素的候选视差值集合,然后根据第一图像的每个像素、与第一图像的每个像素对应的第二图像中的像素、及第一图像的每个像素的候选视差值集合,获取第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量E(p,di),接着根据第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),获取第一图像中每一像素的视差值,最后将第一图像中的每个像素的视差值进行组合获取视差图,这样,由于在计算每一个像素的视差值时,使得最终求出的视差值与视差值间的误差大幅减小,从而提高了高动态范围图像的质量。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或 不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理包括,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (36)

  1. 一种高动态范围图像合成的方法,其特征在于,包括:
    获取第一图像与第二图像;所述第一图像与所述第二图像是采用不同曝光度对同一物体同时拍摄得到的;
    对所述第一图像与所述第二图像进行双目立体匹配,得到视差图;
    根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图;
    根据所述第二图像得到第二灰度图像,并根据所述虚拟视图得到虚拟视图灰度图像;
    根据所述第二灰度图像及所述虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图;
    根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图时,将所述虚拟视图中的遮挡区域的像素标记为孔洞像素;所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域;或者,
    在所述根据所述视差图与所述第一图像,合成与所述第二图像有相同视角的虚拟视图之后,在所述根据所述第二图像得到第二灰度图像,并根据所述虚拟视图得到虚拟视图灰度图像之前,所述方法还包括:将所述虚拟视图中的噪声像素或所述遮挡区域标记为孔洞像素;所述噪声像素是由所述视差图中视差值计算错误的像素产生的;
    所述根据所述虚拟视图得到虚拟视图灰度图像包括:
    根据标记有孔洞像素的虚拟视图得到标记有孔洞像素的虚拟视图灰度图像;
    所述根据所述第二灰度图像及所述虚拟视图灰度图像,通过高动 态范围合成算法,得到高动态范围灰度图包括:
    根据所述第二灰度图像及所述标记有孔洞像素的虚拟视图灰度图像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图;
    所述根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像包括:
    根据所述标记有孔洞像素的高动态范围灰度图、所述第二灰度图像、所述标记有孔洞像素的虚拟视图灰度图像、所述第二图像以及所述标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像;
    在所述根据所述高动态范围灰度图、所述第二图像及所述虚拟视图灰度图像,得到高动态范围图像之后,所述方法还包括:
    在所述第二图像中,确定所述标记有孔洞像素的高动态范围图像中每个孔洞像素对应的第一像素;
    获取所述高动态范围图像中每个孔洞像素的相邻像素,与所述第一像素的相邻像素间的相似系数;并根据所述相似性系数及所述第一像素,得到所述高动态范围图像中每个孔洞像素的像素值。
  3. 根据权利要求1或2所述的方法,其特征在于,
    所述对所述第一图像与所述第二图像进行双目立体匹配,得到视差图包括:
    获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;
    根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p的候选视差值集合中 候选视差值的总数;
    根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值;
    将所述第一图像中的每个像素的视差值进行组合得到所述视差图。
  4. 根据权利要求3所述的方法,其特征在于,
    所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:
    根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100001
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
  5. 根据权利要求4所述的方法,其特征在于,
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
  6. 根据权利要求3所述的方法,其特征在于,
    所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:
    根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100002
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
    其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
    所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
    所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
    所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
    所述调整角度θ是预先设定大于0°且小于90°的值。
  7. 根据权利要求3-6任一项所述的方法,其特征在于,
    所述根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值包括:
    根据公式
    Figure PCTCN2014089071-appb-100003
    求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,
    所述根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像包括:
    依次利用公式
    Figure PCTCN2014089071-appb-100004
    Figure PCTCN2014089071-appb-100005
    Figure PCTCN2014089071-appb-100006
    求得所述高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e);其中,所述e表示所述高动态范围图像中的像素e;所述
    Figure PCTCN2014089071-appb-100007
    Igrey(e)表示在所述高动态 范围灰度图中与所述像素e对应的像素的像素值,
    Figure PCTCN2014089071-appb-100008
    表示在所述第二灰度图像中与所述像素e对应的像素的像素值,
    Figure PCTCN2014089071-appb-100009
    表示在所述虚拟视图灰度图像中与所述像素e对应的像素的像素值;所述
    Figure PCTCN2014089071-appb-100010
    所述
    Figure PCTCN2014089071-appb-100011
    及所述
    Figure PCTCN2014089071-appb-100012
    分别表示在所述第二图像中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;所述
    Figure PCTCN2014089071-appb-100013
    所述
    Figure PCTCN2014089071-appb-100014
    及所述
    Figure PCTCN2014089071-appb-100015
    分别表示在所述虚拟视图中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;
    根据所述高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,得到所述高动态范围图像中的每个像素的像素值;
    将所述高动态范围图像中的每个像素的像素值组合得到所述高动态范围图像。
  9. 根据权利要求2-8任一项所述的方法,其特征在于,
    所述将所述虚拟视图中的噪声像素标记为孔洞像素包括:
    在所述第二图像中,确定出至少两个第二像素;所述第二像素是指像素值相同的像素;
    根据所述第二图像中的所述至少两个第二像素,得到所述虚拟视图中的至少两个标记像素;所述虚拟视图中的至少两个标记像素是在所述虚拟视图中,与所述第二图像中的所述至少两个第二像素分别对应的像素;
    获取述虚拟视图中的至少两个标记像素的平均像素值;
    依次确定所述虚拟视图中的至少两个标记像素中每一个标记像素的像素值与所述平均像素值之间的差值是否大于所述噪声门限值;
    若所述标记像素的像素值与所述平均像素值之间的差值大于所述噪声门限值,则将所述标记像素确定为噪声像素,并将所述噪声像素标记为孔洞像素。
  10. 根据权利要求2-9任一项所述的方法,其特征在于,
    对于根据所述高动态范围图像中任一孔洞像素r的相似系数及所述第一像素,得到所述孔洞像素r的像素值包括:
    根据公式
    Figure PCTCN2014089071-appb-100016
    得到所述孔洞像素r的像素值;其中,所述I(r)表示所述孔洞像素r的像素值;所述I2(r)表示在所述第二图像中与所述孔洞像素r对应的像素的像素值;所述an表示所述孔洞像素r的相似系数;所述n=0,1,......N;所述N为预先设定的值。
  11. 根据权利要求10所述的方法,其特征在于,
    对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:
    根据公式
    Figure PCTCN2014089071-appb-100017
    得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,所述s表示所述高动态范围图像中所述像素r的邻域Ψr中的一个像素;所述I(s)表示所述像素s的像素值;所述I2(s)表示在所述第二图像中与所述像素s对应的像素的像素值;所述r-s表示所述像素r与所述像素s间的距离;所述γ是预先设定的,表示所述像素r与所述像素s间的距离的权重系数。
  12. 根据权利要求10所述的方法,其特征在于,
    对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:
    根据公式
    Figure PCTCN2014089071-appb-100018
    得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所 述第一像素的相邻像素间的相似系数;其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;所述s表示所述高动态范围图像中所述像素r的邻域Φr中的一个像素;所述A表示所述高动态范围图像;所述a′n表示在第一次计算孔洞像素的像素值时得到的相似系数。
  13. 根据权利要求10所述的方法,其特征在于,
    对于获取所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数包括:
    确定所述孔洞像素r是否有第一孔洞像素;所述第一孔洞像素是所述孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素;
    若确定有所述第一孔洞像素,则将所述第一孔洞像素的相似系数作为所述孔洞像素r的相似系数。
  14. 一种合成视差图的方法,其特征在于,包括:
    获取第一图像与第二图像;所述第一图像与所述第二图像是对同一物体同时拍摄得到的;
    获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;
    根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示所述像素p的第i个候选视差值,i=1,......,k;所述k为所述像素p的候选视差值集合中候选视差值的总数;
    根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值;
    将所述第一图像中的每个像素的视差值进行组合得到所述视差图。
  15. 根据权利要求14所述的方法,其特征在于,
    所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:
    根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100019
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
  16. 根据权利要求15所述的方法,其特征在于,
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
  17. 根据权利要求14所述的方法,其特征在于,
    所述根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di)包括:
    根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100020
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
    其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
    所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
    所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
    所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
    所述调整角度θ是预先设定大于0°且小于90°的值。
  18. 根据权利要求14-17任一项所述的方法,其特征在于,
    所述根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值包括:
    根据公式
    Figure PCTCN2014089071-appb-100021
    求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
  19. 一种高动态范围图像合成设备,其特征在于,包括:
    获取单元,用于获取第一图像与第二图像;所述第一图像与所述第二图像是采用不同曝光度对同一物体同时拍摄得到的;
    视差处理单元,用于对所述获取单元获取的所述第一图像与所述第二图像进行双目立体匹配,得到视差图;
    虚拟视图合成单元,用于根据所述视差处理单元得到的所述视差图与所述获取单元获取的所述第一图像,合成与所述第二图像有相同视角的虚拟视图;
    灰度提取单元,用于根据所述获取单元获取的所述第二图像得到第二灰度图像,并根据所述虚拟视图单元合成的所述虚拟视图得到虚拟视图灰度图像;
    高动态范围融合单元,用于根据所述灰度提取单元得到的所述第二灰度图像及所述虚拟视图灰度图像,通过高动态范围合成算法,得到高动态范围灰度图;
    颜色插值单元,用于根据所述高动态范围灰度图、所述第二灰度图像、所述虚拟视图灰度图像、所述第二图像以及所述虚拟视图,得到高动态范围图像。
  20. 根据权利要求19所述的设备,其特征在于,还包括:孔洞像素处理单元:
    所述孔洞像素处理单元,用于将所述虚拟视图中的噪声像素和/或所述遮挡区域标记为孔洞像素;所述遮挡区域是所述第一图像与所述第二图像对同一物体拍摄的角度不同产生的区域;所述噪声像素是由所述视差图中视差值计算错误的像素产生的;
    所述灰度提取单元,具体用于根据标记有孔洞像素的虚拟视图得到标记有孔洞像素的虚拟视图灰度图像;
    所述高动态范围融合单元,具体用于根据所述第二灰度图像及所述标记有孔洞像素的虚拟视图灰度图像,通过高动态范围合成算法,得到标记有孔洞像素的高动态范围灰度图;
    所述颜色插值单元,具体用于根据所述标记有孔洞像素的高动态范围灰度图、所述第二灰度图像、所述标记有孔洞像素的虚拟视图灰度图像、所述第二图像以及所述标记有孔洞像素的虚拟视图,得到标记有孔洞像素的高动态范围图像;
    所述孔洞像素处理单元,还用于在所述第二图像中,确定所述标记有孔洞像素的高动态范围图像中每个孔洞像素对应的第一像素;
    所述孔洞像素处理单元,还用于获取所述高动态范围图像中每个孔洞像素的相邻像素,与所述第一像素的相邻像素间的相似系数;并根据所述相似性系数及所述第一像素,得到所述高动态范围图像中每个孔洞像素的像素值。
  21. 根据权利要求19或20所述的设备,其特征在于,所述视差处理单元包括:获取模块、计算模块、确定模块、组合模块;
    所述获取模块,用于获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;
    所述计算模块,用于根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示像素p的第i个候选视差值,i=1,......,k;所述k为像素p 的候选视差值集合中候选视差值的总数;
    所述确定模块,用于根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);得到所述第一图像中每一像素的视差值;
    所述组合模块,用于将所述第一图像中的每个像素的视差值进行组合得到所述视差图。
  22. 根据权利要求21所述的设备,其特征在于,
    所述计算模块,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100022
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
  23. 根据权利要求22所述的设备,其特征在于,
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所 述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
  24. 根据权利要求21所述的设备,其特征在于,
    所述计算模块,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100023
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
    其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
    所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
    所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
    所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
    所述调整角度θ是预先设定大于0°且小于90°的值。
  25. 根据权利要求21-24任一项所述的设备,其特征在于,
    所述确定模块,具体用于根据公式
    Figure PCTCN2014089071-appb-100024
    求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候 选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
  26. 根据权利要求19-25任一项所述的设备,其特征在于,
    所述颜色插值单元,具体用于依次利用公式
    Figure PCTCN2014089071-appb-100025
    Figure PCTCN2014089071-appb-100026
    Figure PCTCN2014089071-appb-100027
    求得所述高动态范围图像中每个像素的红色分量值Ired(e)、绿色分量值Igreen(e)及蓝色分量值Iblue(e);其中,所述e表示所述高动态范围图像中的像素e;所述
    Figure PCTCN2014089071-appb-100028
    Igrey(e)表示在所述高动态范围灰度图中与所述像素e对应的像素的像素值,
    Figure PCTCN2014089071-appb-100029
    表示在所述第二灰度图像中与所述像素e对应的像素的像素值,
    Figure PCTCN2014089071-appb-100030
    表示在所述虚拟视图灰度图像中与所述像素e对应的像素的像素值;所述
    Figure PCTCN2014089071-appb-100031
    所述
    Figure PCTCN2014089071-appb-100032
    及所述
    Figure PCTCN2014089071-appb-100033
    分别表示在所述第二图像中与像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;所述
    Figure PCTCN2014089071-appb-100034
    所述
    Figure PCTCN2014089071-appb-100035
    及所述
    Figure PCTCN2014089071-appb-100036
    分别表示在所述虚拟视图中与所述像素e对应的像素的红色分量值、绿色分量值及蓝色分量值;
    所述颜色插值单元,具体用于根据所述高动态范围图像中的每个像素的红色分量值、绿色分量值及蓝色分量值,得到所述高动态范围图像中的每个像素的像素值;
    所述颜色插值单元,具体用于将所述高动态范围图像中的每个像素的像素值组合得到所述高动态范围图像。
  27. 根据权利要求20-26任一项所述的设备,其特征在于,
    所述孔洞像素处理单元,具体用于在所述第二图像中,确定出至 少两个第二像素;所述第二像素是指像素值相同的像素;
    所述孔洞像素处理单元,具体用于根据所述第二图像中的所述至少两个第二像素,得到所述虚拟视图中的至少两个标记像素;所述虚拟视图中的至少两个标记像素是在所述虚拟视图中,与所述第二图像中的所述至少两个第二像素分别对应的像素;
    所述孔洞像素处理单元,具体用于获取所述虚拟视图中的至少两个标记像素的平均像素值;
    所述孔洞像素处理单元,具体用于依次确定所述虚拟视图中的至少两个标记像素中每一个标记像素的像素值与所述平均像素值之间的差值是否大于所述噪声门限值;
    所述孔洞像素处理单元,具体用于在所述标记像素的像素值与所述平均像素值之间的差值大于所述噪声门限值的情况下,将所述标记像素确定为噪声像素,并将所述噪声像素标记为孔洞像素。
  28. 根据权利要求20-27任一项所述的设备,其特征在于,
    所述孔洞像素处理单元,具体用于根据公式
    Figure PCTCN2014089071-appb-100037
    得到所述孔洞像素r的像素值;其中,所述I(r)表示所述孔洞像素r的像素值;所述I2(r)表示在所述第二图像中与所述孔洞像素r对应的像素的像素值;所述an表示所述孔洞像素r的相似系数;所述n=0,1,......N;所述N为预先设定的值。
  29. 根据权利要求28所述的设备,其特征在于,
    所述孔洞像素处理单元,具体用于根据公式
    Figure PCTCN2014089071-appb-100038
    得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,所述s表示所述高动态范围图像中所述像素r的邻域Ψr中的一个像素;所述I(s)表示所 述像素s的像素值;所述I2(s)表示在所述第二图像中与所述像素s对应的像素的像素值;所述r-s表示所述像素r与所述像素s间的距离;所述γ是预先设定的,表示所述像素r与所述像素s间的距离的权重系数。
  30. 根据权利要求28所述的设备,其特征在于,
    所述孔洞像素处理单元,具体用于根据公式
    Figure PCTCN2014089071-appb-100039
    得到所述高动态范围图像中任一个孔洞像素r的相邻像素,与所述第一像素的相邻像素间的相似系数;其中,第一比例系数ρ1与第二比例系数ρ2是预先设定的值;所述s表示所述高动态范围图像中所述像素r的邻域Φr中的一个像素;所述A表示所述高动态范围图像;所述a′n表示在第一次计算孔洞像素的像素值时得到的相似系数。
  31. 根据权利要求28所述的设备,其特征在于,
    所述孔洞像素处理单元,具体用于确定所述孔洞像素r是否有第一孔洞像素;所述第一孔洞像素是所述孔洞像素r的相邻孔洞像素中已得到像素值的孔洞像素;
    所述孔洞像素处理单元,具体用于在确定有所述第一孔洞像素的情况下,将所述第一孔洞像素的相似系数作为所述孔洞像素r的相似系数。
  32. 一种设备,其特征在于,包括:
    获取单元,用于获取第一图像与第二图像;所述第一图像与所述第二图像是对同一物体同时拍摄得到的;
    所述获取单元,还用于获取所述第一图像的每个像素的候选视差值集合;其中,所述候选视差值集合中包含至少两个候选视差值;
    计算单元,用于根据所述第一图像的每个像素、与所述第一图像的每个像素对应的所述第二图像中的像素、及所述第一图像的每个 像素的候选视差值集合,得到所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di);其中,p表示像素p,是与所述候选视差值集合对应的所述第一图像的像素;所述di表示所述像素p的第i个候选视差值,i=1,......,k;所述k为所述像素p的候选视差值集合中候选视差值的总数;
    确定单元,用于根据所述第一图像的每个像素的候选视差值集合中的每一个候选视差值的匹配能量Ed(p,di),得到所述第一图像中每一像素的视差值;
    处理单元,用于将所述第一图像中的每个像素的视差值进行组合得到所述视差图。
  33. 根据权利要求32所述的设备,其特征在于,
    所述计算单元,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100040
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);其中,所述第一拟合参数a的值与第二拟合参数b的值为使所述匹配能量Ed(p,di)为最小值时对应的值;所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);所述第一像素块Ωp表示所述第一图像中包含所述像素p的一个像素块;所述像素q是与所述像素p相邻的属于所述第一像素块Ωp中的像素;所述I1(q)表示像素q的像素值;所述I2(q-di)表示所述像素q对应的所述第二图像中的像素q-di的像素值;所述wc(p,q,di)表示像素权重值;所述ws(p,q,di)表示距离权重值;所述wd(p,q,di)表示视差权重值。
  34. 根据权利要求33所述的设备,其特征在于,
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I1(p)-I1(q)|×|I2(p-di)-I2(q-di)|]获得;
    其中,所述I1(p)表示所述像素p的像素值;所述I2(p-di)表示所述像素p对应的所述第二图像中的像素p-di的像素值;所述第一权重系数β1、所述第二权重系数β2、所述第三权重系数β3及所述第四权重系数β4是预先设定的值。
  35. 根据权利要求32所述的设备,其特征在于,
    所述计算单元,具体用于根据所述像素p的候选视差集合中的每一个候选视差值,利用公式
    Figure PCTCN2014089071-appb-100041
    求得所述像素p对于候选视差值集合中的每一个候选视差值di的匹配能量Ed(p,di);
    其中,所述w(p,q,di)=wc(p,q,di)ws(p,q,di)wd(p,q,di);
    所述像素权重值wc(p,q,di)可以根据公式
    wc(p,q,di)=exp[-β1×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述距离权重值ws(p,q,di)可以根据公式
    ws(p,q,di)=exp[-β2×(p-q)2]获得;
    所述视差权重值wd(p,q,di)可以根据公式
    wd(p,q,di)=exp[-β3×(p-q)24×|I′1(p)-I′1(q)|×|I′2(p-di)-I′2(q-di)|]获得;
    所述I′1(p)=I1(p)cosθ-I2(p-di)sinθ;
    所述I′2(p-di)=I1(p)sinθ-I2(p-di)cosθ;
    所述I′1(q)=I1(q)cosθ-I2(q-di)sinθ;
    所述I′2(q-di)=I1(q)sinθ-I2(q-di)cosθ;
    所述调整角度θ是预先设定大于0°且小于90°的值。
  36. 根据权利要求32-35任一项所述的设备,其特征在于,
    所述确定单元,具体用于根据公式
    Figure PCTCN2014089071-appb-100042
    求出将使所述像素p候选视差值集合中的每一个候选视差值di的候选能量E(di)为最小值时,对应的所述第一图像中每一个像素的候选视差值确定为每一个像素的视差值;其中,所述I表示所述第一图像;所述第二像素块Np表示所述第一图像中包含所述像素p的一个像素块;所述Vp,q(di,dj)=λ×min(|di-dj|,Vmax);所述dj表示像素q的第j个候选视差值,j=1,......,m;所述m为像素q的候选视差值集合中候选视差值的总数;所述平滑系数λ是预先设定的值;所述相邻像素视差之差最大值Vmax是预先设定的值。
PCT/CN2014/089071 2014-03-18 2014-10-21 一种高动态范围图像合成的方法及装置 WO2015139454A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410101591.1A CN104935911B (zh) 2014-03-18 2014-03-18 一种高动态范围图像合成的方法及装置
CN201410101591.1 2014-03-18

Publications (1)

Publication Number Publication Date
WO2015139454A1 true WO2015139454A1 (zh) 2015-09-24

Family

ID=54122843

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/089071 WO2015139454A1 (zh) 2014-03-18 2014-10-21 一种高动态范围图像合成的方法及装置

Country Status (2)

Country Link
CN (1) CN104935911B (zh)
WO (1) WO2015139454A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017189104A1 (en) * 2016-04-28 2017-11-02 Qualcomm Incorporated Parallax mask fusion of color and mono images for macrophotography
CN108354435A (zh) * 2017-01-23 2018-08-03 上海长膳智能科技有限公司 自动烹调设备与利用其进行烹调的方法
CN112149493A (zh) * 2020-07-31 2020-12-29 上海大学 基于双目立体视觉的道路高程测量方法

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2016326942B2 (en) * 2015-09-25 2019-10-10 Sony Corporation Image processing device and image processing method
US10097747B2 (en) * 2015-10-21 2018-10-09 Qualcomm Incorporated Multiple camera autofocus synchronization
US9998720B2 (en) 2016-05-11 2018-06-12 Mediatek Inc. Image processing method for locally adjusting image data of real-time image
CN108335279B (zh) * 2017-01-20 2022-05-17 微软技术许可有限责任公司 图像融合和hdr成像
CN109314776B (zh) * 2017-05-17 2021-02-26 深圳配天智能技术研究院有限公司 图像处理方法、图像处理设备及存储介质
CN107396082B (zh) * 2017-07-14 2020-04-21 歌尔股份有限公司 一种图像数据的处理方法和装置
CN109819173B (zh) * 2017-11-22 2021-12-03 浙江舜宇智能光学技术有限公司 基于tof成像系统的深度融合方法和tof相机
CN107948519B (zh) 2017-11-30 2020-03-27 Oppo广东移动通信有限公司 图像处理方法、装置及设备
CN108184075B (zh) * 2018-01-17 2019-05-10 百度在线网络技术(北京)有限公司 用于生成图像的方法和装置
CN110276714B (zh) * 2018-03-16 2023-06-06 虹软科技股份有限公司 快速扫描式全景图图像合成方法及装置
TWI684165B (zh) * 2018-07-02 2020-02-01 華晶科技股份有限公司 影像處理方法與電子裝置
CN109842791B (zh) * 2019-01-15 2020-09-25 浙江舜宇光学有限公司 一种图像处理方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887589A (zh) * 2010-06-13 2010-11-17 东南大学 一种基于立体视觉的实拍低纹理图像重建方法
CN102422124A (zh) * 2010-05-31 2012-04-18 松下电器产业株式会社 成像装置、成像方法及程序
CN102779334A (zh) * 2012-07-20 2012-11-14 华为技术有限公司 一种多曝光运动图像的校正方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9210322B2 (en) * 2010-12-27 2015-12-08 Dolby Laboratories Licensing Corporation 3D cameras for HDR

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102422124A (zh) * 2010-05-31 2012-04-18 松下电器产业株式会社 成像装置、成像方法及程序
CN101887589A (zh) * 2010-06-13 2010-11-17 东南大学 一种基于立体视觉的实拍低纹理图像重建方法
CN102779334A (zh) * 2012-07-20 2012-11-14 华为技术有限公司 一种多曝光运动图像的校正方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017189104A1 (en) * 2016-04-28 2017-11-02 Qualcomm Incorporated Parallax mask fusion of color and mono images for macrophotography
WO2017189102A1 (en) * 2016-04-28 2017-11-02 Qualcomm Incorporated Performing intensity equalization with respect to mono and color images
US10341543B2 (en) 2016-04-28 2019-07-02 Qualcomm Incorporated Parallax mask fusion of color and mono images for macrophotography
US10362205B2 (en) 2016-04-28 2019-07-23 Qualcomm Incorporated Performing intensity equalization with respect to mono and color images
CN108354435A (zh) * 2017-01-23 2018-08-03 上海长膳智能科技有限公司 自动烹调设备与利用其进行烹调的方法
CN112149493A (zh) * 2020-07-31 2020-12-29 上海大学 基于双目立体视觉的道路高程测量方法
CN112149493B (zh) * 2020-07-31 2022-10-11 上海大学 基于双目立体视觉的道路高程测量方法

Also Published As

Publication number Publication date
CN104935911B (zh) 2017-07-21
CN104935911A (zh) 2015-09-23

Similar Documents

Publication Publication Date Title
WO2015139454A1 (zh) 一种高动态范围图像合成的方法及装置
US11615546B2 (en) Systems and methods for depth estimation using generative models
US10540806B2 (en) Systems and methods for depth-assisted perspective distortion correction
US11830141B2 (en) Systems and methods for 3D facial modeling
US10853625B2 (en) Facial signature methods, systems and software
CN106981078B (zh) 视线校正方法、装置、智能会议终端及存储介质
WO2020007320A1 (zh) 多视角图像的融合方法、装置、计算机设备和存储介质
WO2012114639A1 (ja) オブジェクト表示装置、オブジェクト表示方法及びオブジェクト表示プログラム
EP2064675A1 (en) Method for determining a depth map from images, device for determining a depth map
AU2020203790B2 (en) Transformed multi-source content aware fill
WO2018225518A1 (ja) 画像処理装置、画像処理方法、プログラム、およびテレコミュニケーションシステム
KR101853269B1 (ko) 스테레오 이미지들에 관한 깊이 맵 스티칭 장치
WO2021003807A1 (zh) 一种图像深度估计方法及装置、电子设备、存储介质
DK3189493T3 (en) PERSPECTIVE CORRECTION OF DIGITAL PHOTOS USING DEPTH MAP
JPH05303629A (ja) 形状合成方法
TWI820246B (zh) 具有像差估計之設備、估計來自廣角影像的像差之方法及電腦程式產品
JP2007053621A (ja) 画像生成装置
JP2011165081A (ja) 画像生成方法、画像生成装置、及びプログラム
CN107403448B (zh) 代价函数生成方法和代价函数生成装置
TWI757658B (zh) 影像處理系統及影像處理方法
GB2585197A (en) Method and system for obtaining depth data
KR20160101762A (ko) 색상 정보를 활용한 자동 정합·파노라믹 영상 생성 장치 및 방법
Seo et al. Automatic Gaze Correction based on Deep Learning and Image Warping
KR100719400B1 (ko) 영상 시점 합성 방법
US9531943B2 (en) Block-based digital refocusing system and method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14886281

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14886281

Country of ref document: EP

Kind code of ref document: A1