WO2022148307A1 - 获取视差图像的方法、装置、电子设备、存储介质及计算机程序 - Google Patents

获取视差图像的方法、装置、电子设备、存储介质及计算机程序 Download PDF

Info

Publication number
WO2022148307A1
WO2022148307A1 PCT/CN2021/143444 CN2021143444W WO2022148307A1 WO 2022148307 A1 WO2022148307 A1 WO 2022148307A1 CN 2021143444 W CN2021143444 W CN 2021143444W WO 2022148307 A1 WO2022148307 A1 WO 2022148307A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
reduced
parallax
target
pixel
Prior art date
Application number
PCT/CN2021/143444
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 WO2022148307A1 publication Critical patent/WO2022148307A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20228Disparity calculation for image-based rendering

Definitions

  • the embodiments of the present disclosure relate to the field of vision, and in particular, to a method, an apparatus, an electronic device, a storage medium, and a computer program for acquiring parallax images.
  • the commonly used algorithms for calculating parallax images include semi-global block matching (SGBM) and semi-global matching (SGM), etc.
  • the basic processing flow of these algorithms includes: cost There are four steps of calculation, cost aggregation, parallax calculation, and parallax optimization. The calculation amount of the whole process is very large.
  • the parallax image is based on any image in the image pair, and its size is the size of the reference image, and the element value is an image of parallax.
  • the usual practice is to solidify the algorithm into hardware, or use high-performance computers such as GPU, which is not only costly, but also has some common problems.
  • the resolution is: 1280 ⁇ 720
  • the amount of calculation of the corresponding parallax image also increases, resulting in a decrease in the output frame rate of the algorithm, which is difficult to meet the application scenario of real-time acquisition of parallax images; another example, the distance between binocular vision equipment The closer the object is, the greater the parallax, and the amount of calculation of the parallax image will also increase.
  • the maximum parallax supported by the current device is usually relatively small, such as supporting parallax 64, 128, etc. Vision equipment cannot be used at close range.
  • the purpose of the embodiments of the present disclosure is to provide a method, an electronic device, a storage medium and a computer program for acquiring parallax images, which can reduce the amount of calculation of parallax images, improve the frame rate of acquiring parallax images, reduce the acquisition cost, and at the same time improve the support of the device. Maximum parallax.
  • embodiments of the present disclosure provide a method for obtaining parallax images, including:
  • the binocular original image includes a left view and a right view.
  • At least one binocular original image is reduced according to a preset ratio to obtain at least one reduced binocular image, and a reduced parallax image is generated according to the pair of reduced binocular images, and one binocular original image includes a left view and a right view, Since the reduced left view and the reduced right view contain fewer pixels, the correspondingly generated reduced parallax image requires less computation and is faster, and the reduced parallax image has the same resolution as the binocular reduced image, so the reduced parallax image has the same resolution.
  • the data amount of the reduced parallax image is also reduced, which makes the transmission of the reduced parallax image to the specified application faster, and improves the frame rate of obtaining the reduced parallax image, so that the specified application can quickly restore the original binocular image based on the reduced parallax image.
  • the target parallax image improves the speed of acquiring the target parallax image; because there is no need to install high-cost curing hardware, the acquisition cost is reduced, and at the same time, it can be reduced according to the preset ratio, so that the larger maximum parallax that can be supported can be used. Resolution of the binocular raw image.
  • acquiring an image of a designated area in the binocular original image acquiring a designated parallax image of the image in the designated area according to the image in the designated area; after transmitting the designated disparity image to the designated application , superimposing the specified parallax image on the specified area corresponding to the target parallax image to generate a new target parallax image.
  • the specified parallax image is superimposed on the target parallax image. Since the specified parallax image is determined based on an unreduced specified area, the specified parallax image has high accuracy, thereby improving the accuracy of the new target parallax image.
  • adjusting the resolution of the reduced parallax image to the resolution of the binocular original image, and generating the target parallax image of the binocular original image including: according to According to the resolution of the binocular original image, a blank pixel image to be filled with disparity values is generated; according to the preset ratio and each of the reduced disparity values in the reduced disparity images, the blank pixel image is determined.
  • the target disparity value of each pixel in the target disparity value; according to each of the target disparity values, the corresponding pixels in the blank pixel image are filled to generate the target disparity image.
  • the target disparity value of each pixel in the blank pixel image is determined by the reduced disparity value in the reduced disparity image, and the determination speed is fast.
  • determining the target disparity value of each pixel in the blank pixel image according to the preset ratio and each of the reduced disparity values in the reduced disparity image includes: according to the preset ratio and the reduced disparity value to determine the first pixel position and the target disparity value of the first pixel position; according to the first pixel position and the target disparity value of the first pixel position, determine the remaining pixel positions target disparity value.
  • the reduced parallax image includes pixels of m rows and n columns, where m and n are both integers greater than or equal to 0; the first pixel position and the first pixel are determined according to the preset ratio and the reduced parallax value.
  • the target disparity value for the location including:
  • the following processing is performed for the reduced disparity value at the position of the mth row and the nth column: taking the value of N ⁇ m as the row number of the first pixel position, and taking N*n as the column number of the first pixel position, obtain each The first pixel position, where N represents a preset ratio, and N is an integer greater than 1; and N times the reduced disparity value is obtained as the target disparity value of the first pixel position.
  • determining the target disparity values of the remaining pixel positions includes: performing the following processing for each of the first pixel positions: respectively obtaining obtaining the first pixel position adjacent to the first pixel position in the first direction and the first pixel position adjacent in the second direction; obtaining the first pixel position, the adjacent first pixel position in the first direction
  • the pixel positions and the blank pixel positions between the adjacent first pixel positions in the second direction are taken as the positions to be filled for the first pixel positions, and the first direction and the second direction are perpendicular to each other; according to the The target disparity value at the first pixel position, the target disparity value at the first pixel position adjacent in the first direction, and the target disparity value at the first pixel position adjacent in the second direction, for the first pixel position.
  • An interpolation operation is performed on the to-be-filled position of a pixel position to obtain the target disparity value of the to-be-filled position of the first pixel position.
  • the target disparity value of the position and the target disparity value of the adjacent first pixel position in the second direction determine the target disparity value of the position to be filled, so that the determined target disparity value of the position to be filled is more accurate.
  • the method further includes: performing smoothing processing on the target parallax image; performing optimization processing on the smoothed target parallax image to generate a new target parallax image, and the optimization processing includes: Domain filtering and/or debounce processing.
  • the target parallax image is made more accurate by smoothing.
  • the method before acquiring the reduced disparity image of the reduced binocular image according to the reduced binocular image, the method further includes: obtaining the preset ratio and the current maximum supported disparity value; Let the scaled maximum supported disparity value be the new maximum supported disparity value.
  • Embodiments of the present disclosure also provide an apparatus for acquiring parallax images, which is characterized by comprising:
  • the binocular reduced image acquisition module is used to reduce at least one binocular original image according to a preset ratio to obtain a binocular reduced image
  • a reduced parallax image acquisition module configured to acquire a reduced parallax image of the binocular reduced image according to the binocular reduced image
  • a target parallax image generation module configured to adjust the resolution of the reduced parallax image to the resolution of the binocular original image after transmitting the reduced parallax image to a specified application, and generate the target parallax of the binocular original image image.
  • the binocular original image includes a left view and a right view.
  • the device also includes:
  • a designated area image acquisition module used to acquire the image of the designated area in the binocular original image
  • a specified parallax image acquisition module configured to acquire a specified parallax image of the image of the specified area according to the image of the specified area
  • the target parallax image generation module is further configured to superimpose the specified parallax image on the specified area corresponding to the target parallax image after transmitting the specified parallax image to the specified application to generate a new target Parallax image.
  • the target parallax image generation module includes:
  • a blank pixel image generation unit configured to generate a blank pixel image to be filled with parallax values according to the resolution of the binocular original image after transmitting the reduced parallax image to a specified application
  • a target disparity value determination unit configured to determine the target disparity value of each pixel in the blank pixel image according to the preset ratio and each of the reduced disparity values in the reduced disparity image
  • a target parallax value generating unit configured to fill corresponding pixels in the blank pixel image according to each target parallax value, to generate the target parallax image.
  • the target disparity value determination unit includes:
  • a first determination subunit configured to determine a first pixel position and a target disparity value of the first pixel position according to the preset ratio and the reduced disparity value
  • the second determination subunit is configured to determine the target disparity values of the remaining pixel positions according to the first pixel position and the target disparity value of the first pixel position.
  • the reduced parallax image includes pixels of m rows and n columns, and m and n are both integers greater than or equal to 0; the first pixel position and all the pixels are determined according to the preset ratio and the reduced parallax value.
  • the target disparity value at the first pixel position includes: performing the following processing on the reduced disparity value at the mth row and nth column position: taking the value of N*m as the row number of the first pixel position, taking N* n is used as the number of columns of the first pixel position, and each of the first pixel positions is obtained, where N represents a preset ratio, and N is an integer greater than 1; and N times the reduced disparity value is obtained as the first The target disparity value at the pixel location.
  • determining the target disparity values of the remaining pixel positions includes: performing the following processing for each of the first pixel positions: respectively obtaining obtaining the first pixel position adjacent to the first pixel position in the first direction and the first pixel position adjacent in the second direction; obtaining the first pixel position, the adjacent first pixel position in the first direction
  • the pixel positions and the blank pixel positions between the adjacent first pixel positions in the second direction are taken as the positions to be filled for the first pixel positions, and the first direction and the second direction are perpendicular to each other; according to the The target disparity value at the first pixel position, the target disparity value at the first pixel position adjacent in the first direction, and the target disparity value at the first pixel position adjacent in the second direction, for the first pixel position.
  • An interpolation operation is performed on the to-be-filled position of a pixel position to obtain the target disparity value of the to-be-filled position.
  • the device also includes:
  • a smoothing processing module for smoothing the target parallax image
  • An optimization processing module configured to perform optimization processing on the smoothed target time difference image to generate a new target parallax image, where the optimization processing includes: multi-frame time domain filtering and/or de-jitter processing.
  • the device also includes:
  • the maximum supported disparity value module is configured to obtain the preset scale and the current maximum supported disparity value, and use the maximum supported disparity value reduced by the preset scale as a new maximum supported disparity value.
  • Embodiments of the present disclosure also provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores data executable by the at least one processor The instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned method for obtaining a parallax image.
  • Embodiments of the present disclosure also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned method for acquiring a parallax image is implemented.
  • Embodiments of the present disclosure also provide a computer program, including instructions, which, when executed on a computer, cause the computer to execute the above-described method for obtaining parallax images.
  • Embodiments of the present disclosure provide a method, an apparatus, an electronic device, a storage medium, and a computer program for acquiring a parallax image.
  • the method includes: reducing at least a pair of input binocular original images according to a preset ratio to obtain at least a pair of reduced binocular images; obtaining a reduced parallax image of the reduced binocular image according to the reduced binocular images; After transmitting the reduced parallax image to a specified application, the resolution of the reduced parallax image is adjusted to the resolution of the binocular original image, and a target parallax image of the binocular original image is generated.
  • the amount of calculation of parallax images can be reduced, the frame rate of acquiring parallax images can be increased, the acquisition cost can be reduced, and the maximum parallax supported by the device can be increased at the same time.
  • FIG. 1 is a schematic diagram of a parallax image provided in accordance with the present disclosure
  • FIG. 2 is a flowchart of a method for obtaining parallax images according to the first embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for obtaining parallax images according to a second embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of transforming into a binocular zoomed-out view according to a second embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of transforming into a reduced parallax image according to a second embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a blank pixel image according to a second embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of a specific implementation of determining the target disparity value of each pixel in the blank pixel image according to the second embodiment of the present disclosure
  • FIG. 8 is a schematic diagram of a first pixel position according to a second embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of determining target disparity values of other pixels according to the second embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of generating a target parallax image according to a second embodiment of the present disclosure
  • FIG. 11 is a schematic diagram of a method for obtaining parallax images according to a third embodiment of the present disclosure.
  • FIG. 12 is a schematic diagram of an apparatus for acquiring parallax images according to a fourth embodiment of the present disclosure.
  • FIG. 13 is a structural block diagram of an electronic device provided in a fifth embodiment of the present disclosure.
  • the resolution of the image is usually less than or equal to 1280 ⁇ 720.
  • Low resolution is not conducive to the development of equipment that relies on original image content for information mining, such as a device that recognizes objects in images.
  • the resolution is increased, the amount of calculation of the parallax image will increase, resulting in a decrease in the frame rate of the output parallax image.
  • the parallax map with a large amount of data also requires higher bandwidth for transmission, which is difficult to apply to scenes with high real-time requirements. .
  • the maximum parallax is usually less than 256.
  • the maximum parallax value supported by a general device is 64 or 128, which makes it impossible for binocular vision devices to obtain parallax images of closer objects.
  • the resolution of the output disparity map is basically the same as that of the original image, and in the case of limited bandwidth, the transmission frame rate is low, as shown in Figure 1, the left side of Figure 1 is The original photo, on the right is the parallax image of the original photo, and the resolution of the parallax image is the same as that of the original photo.
  • the first embodiment of the present disclosure relates to a method for acquiring parallax images, and the process is shown in FIG. 2 :
  • Step 101 Reduce at least one binocular original image according to a preset ratio to obtain a reduced binocular image, wherein the binocular original image is composed of a left view and a right view.
  • Step 102 Obtain a reduced parallax image of the reduced binocular image according to the reduced binocular image.
  • Step 103 after the reduced parallax image is transmitted to the designated application, the resolution of the reduced parallax image is adjusted to the resolution of the binocular original image, and the target parallax image of the binocular original image is generated.
  • At least one binocular original image is reduced according to a preset ratio to obtain at least one reduced binocular image, and a reduced parallax image is generated according to the pair of reduced binocular images, and one binocular original image includes a left view and a right view, Since the reduced left view and the reduced right view contain fewer pixels, the correspondingly generated reduced parallax image requires less computation and is faster, and the reduced parallax image has the same resolution as the binocular reduced image, so the reduced parallax image has the same resolution.
  • the data amount of the reduced parallax image is also reduced, which makes the transmission of the reduced parallax image to the specified application faster, and improves the frame rate of obtaining the reduced parallax image, so that the specified application can quickly restore the original binocular image based on the reduced parallax image.
  • the target parallax image improves the speed of acquiring the target parallax image; because there is no need to install high-cost curing hardware, the acquisition cost is reduced, and at the same time, it can be reduced according to the preset ratio, so that the larger maximum parallax that can be supported can be used. Resolution of the binocular raw image.
  • the second embodiment of the present disclosure relates to a method of acquiring parallax images.
  • the second embodiment is a detailed introduction to the first embodiment, and its flow is shown in FIG. 3 .
  • Step 201 Reduce at least one binocular original image according to a preset ratio to obtain a reduced binocular image, wherein the binocular original image is composed of a left view and a right view.
  • the method in this example is applied to a device with binocular vision, such as a robot.
  • the binocular vision device may include at least two image acquisition devices, for example, two cameras arranged at intervals and three cameras arranged at intervals. If more than 3 cameras are included, the binocular vision device selects two cameras to form a pair at the same time, and performs image acquisition.
  • a binocular original image includes left and right views.
  • the resolution of a binocular original image can be set to a high resolution to improve the recognition of the binocular original image, wherein the resolution greater than 1280 ⁇ 720 can be a high resolution, for example, the binocular original image is high Resolution: 1280 ⁇ 960, that is, the resolutions of the left and right views in the binocular original image are both 1280 ⁇ 960.
  • the original left view and the original right view collected by the binocular vision device are denoted as “AR” and “AL” respectively, and the original left view and the original right view are de-distorted to obtain the de-distorted original image.
  • the left view and the dewarped original right view are denoted as “BR” and “BL” respectively, and “BR” and “BL” are combined to form a stereo original image.
  • the parameters in the de-distortion processing are obtained by calibrating the camera, and the specific de-distortion processing and calibration process will not be repeated here.
  • the preset ratio can be set as required.
  • the maximum time difference supported by the current electronic device is 256.
  • the corresponding maximum calculated original image resolution is 1280 ⁇ 720; the binocular original image
  • the preset ratio can be set to 2, that is, the original binocular image needs to be reduced by 2 times.
  • Reduction refers to reducing the width and height of the image by a preset ratio. For example, if the resolution of the binocular original image is 1280 ⁇ 960 and the preset ratio is 2, the width of the left view will be reduced by 1/2, and the left view will be reduced by 1/2.
  • Step 202 Obtain a reduced parallax image of the reduced binocular image according to the reduced binocular image.
  • a preset scale and a current maximum supported disparity value may be obtained before acquiring the reduced disparity image of the binocular reduced image; the maximum supported disparity value of the reduced preset scale is used as a new maximum supported disparity value.
  • the maximum supported parallax value of the current device can be reduced according to a preset ratio.
  • the maximum supported parallax value of the device is 256, and the preset ratio is 2. Then take 128 as the currently calculated maximum supported disparity value. Taking the reduced left view "CL" and the reduced right view "CR" as the input image of the parallax image algorithm, and setting the maximum supported parallax value, the corresponding reduced parallax image Cdis can be calculated.
  • FIG. 5 is a schematic diagram of a reduced parallax image. The left side of the arrow in FIG.
  • FIG. 5 is a view in the reduced binocular image, and the right side is a reduced parallax image determined based on the reduced binocular image, wherein a grid in the reduced binocular image represents A pixel, a point represents the disparity value of that pixel.
  • Step 203 after transmitting the reduced parallax image to a designated application, generate a blank pixel image to be filled with parallax values according to the resolution of the binocular original image.
  • the blank pixel image to be filled with disparity value can be generated according to the resolution of the binocular original image. For example, if the resolution of the binocular original image is 16 ⁇ 12, the blank pixel image as shown in FIG. 6 can be generated, wherein, Each grid represents a pixel.
  • the reduced parallax image may be sent to a specified application, and the specified application may be an application that initiates a request to obtain a parallax image, such as an object recognition application, and the application may also be located on a robot.
  • the specified application may be an application that initiates a request to obtain a parallax image, such as an object recognition application, and the application may also be located on a robot.
  • the output of the reduced parallax image has a high frame rate and high speed.
  • Step 204 Determine the target disparity value of each pixel in the blank pixel image according to the preset ratio and each reduced disparity value in the reduced disparity image.
  • Determining the target disparity value of each pixel in the blank pixel image may adopt the sub-steps shown in FIG. 7 .
  • S21 Determine the first pixel position and the target disparity value of the first pixel position according to the preset ratio and the reduced disparity value.
  • the reduced parallax image includes pixels of m rows and n columns, where m and n are both integers greater than or equal to 0; the first pixel position and the target view of the first pixel position are determined according to the preset ratio and the reduced parallax value.
  • the difference value includes: performing the following processing on the reduced disparity value at the mth row and nth column position: taking the value of N ⁇ m as the row number of the first pixel position, and taking N ⁇ n as the column number of the first pixel position, Obtain each first pixel position, where N represents a preset ratio, and N is an integer greater than 1; and obtain N times the reduced disparity value as the target disparity value of the first pixel position.
  • Cm,n represents the reduced disparity value of the mth row and nth column in Cdis, where m and n are integers, and the initial values are 0. Since the reduced binocular image is obtained by reducing the preset ratio of the original binocular image, the resolution of the reduced parallax image may be adjusted to the resolution of the original binocular image according to the reduction relationship. The following describes the process of determining the first pixel position and the target disparity value of the first pixel position with a specific example.
  • the preset ratio is 2, and the reduced disparity value at the mth row and nth column position is processed as follows: 2m is used as the row number of the first pixel position, and 2n is used as the column number of the first pixel position; B2m, 2n Represents the target disparity value at the position of the 2mth row and the 2nth column, and obtains the reduced disparity value Cm,n of the mth row and the nth column, then the value of the B2m,2n is shown in formula (1):
  • m and n are both integers, and the initial value is 0, and the maximum value of m is equal to the horizontal pixel value of the reduced binocular image -1, and the maximum value of n is equal to the vertical pixel value of the reduced binocular image -1, such as , the resolution of the binocular reduced image is 640*480, the maximum value of m is equal to (640-1), and the maximum value of n is equal to (480-1).
  • the first pixel position is the position of the 0th row and the 0th column, and the target disparity value of the first pixel position is equal to 2C0,0.
  • all the first pixel positions and the target disparity values of all the first pixel positions in the blank pixel image can be determined.
  • the left side of the arrow is the reduced parallax image
  • the right side is the blank pixel image, wherein the position of the grid where the black dot is located is the first pixel position, and the black dot represents the target parallax value at the first pixel position.
  • S22 Determine the target disparity values of the remaining pixel positions according to the first pixel position and the target disparity value of the first pixel position.
  • the following processing is performed for each first pixel position: respectively obtaining the first pixel position adjacent to the first pixel position in the first direction and the first pixel position adjacent to the second direction; obtaining the first pixel position adjacent to the first pixel position in the first direction A pixel position, adjacent first pixel positions in the first direction, and blank pixel positions between adjacent first pixel positions in the second direction are used as positions to be filled for the first pixel position.
  • the two directions are perpendicular to each other; according to the target disparity value of the first pixel position, the target disparity value of the first pixel position adjacent to the first direction, and the target disparity value of the first pixel position adjacent to the second direction value, perform interpolation operation on the to-be-filled position of the first pixel position to obtain the target disparity value of the to-be-filled position.
  • the process of determining target disparity values of other pixel positions is described below with reference to FIG. 9 .
  • the position of row 0 and column 0 is marked as 0, the position of row 0 and column 2 is marked as 2, and the position of row 2 and column 0 is marked as 8;
  • the first direction of the first pixel position 0 is shown as a solid line
  • the direction shown, the second direction of the first pixel position 0 is the direction shown by the dashed arrow, the adjacent first pixel position in the first direction of the first pixel position 0 is position 2, and the first pixel 0 is in the first direction.
  • the position of the first pixel adjacent in the two directions is 8.
  • the blank pixel position between the 0 position and the 3 position is the a position
  • the blank pixel position between the 0 position and the 8 position is the b position
  • the blank pixel position between the 3 position and the 8 position is the b position.
  • the blank pixel position is the c position, so there are 3 blank pixel positions between the 0 position, the 3 position and the 8 position, which are the a position, the b position and the c position respectively; the a position, the b position and the c position are used as the 0
  • the to-be-populated location of the location In this way, the to-be-filled positions of all the first pixel positions in the blank pixel image are acquired.
  • first pixel positions in the column where the first pixel position 7 is located in FIG. 9 do not have other adjacent first pixel positions in the first direction, so the blank pixel positions in the column where the dotted line is located may not be filled , for the same reason, the blank pixels in the last row can also be left unfilled.
  • the interpolation operation is used to determine the target disparity value of the to-be-filled position of the first pixel position.
  • the target disparity values of the three to-be-filled positions can be calculated respectively by means of formula (2) to formula (4). value.
  • m and n are both integers, and the initial value is 0, and the maximum value of m is equal to the horizontal pixel value of the binocular reduced image -1, and the maximum value of n is equal to the vertical pixel value of the reduced binocular image -1.
  • Cm,n,Cm,n+1 are not 0 at the same time to ensure that B2m,2n+1 is not equal to 0.
  • Cm,n,Cm+1,n are not 0 at the same time to ensure that B2m+1,2n is not equal to 0.
  • B2m, 2n+1, B2m+1, 2n are not 0 at the same time to ensure that B2m+1, 2n+1 are not equal to 0.
  • the average value of the target disparity values of two adjacent first pixel positions may also be used as the target disparity value of the position to be filled.
  • the average value between the target disparity value at position 0 and the target disparity value at position 2 is taken as the target disparity value at position a; if the preset ratio is 4, then the blank pixels between adjacent first pixel positions include 3, and the average value of the target disparity values of two adjacent first pixel positions may also be used as the target disparity value of the three blank pixels.
  • Step 205 Fill corresponding pixels in the blank pixel image according to each target disparity value to generate a target disparity image.
  • smoothing is performed on the target parallax image; optimization processing is performed on the smoothed target time difference image to generate a new target parallax image, and the optimization processing includes: multi-frame temporal filtering and/or de-jitter processing.
  • the smoothing process may be implemented in the form of spatial filtering, so as to form continuous target disparity values and improve the accuracy of the target disparity image.
  • multi-frame temporal filtering and/or debounce processing may also be performed.
  • a third embodiment of the present disclosure relates to a method of acquiring parallax images.
  • the third embodiment is a further improvement of the second embodiment.
  • the main improvement lies in that a specified parallax image of a specified area in the binocular original image is obtained, and the specified parallax image is superimposed on the target parallax image to form a new target parallax image, its process is shown in Figure 11:
  • Step 301 Reduce at least one binocular original image according to a preset ratio to obtain a reduced binocular image, wherein the binocular original image is composed of a left view and a right view.
  • Step 302 Obtain a reduced parallax image of the reduced binocular image according to the reduced binocular image.
  • Step 303 after transmitting the reduced parallax image to the designated application, generate a blank pixel image to be filled with parallax values according to the resolution of the binocular original image.
  • Step 304 Determine the target disparity value of each pixel in the blank pixel image according to the preset ratio and each reduced disparity value in the reduced disparity image.
  • Step 305 Fill corresponding pixels in the blank pixel image according to each target parallax value to generate a target parallax image.
  • Steps 301 to 305 are substantially the same as steps 201 to 205 in the second embodiment, and will not be repeated here.
  • Step 306 Acquire an image of a designated area in the binocular original image.
  • the image of the designated area in the binocular original image may be the area where the object to be recognized is located. For example, taking the area where the cup is located as the designated area, the image of the designated area of the left view in the binocular original image can be obtained, and the Image of the specified area in the right view in the binocular original image.
  • Step 307 Acquire a designated parallax image of the image in the designated area according to the image in the designated area.
  • the designated parallax image of the image in the designated area is acquired according to the method of step 302 .
  • Step 308 After transmitting the specified parallax image to the specified application, superimpose the specified parallax image on the specified area corresponding to the target parallax image to generate a new target parallax image.
  • a new target parallax image can be generated by superimposing the specified parallax image on the target parallax image.
  • the specified parallax image is superimposed on the target parallax image. Since the specified parallax image is determined based on an unreduced specified area, the accuracy of the specified parallax image is high, thereby improving the accuracy of the new target parallax image .
  • FIG. 12 is a schematic diagram of an apparatus for acquiring parallax images according to the fourth embodiment of the present disclosure.
  • the apparatus for acquiring parallax images includes: a binocular reduced image acquisition module 401 , a reduced parallax image acquisition module 402 and a target parallax image generation module 403 . in:
  • the binocular reduced image obtaining module 401 is configured to reduce at least one binocular original image according to a preset ratio to obtain a binocular reduced image.
  • the binocular original image includes a left view and a right view.
  • the reduced parallax image obtaining module 402 is configured to obtain a reduced parallax image of the reduced binocular image according to the reduced binocular image.
  • the target parallax image generation module 403 is configured to, after transmitting the reduced parallax image to a specified application, adjust the resolution of the reduced parallax image to the resolution of the binocular original image, and generate the binocular original image target disparity image.
  • the target parallax image generation module includes: a blank pixel image generation unit for generating blank pixels to be filled with parallax values according to the resolution of the binocular original image after transmitting the reduced parallax image to a specified application an image; a target disparity value determination unit, configured to determine the target disparity value of each pixel in the blank pixel image according to the preset ratio and each of the reduced disparity values in the reduced disparity image; A target parallax value generating unit, configured to fill corresponding pixels in the blank pixel image according to each target parallax value, to generate the target parallax image.
  • the target disparity value determining unit includes: a first determining subunit, configured to determine a first pixel position and a target viewing angle of the first pixel position according to the preset ratio and the reduced disparity value difference value; a second determination subunit, configured to determine target disparity values of the remaining pixel positions according to the first pixel position and the target disparity value of the first pixel position.
  • the reduced parallax image includes pixels of m rows and n columns, where m and n are both integers greater than or equal to 0; the first pixel position and the first pixel position and the first pixel position are determined according to the preset ratio and the reduced parallax value.
  • the target disparity value at the pixel position includes: performing the following processing on the reduced disparity value at the mth row and nth column position: taking the value of N*m as the row number of the first pixel position, and taking N*n as the row number of the first pixel position
  • the number of columns of a pixel position is obtained for each of the first pixel positions, where N represents a preset ratio, and N is an integer greater than 1; N times the reduced disparity value is obtained as the first pixel position Target disparity value.
  • Determining the target disparity values of the remaining pixel positions according to the first pixel position and the target disparity value of the first pixel position includes: performing the following processing for each of the first pixel positions: separately obtaining the first pixel position.
  • the target disparity value of the position, the target disparity value of the first pixel position adjacent in the first direction, and the target disparity value of the first pixel position adjacent in the second direction, for the first pixel position Perform interpolation operation on the to-be-filled position to obtain the target disparity value of the to-be-filled position.
  • the device further includes: a designated area image acquisition module for acquiring an image of a designated area in the binocular original image; a designated parallax image acquisition module for acquiring the designated area according to the image in the designated area The specified parallax image of the image of the area; the target parallax image generation module is further configured to superimpose the specified parallax image on the specified area corresponding to the target parallax image after transmitting the specified parallax image to the specified application above, generate a new target disparity image.
  • the apparatus further includes: a smoothing processing module, configured to perform smoothing processing on the target parallax image;
  • An optimization processing module configured to perform optimization processing on the smoothed target time difference image to generate a new target parallax image, where the optimization processing includes: multi-frame time domain filtering and/or de-jitter processing.
  • the apparatus further includes: a maximum supported disparity value module, configured to acquire the preset scale and the current maximum supported disparity value, and use the maximum supported disparity value reduced by the preset scale as a new maximum supported disparity value difference.
  • a maximum supported disparity value module configured to acquire the preset scale and the current maximum supported disparity value, and use the maximum supported disparity value reduced by the preset scale as a new maximum supported disparity value difference.
  • the fifth embodiment of the present disclosure relates to an electronic device, the structure of which is shown in FIG. 13 , and includes: at least one processor 501 ; and a memory 502 communicatively connected to the at least one processor; wherein the memory stores Instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method of obtaining a parallax image.
  • the memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus links one or more processors and various circuits of the memory together.
  • the bus may also link together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein.
  • the bus interface provides the interface between the bus and the transceiver.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory may be used to store data used by the processor in performing operations.
  • the sixth embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned method for acquiring a parallax image is implemented.
  • Embodiments of the present disclosure also provide a computer program, including instructions, which, when executed on a computer, cause the computer to execute the above-described method for obtaining parallax images.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

本公开涉及视觉领域,提供了一种获取视差图像的方法、装置、电子设备、存储介质及计算机程序。所述方法包括:按照预设比例缩小输入的至少一对双目原始图像,获得至少一对双目缩小图像;根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。采用本实施例,能够减少视差图像的计算量,提高获取视差图像的帧率,降低获取成本,同时提高设备支持的最大视差。

Description

获取视差图像的方法、装置、电子设备、存储介质及计算机程序
交叉引用
本申请要求于2021年01月11日提交中国专利局、申请号为202110034180.5,发明名称为“获取视差图像的方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及视觉领域,特别涉及一种获取视差图像的方法、装置、电子设备、存储介质及计算机程序。
背景技术
在双目立体视觉中,计算视差图像常用的算法有半全局块匹配(semi-global block matching,SGBM)和半全局匹配(semi-global matching,SGM)等,这些算法基本的处理流程包括:代价计算,代价聚合,视差计算,视差优化四个步骤,整个过程的计算量非常大。其中,视差图像是以图像对中任一幅图像为基准,其大小为该基准图像的大小,元素值为视差的图像。
然而,目前为了提升计算视差图像的速度,通常做法是将算法固化到硬件,或是使用GPU等高性能计算机,不仅成本高,还普遍存在着一些问题,例如,随着原始图像分辨率的增加(如分辨率为:1280×720),对应的视差图像的计算量也随之增大,导致算法的输出帧率降低,难以满足实时获取视差图像的应用场景;再如,双目视觉设备距离被摄物体越近,视差越大,视差图像的计算量也将增加,而受到计算设备的计算资源的限制,目前设备支持的最大视差通常比较小,如支持视差64、128等,这导致双目视觉设备不能近距离使用。
发明内容
本公开实施方式的目的在于提供一种获取视差图像的方法、电子设备、存储介质及计算机程序,能够减少视差图像的计算量,提高获取视差图像的帧率,降低获取成本,同时提高设备支持的最大视差。
为解决上述技术问题,本公开的实施方式提供了一种获取视差图像的方法,包括:
按照预设比例缩小至少一个双目原始图像,获得双目缩小图像;根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。
进一步的,所述双目原始图像包括左视图和右视图。
本申请实施例中,根据预设比例缩小至少一个双目原始图像,获得至少一个双目缩小图像,根据该对双目缩小图像生成缩小视差图像,一个双目原始图像包括左视图和右视图,由于缩小后的左视图和缩小后的右视图中包含的像素少,使得对应生成的缩小视差图像的计算量少,速度快,而缩小视差图像与该双目缩小图像的分辨率相同,故该缩小视差图像的数据量也变少,使得将该缩小视差图像传输至指定应用的速度快,提高获取缩小视差图像的帧率,以便指定应用可以快速基于该缩小视差图像还原为双目原始图像的目标视差图像,提高获取目标视差图像的速度;由于无需安装高成本的固化硬件,降低获取成本,同时可以按照预设比例进行缩小,使得可以支持的更大的最大视差,即可以使用更高的分辨率的双目原始图像。
进一步的,获取所述双目原始图像中的指定区域的图像;根据所述指定区域的图像,获取所述指定区域的图像的指定视差图像;在传输所述指定视差图像至所述指定应用后,将所述指定视差图像叠加在所述目标视差图像对应的指定区域上,生成新的所述目标视差图像。将该指定视差图像叠加在目标视差图像上,由于指定视差图像是基于未缩小的指定区域确定,该指定视差图像的准确度高,进而提升了新的目标视差图像的准确度。
进一步的,在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像,包括:根据所述双目原始图像的分辨率,生成待填充视差 值的空白像素图像;根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值;根据每个所述目标视差值,填充所述空白像素图像中对应的像素,生成所述目标视差图像。通过缩小视差图像中的缩小视差值确定出空白像素图像中每个像素的目标视差值,确定速度快。
进一步的,根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值,包括:根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值;根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值。
进一步的,缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值,包括:
针对第m行第n列位置的所述缩小视差值进行如下处理:将N×m的值作为第一像素位置的行数,将N*n作为第一像素位置的列数,获取每个所述第一像素位置,其中,N表示预设比例,N为大于1的整数;获取N倍的所述缩小视差值作为所述第一像素位置的目标视差值。提供了一种快速确定第一像素位置以及该第一像素位置的目标视差值的方式。
进一步的,根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值,包括:针对每个所述第一像素位置进行如下处理:分别获取所述第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;获取所述第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为所述第一像素位置的待填充位置,所述第一方向和所述第二方向相互垂直;根据所述第一像素位置的目标视差值、在第一方向上相邻的第一像素位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对所述第一像素位置的待填充位置进行插值运算,获得所述第一像素位置的待填充位置的目标视差值。按照固定的方向确定该第一像素位置周围的其它像素对应的目标视差值,避免漏填充的情况,同时基于第一像素位置的目标视差值、在第一方向上相邻的第一像素位置 的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,确定待填充位置的目标视差值,使得确定的待填充位置的目标视差值更为准确。
进一步的,该方法还包括,包括:对所述目标视差图像进行平滑处理;对平滑处理后的所述目标时差图像进行优化处理,生成新的目标视差图像,所述优化处理包括:多帧时域滤波和/或去抖动处理。通过平滑处理使得目标视差图像更为准确。
进一步的,在所述根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像之前,所述方法还包括:获取所述预设比例以及当前最大支持视差值;将缩小预设比例的所述最大支持视差值作为新的最大支持视差值。
本公开的实施方式还提供了一种获取视差图像的装置,其特征在于,包括:
双目缩小图像获取模块,用于按照预设比例缩小至少一个双目原始图像,获得双目缩小图像;
缩小视差图像获取模块,用于根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;
目标视差图像生成模块,用于在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。
进一步的,所述双目原始图像包括左视图和右视图。
进一步的,所述装置还包括:
指定区域图像获取模块,用于获取所述双目原始图像中的指定区域的图像;
指定视差图像获取模块,用于根据所述指定区域的图像,获取所述指定区域的图像的指定视差图像;
所述目标视差图像生成模块,还用于在传输所述指定视差图像至所述指定应用后,将所述指定视差图像叠加在所述目标视差图像对应的指定区域上,生成新的所述目标视差图像。
进一步的,所述目标视差图像生成模块,包括:
空白像素图像生成单元,用于在传输所述缩小视差图像至指定应用后,根据所述双目原始图像的分辨率,生成待填充视差值的空白像素图像;
目标视差值确定单元,用于根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值;
目标视差值生成单元,用于根据每个所述目标视差值,填充所述空白像素图像中对应的像素,生成所述目标视差图像。
进一步的,所述目标视差值确定单元,包括:
第一确定子单元,用于根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值;
第二确定子单元,用于根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值。
进一步的,所述缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;所述根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值,包括:针对第m行第n列位置的所述缩小视差值进行如下处理:将N*m的值作为第一像素位置的行数,将N*n作为第一像素位置的列数,获取每个所述第一像素位置,其中,N表示预设比例,N为大于1的整数;获取N倍的所述缩小视差值作为所述第一像素位置的目标视差值。
进一步的,根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值,包括:针对每个所述第一像素位置进行如下处理:分别获取所述第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;获取所述第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为所述第一像素位置的待填充位置,所述第一方向和所述第二方向相互垂直;根据所述第一像素位置的目标视差值、在第一方向上相邻的第一像素位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对所述第一像素位置的待填充位置进行插值运算,获得所述待填充位置的目标视差值。
进一步的,所述装置还包括:
平滑处理模块,用于对所述目标视差图像进行平滑处理;
优化处理模块,用于对平滑处理后的所述目标时差图像进行优化处理,生成新的目标视差图像,所述优化处理包括:多帧时域滤波和/或去抖动处理。
进一步的,所述装置还包括:
最大支持视差值模块,用于获取所述预设比例以及当前最大支持视差值,将缩小预设比例的所述最大支持视差值作为新的最大支持视差值。
本公开的实施方式还提供了一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的获取视差图像的方法。
本公开的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述的获取视差图像的方法。
本公开的实施方式还提供了一种计算机程序,包括指令,当其在计算机上运行时,使得计算机执行上述的获取视差图像的方法。
本公开实施例提供了一种获取视差图像的方法、装置、电子设备、存储介质及计算机程序。所述方法包括:按照预设比例缩小输入的至少一对双目原始图像,获得至少一对双目缩小图像;根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。采用本实施例,能够减少视差图像的计算量,提高获取视差图像的帧率,降低获取成本,同时提高设备支持的最大视差。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是根据本公开中提供的视差图像的示意图;
图2是根据本公开第一实施例中提供的一种获取视差图像的方法的流程图;
图3是根据本公开第二实施例中提供的一种获取视差图像的方法的流程图;
图4是根据本公开第二实施例中提供的一种变换为双目缩小视图的示意图;
图5是根据本公开第二实施例中提供的一种变换为缩小视差图像的示意图;
图6是根据本公开第二实施例中提供的一种空白像素图像的示意图;
图7是根据本公开第二实施例中提供的确定该空白像素图像中每个像素的目标视差值的一种具体实现示意图;
图8是根据本公开第二实施例中提供的一种第一像素位置的示意图;
图9是根据本公开第二实施例中提供的确定其他像素的目标视差值的示意图;
图10是根据本公开第二实施例中提供的生成目标视差图像的示意图;
图11是根据本公开第三实施例中提供的一种获取视差图像的方法的示意图;
图12是根据本公开第第四实施例中提供的一种获取视差图像的装置示意图;
图13是根据本公开第五实施例中提供的一种电子设备的结构框图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合附图对本公开的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本公开各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。
以下各个实施例的划分是为了描述方便,不应对本公开的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。
现有的双目立体视觉方案中,图像的分辨率通常小于或等于1280×720。低分辨率不利于依赖原始图像内容进行信息挖掘的设备的开发,比如:对图像中的物体识别的装置。而若提高分辨率,视差图像的计算量将变大,导致输出视差图像的帧率降低,同时较大数据量的视差图也需要更高带宽进行传输,难以应用于实时性要求较高的场景。
物体离双目摄像机越近,视差将越大,视差图像的计算量也相应增大。而目前已有的方案中,最大视差通常小于256,例如,一般设备支持的最大视差值为64或者128,导致无法双目视觉装置无法获取更近处物体的视差图像。此外,现有的双目立体视觉方案中,输出的视差图分辨率与原图基本一致,在带宽有限的情况下,传输的帧率较低,如图1所示,图1中左侧为原照片,右侧为该原照片的视差图像,该视差图像的分辨率与原照片的分辨率相同。
本公开的第一实施方式涉及一种获取视差图像的方法,其流程如图2所示:
步骤101:按照预设比例缩小至少一个双目原始图像,获得双目缩小图像,其中,双目原始图像由左视图和右视图组成。
步骤102:根据双目缩小图像,获取双目缩小图像的缩小视差图像。
步骤103:在传输缩小视差图像至指定应用后,将缩小视差图像分辨率调整为双目原始图像的分辨率,生成双目原始图像的目标视差图像。
本申请实施例中,根据预设比例缩小至少一个双目原始图像,获得至少一个双目缩小图像,根据该对双目缩小图像生成缩小视差图像,一个双 目原始图像包括左视图和右视图,由于缩小后的左视图和缩小后的右视图中包含的像素少,使得对应生成的缩小视差图像的计算量少,速度快,而缩小视差图像与该双目缩小图像的分辨率相同,故该缩小视差图像的数据量也变少,使得将该缩小视差图像传输至指定应用的速度快,提高获取缩小视差图像的帧率,以便指定应用可以快速基于该缩小视差图像还原为双目原始图像的目标视差图像,提高获取目标视差图像的速度;由于无需安装高成本的固化硬件,降低获取成本,同时可以按照预设比例进行缩小,使得可以支持的更大的最大视差,即可以使用更高的分辨率的双目原始图像。
本公开的第二实施方式涉及一种获取视差图像的方法。第二实施方式是对第一实施方式的详细介绍,其流程如图3所示。
步骤201:按照预设比例缩小至少一个双目原始图像,获得双目缩小图像,其中,双目原始图像由左视图和右视图组成。
本示例中的方法应用在具有双目视觉装置的设备中,如:机器人。该双目视觉装置可以包括至少两个图像采集装置,例如,间隔设置的2个摄像头、间隔设置的3个摄像头。若包括3个以上的摄像头时,该双目视觉装置在同一时刻选取两个摄像头组成一对,进行图像采集。一个双目原始图像包括左视图和右视图。一个双目原始图像的分辨率可以设置为高分辨率,以提高该对该双目原始图像的识别,其中,大于1280×720的分辨率可以为高分辨率,例如,双目原始图像为高分辨率:1280×960,即该双目原始图像中的左视图和右视图的分辨率均为1280×960。
需要说明的是,双目视觉装置采集的原始左视图和原始右视图分别记为“AR”和“AL”,对该原始左视图和原始右视图进行去畸变处理,得到去畸变处理后的原始左视图和去畸变处理后的原始右视图,分别记为“BR” 和“BL”,将“BR”和“BL”组成一个双目原始图像。去畸变处理中的参数是通过对相机标定得到,具体的去畸变处理及标定的过程此处不再进行赘述。
本示例中,预设比例可以根据需要进行设置,例如,当前电子设备支持的最大时差为256,通常最大视差256时,对应的最大计算的原始图像的分辨率为1280×720;双目原始图像的分辨率为1280×960,则可以将该预设比例设置为2,即需要对该双目原始图像缩小2倍。缩小是指将图像的宽度和高度均缩小预设比例,例如,双目原始图像的分辨率为1280×960,预设比例为2,则将该左视图的宽度缩小1/2,将左视图的高度缩小1/2;将右视图的宽度缩小1/2,右视图的高度缩小1/2,得到分辨率为640x480的视图,将缩小后的左视图记为“CL”,将缩小后的右视图记为“CR”如图4所示,箭头左侧为双目原始图像中的一个视图,右侧为缩小后的视图。
步骤202:根据双目缩小图像,获取双目缩小图像的缩小视差图像。
在一个例子中,在获取双目缩小图像的缩小视差图像之前,可以获取预设比例以及当前最大支持视差值;将缩小预设比例的最大支持视差值作为新的最大支持视差值。
具体地,获取视差图像需要设置最大支持视差值,本示例中,可以按照预设比例缩小当前设备的最大支持视差值,例如,该设备的最大支持视差为256,预设比例为2,那么将128作为当前的计算的最大支持视差值。将缩小后的左视图“CL”,将缩小后的右视图“CR”作为视差图像算法的输入图像,设置最大支持视差值,即可计算得到对应的缩小视差图像Cdis。图5为缩小视差图像的一个示意图,图5中箭头左侧为双目缩小图像中的一个视图,右侧为基于双目缩小图像确定的缩小视差图像,其中,双目缩 小图像中一个格子表示一个像素,一个点表示该像素的视差值。
步骤203:在传输缩小视差图像至指定应用后,根据双目原始图像的分辨率,生成待填充视差值的空白像素图像。
具体地,可以按照双目原始图像的分辨率生成待填充视差值得空白像素图像,例如,双目原始图像的分辨率为16×12,那么可以生成如图6所示的空白像素图像,其中,每个格子表示一个像素。
需要说明的是,可以将该缩小视差图像发送至指定应用,指定应用可以是发起获取视差图像请求的应用,例如,物体识别应用等,该应用还可以位于机器人上。
值得一提的是,由于缩小视差图像的数据量小,无需使用高带宽进行传输,同时与其它获取视差图像的方式相比,在相同带宽下,输出该缩小视差图像的帧率高,速度快。
步骤204:根据预设比例以及缩小视差图像中的每个缩小视差值,确定空白像素图像中每个像素的目标视差值。
确定该空白像素图像中每个像素的目标视差值可以采用如图7所示的子步骤。
S21:根据预设比例以及缩小视差值,确定第一像素位置以及第一像素位置的目标视差值。
在一个例子中,缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;根据预设比例以及缩小视差值,确定第一像素位置以及第一像素位置的目标视差值,包括:针对第m行第n列位置的缩小视差值进行如下处理:将N×m的值作为第一像素位置的行数,将N×n作为第一 像素位置的列数,获取每个第一像素位置,其中,N表示预设比例,N为大于1的整数;获取N倍的缩小视差值作为第一像素位置的目标视差值。
本示例中以Cm,n表示Cdis中第m行第n列的缩小视差值,m,n均为整数,初始值均为0。由于双目缩小图像是基于双目原始图像缩小预设比例获得,可以根据缩小的关系,将该缩小视差图像的分辨率调整为双目原始图像的分辨率。下面以具体的例子介绍确定第一像素位置以及第一像素位置的目标视差值的过程。
例如,预设比例为2,针对第m行第n列位置的缩小视差值进行如下处理:将2m作为第一像素位置的行数,将2n作为第一像素位置的列数;B2m,2n表示第2m行第2n列位置的目标视差值,获取该m行第n列的缩小视差值Cm,n,那么该B2m,2n的值如公式(1)所示:
B2m,2n=2Cm,n    公式(1);
其中,m和n均为整数,且初始值均为0,且m的最大值等于双目缩小图像的水平像素值-1,n的最大值等于双目缩小图像的垂直像素值-1,如,双目缩小图像的分辨率为640*480,那m的最大值等于(640-1),n的最大值等于(480-1)。
若m=n=0,则第一像素位置为第0行第0列的位置,该第一像素位置的目标视差值等于2C0,0。
按照上述处理即可确定出该空白像素图像中所有第一像素位置以及所有第一像素位置的目标视差值。如图8所示,箭头左侧为缩小视差图像,右侧为空白像素图像,其中,黑点所在格子的位置为第一像素位置,黑点表示该第一像素位置的目标视差值。
S22:根据第一像素位置以及第一像素位置的目标视差值,确定其余 像素位置的目标视差值。
在一个例子中,针对每个第一像素位置进行如下处理:分别获取第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;获取第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为第一像素位置的待填充位置,第一方向和第二方向相互垂直;根据第一像素位置的目标视差值、在第一方向上相邻的第一像素位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对第一像素位置的待填充位置进行插值运算,获得待填充位置的目标视差值。
具体地,下面结合图9介绍确定其它像素位置的目标视差值的过程。图9中,针对第0行第0列位置标记为0,该第0行第2列位置标记为2,第2行第0列位置标记为8;第一像素位置0的第一方向如实线所示方向,该第一像素位置0的第二方向如虚线箭头所示方向,该第一像素位置0的第一方向上相邻的第一像素位置为2位置,该第一像素0在第二方向上相邻的第一像素位置为8,由于0位置与3位置之间的空白像素为a位置,0位置和8位置之间的空白像素位置为b位置,3位置和8位置之间的空白像素位置为c位置,故0位置、3位置以及8位置之间包括3个标空白像素位置,分别为a位置、b位置和c位置;将a位置、b位置和c位置作为该0位置的待填充位置。按照该方式获取该空白像素图像中所有第一像素位置的待填充位置。
需要说明的是,图9中第一像素位置7所在列的其它第一像素位置,在第一方向上没有其它相邻的第一像素位置,故该虚线所在列的空白像素位置可以不进行填充,同理,最后一行空白像素也可以不进行填充。
故本示例中采用插值运算确定第一像素位置的待填充位置的目标视 差值,本示例中可以采用公式(2)~公式(4)的方式分别计算出3个待填充位置的目标视差值。
B2m,2n+1=Cm,n+Cm,n+1    公式(2);
其中,m和n均为整数,且初始值均为0,且m的最大值等于双目缩小图像的水平像素值-1,n的最大值等于双目缩小图像的垂直像素值-1。Cm,n,Cm,n+1同时非0,以确保B2m,2n+1不等于0。
B2m+1,2n=Cm,n+Cm+1,n    公式(3);
其中Cm,n,Cm+1,n同时非0,以确保B2m+1,2n不等于0。
B2m+1,2n+1=(B2m,2n+1+B2m+1,2n)/2    公式(4);
其中,B2m,2n+1,B2m+1,2n同时非0,以确保B2m+1,2n+1不等于0。
需要说明的是,还可以将相邻两个第一像素位置的目标视差值的均值作为待填充位置的目标视差值。例如,将0位置的目标视差值和2位置的目标视差值之间的均值作为a位置的目标视差值;若预设比例为4,那么相邻第一像素位置之间空白像素包括3个,也可以将相邻两个第一像素位置的目标视差值的均值作为该3个空白像素的目标视差值。
步骤205:根据每个目标视差值,填充空白像素图像中对应的像素,生成目标视差图像。
将确定的目标视差值填充至空白像素图像中对应的像素,生成目标视差图像。如图10所示的目标视差图像。
在一个例子中,对目标视差图像进行平滑处理;对平滑处理后的目标时差图像进行优化处理,生成新的目标视差图像,优化处理包括:多帧时 域滤波和/或去抖动处理。
具体地,平滑处理可以是空间滤波的方式实现,以形成连续的目标视差值,提高目标视差图像的准确性。在平滑处理后,还可以进行多帧时域滤波和/或去抖动处理。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本公开第三实施方式涉及一种获取视差图像的方法。第三实施方式是对第二实施方式的进一步改进,主要改进之处在于,获取双目原始图像中指定区域的指定视差图像,将该指定视差图像叠加在目标视差图像上,形成新的目标视差图像,其流程如图11所示:
步骤301:按照预设比例缩小至少一个双目原始图像,获得双目缩小图像,其中,所述双目原始图像由左视图和右视图组成。
步骤302:根据双目缩小图像,获取双目缩小图像的缩小视差图像。
步骤303:在传输缩小视差图像至指定应用后,根据双目原始图像的分辨率,生成待填充视差值的空白像素图像。
步骤304:根据预设比例以及缩小视差图像中的每个缩小视差值,确定空白像素图像中每个像素的目标视差值。
步骤305:根据每个目标视差值,填充空白像素图像中对应的像素,生成目标视差图像。
步骤301至步骤305与第二实施方式中步骤201至步骤205大致相同,此处将不再赘述。
步骤306:获取双目原始图像中的指定区域的图像。
具体地,双目原始图像中的指定区域的图像可以是待识别物体所处区域,例如,将杯子所在区域作为指定区域,则可以获取双目原始图像中左视图的指定区域的图像,以及获取双目原始图像中右视图中指定区域的图像。
步骤307:根据指定区域的图像,获取指定区域的图像的指定视差图像。
根据左视图中指定区域的图像和右视图中指定区域的图下个,按照步骤302的方式获取该指定区域的图像的指定视差图像。
步骤308:在传输指定视差图像至指定应用后,将指定视差图像叠加在目标视差图像对应的指定区域上,生成新的目标视差图像。
在目标视差图像上叠加指定视差图像,即可生成新的目标视差图像。
本实施例中,将该指定视差图像叠加在目标视差图像上,由于指定视差图像是基于未缩小的指定区域确定,该指定视差图像的准确度高,进而提升了新的目标视差图像的准确度。
图12是根据本公开第第四实施例中提供的一种获取视差图像的装置示意图。该获取视差图像的装置包括:双目缩小图像获取模块401、缩小视差图像获取模块402和目标视差图像生成模块403。其中:
所述双目缩小图像获取模块401,用于按照预设比例缩小至少一个双目原始图像,获得双目缩小图像。所述双目原始图像包括左视图和右视图。
所述缩小视差图像获取模块402,用于根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像。
所述目标视差图像生成模块403,用于在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。
所述目标视差图像生成模块,包括:空白像素图像生成单元,用于在传输所述缩小视差图像至指定应用后,根据所述双目原始图像的分辨率,生成待填充视差值的空白像素图像;目标视差值确定单元,用于根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值;目标视差值生成单元,用于根据每个所述目标视差值,填充所述空白像素图像中对应的像素,生成所述目标视差图像。
其中,所述目标视差值确定单元,包括:第一确定子单元,用于根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值;第二确定子单元,用于根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值。所述缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;所述根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值,包括:针对第m行第n列位置的所述缩小视差值进行如下处理:将N*m的值作为第一像素位置的行数,将N*n作为第一像素位置的列数,获取每个所述第一像素位置,其中,N表示预设比例,N为大于1的整数;获取N倍的所述缩小视差值作为所述第一像素位置的目标视差值。根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值,包括:针对每个所述第一像素位置进行 如下处理:分别获取所述第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;获取所述第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为所述第一像素位置的待填充位置,所述第一方向和所述第二方向相互垂直;根据所述第一像素位置的目标视差值、在第一方向上相邻的第一像素位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对所述第一像素位置的待填充位置进行插值运算,获得所述待填充位置的目标视差值。
另外,所述装置还包括:指定区域图像获取模块,用于获取所述双目原始图像中的指定区域的图像;指定视差图像获取模块,用于根据所述指定区域的图像,获取所述指定区域的图像的指定视差图像;所述目标视差图像生成模块,还用于在传输所述指定视差图像至所述指定应用后,将所述指定视差图像叠加在所述目标视差图像对应的指定区域上,生成新的所述目标视差图像。
另外,所述装置还包括:平滑处理模块,用于对所述目标视差图像进行平滑处理;
优化处理模块,用于对平滑处理后的所述目标时差图像进行优化处理,生成新的目标视差图像,所述优化处理包括:多帧时域滤波和/或去抖动处理。
另外,所述装置还包括:最大支持视差值模块,用于获取所述预设比例以及当前最大支持视差值,将缩小预设比例的所述最大支持视差值作为新的最大支持视差值。
本公开第五实施方式涉及一种电子设备,其结构如图13所示,包括:至少一个处理器501;以及,与所述至少一个处理器通信连接的存储器502; 其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的获取视差图像的方法。
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路链接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。
本公开第六实施方式涉及一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述的获取视差图像的方法。
本公开的实施方式还提供了一种计算机程序,包括指令,当其在计算机上运行时,使得计算机执行上述的获取视差图像的方法。
本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种 可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本公开的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本公开的精神和范围。

Claims (21)

  1. 一种获取视差图像的方法,其特征在于,包括:
    按照预设比例缩小至少一个双目原始图像,获得双目缩小图像;
    根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;
    在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。
  2. 根据权利要求1所述的获取视差图像的方法,其特征在于,所述双目原始图像包括左视图和右视图。
  3. 根据权利要求1所述的获取视差图像的方法,其特征在于,所述方法还包括:
    获取所述双目原始图像中的指定区域的图像;
    根据所述指定区域的图像,获取所述指定区域的图像的指定视差图像;
    在传输所述指定视差图像至所述指定应用后,将所述指定视差图像叠加在所述目标视差图像对应的指定区域上,生成新的所述目标视差图像。
  4. 根据权利要求1至3中任一项所述的获取视差图像的方法,其特征在于,所述在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像,包括:
    在传输所述缩小视差图像至指定应用后,根据所述双目原始图像的分辨率,生成待填充视差值的空白像素图像;
    根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值;
    根据每个所述目标视差值,填充所述空白像素图像中对应的像素,生成所述目标视差图像。
  5. 根据权利要求4所述的获取视差图像的方法,其特征在于,根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值,包括:
    根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值;
    根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值。
  6. 根据权利要求5所述的获取视差图像的方法,其特征在于,所述缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;
    所述根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值,包括:
    针对第m行第n列位置的所述缩小视差值进行如下处理:
    将N*m的值作为第一像素位置的行数,将N*n作为第一像素位置的列数,获取每个所述第一像素位置,其中,N表示预设比例,N为大于1的整数;
    获取N倍的所述缩小视差值作为所述第一像素位置的目标视差值。
  7. 根据权利要求5所述的获取视差图像的方法,其特征在于,根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值,包括:
    针对每个所述第一像素位置进行如下处理:
    分别获取所述第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;
    获取所述第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为所述第一像素位置的待填充位置,所述第一方向和所述第二方向相互垂直;
    根据所述第一像素位置的目标视差值、在第一方向上相邻的第一像素 位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对所述第一像素位置的待填充位置进行插值运算,获得所述待填充位置的目标视差值。
  8. 根据权利要求5至7中任一项所述的获取视差图像的方法,其特征在于,所述方法还包括,包括:
    对所述目标视差图像进行平滑处理;
    对平滑处理后的所述目标时差图像进行优化处理,生成新的目标视差图像,所述优化处理包括:多帧时域滤波和/或去抖动处理。
  9. 根据权利要求6至7中任一项所述的获取视差图像的方法,其特征在于,在所述根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像之前,所述方法还包括:
    获取所述预设比例以及当前最大支持视差值;
    将缩小预设比例的所述最大支持视差值作为新的最大支持视差值。
  10. 一种获取视差图像的装置,其特征在于,包括:
    双目缩小图像获取模块,用于按照预设比例缩小至少一个双目原始图像,获得双目缩小图像;
    缩小视差图像获取模块,用于根据所述双目缩小图像,获取所述双目缩小图像的缩小视差图像;
    目标视差图像生成模块,用于在传输所述缩小视差图像至指定应用后,将所述缩小视差图像分辨率调整为所述双目原始图像的分辨率,生成所述双目原始图像的目标视差图像。
  11. 根据权利要求10所述的获取视差图像的装置,其特征在于,所述双目原始图像包括左视图和右视图。
  12. 根据权利要求10所述的获取视差图像的装置,其特征在于,所述装置还包括:
    指定区域图像获取模块,用于获取所述双目原始图像中的指定区域的 图像;
    指定视差图像获取模块,用于根据所述指定区域的图像,获取所述指定区域的图像的指定视差图像;
    所述目标视差图像生成模块,还用于在传输所述指定视差图像至所述指定应用后,将所述指定视差图像叠加在所述目标视差图像对应的指定区域上,生成新的所述目标视差图像。
  13. 根据权利要求10至12中任一项所述的获取视差图像的装置,其特征在于,所述目标视差图像生成模块,包括:
    空白像素图像生成单元,用于在传输所述缩小视差图像至指定应用后,根据所述双目原始图像的分辨率,生成待填充视差值的空白像素图像;
    目标视差值确定单元,用于根据所述预设比例以及所述缩小视差图像中的每个所述缩小视差值,确定所述空白像素图像中每个像素的目标视差值;
    目标视差值生成单元,用于根据每个所述目标视差值,填充所述空白像素图像中对应的像素,生成所述目标视差图像。
  14. 根据权利要求13所述的获取视差图像的装置,其特征在于,所述目标视差值确定单元,包括:
    第一确定子单元,用于根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值;
    第二确定子单元,用于根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值。
  15. 根据权利要求14所述的获取视差图像的方法,其特征在于,所述缩小视差图像包括m行n列的像素,m和n均为大于等于0的整数;
    所述根据所述预设比例以及所述缩小视差值,确定第一像素位置以及所述第一像素位置的目标视差值,包括:
    针对第m行第n列位置的所述缩小视差值进行如下处理:
    将N*m的值作为第一像素位置的行数,将N*n作为第一像素位置的列数,获取每个所述第一像素位置,其中,N表示预设比例,N为大于1的整数;
    获取N倍的所述缩小视差值作为所述第一像素位置的目标视差值。
  16. 根据权利要求14所述的获取视差图像的装置,其特征在于,根据所述第一像素位置以及所述第一像素位置的目标视差值,确定其余像素位置的目标视差值,包括:
    针对每个所述第一像素位置进行如下处理:
    分别获取所述第一像素位置在第一方向上相邻的第一像素位置和在第二方向上相邻的第一像素位置;
    获取所述第一像素位置、在第一方向上相邻的第一像素位置以及在第二方向上相邻的第一像素位置之间空白的像素位置作为所述第一像素位置的待填充位置,所述第一方向和所述第二方向相互垂直;
    根据所述第一像素位置的目标视差值、在第一方向上相邻的第一像素位置的目标视差值以及在第二方向上相邻的第一像素位置的目标视差值,对所述第一像素位置的待填充位置进行插值运算,获得所述待填充位置的目标视差值。
  17. 根据权利要求14至16中任一项所述的获取视差图像的装置,其特征在于,所述装置还包括:
    平滑处理模块,用于对所述目标视差图像进行平滑处理;
    优化处理模块,用于对平滑处理后的所述目标时差图像进行优化处理,生成新的目标视差图像,所述优化处理包括:多帧时域滤波和/或去抖动处理。
  18. 根据权利要求15至16中任一项所述的获取视差图像的装置,其特征在于,所述装置还包括:
    最大支持视差值模块,用于获取所述预设比例以及当前最大支持视差 值,将缩小预设比例的所述最大支持视差值作为新的最大支持视差值。
  19. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1-9任一所述的获取视差图像的方法。
  20. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至9中任一项所述的获取视差图像的方法。
  21. 一种计算机程序,包括指令,当其在计算机上运行时,使得计算机执行根据权利要求1-9任一项所述的获取视差图像的方法。
PCT/CN2021/143444 2021-01-11 2021-12-30 获取视差图像的方法、装置、电子设备、存储介质及计算机程序 WO2022148307A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110034180.5A CN112767293B (zh) 2021-01-11 2021-01-11 获取视差图像的方法、电子设备及存储介质
CN202110034180.5 2021-01-11

Publications (1)

Publication Number Publication Date
WO2022148307A1 true WO2022148307A1 (zh) 2022-07-14

Family

ID=75701376

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143444 WO2022148307A1 (zh) 2021-01-11 2021-12-30 获取视差图像的方法、装置、电子设备、存储介质及计算机程序

Country Status (2)

Country Link
CN (1) CN112767293B (zh)
WO (1) WO2022148307A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112767293B (zh) * 2021-01-11 2023-04-11 达闼机器人股份有限公司 获取视差图像的方法、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160275691A1 (en) * 2015-03-18 2016-09-22 Politechnika Poznanska System and a method for generating a depth map
CN107358638A (zh) * 2017-07-19 2017-11-17 智车优行科技(北京)有限公司 视差图计算方法和装置、电子设备、计算机存储介质
CN108520536A (zh) * 2018-03-27 2018-09-11 海信集团有限公司 一种视差图的生成方法、装置及终端
CN110021055A (zh) * 2018-01-09 2019-07-16 纬创资通股份有限公司 产生视差图的方法及其图像处理装置与系统
CN112767293A (zh) * 2021-01-11 2021-05-07 达闼机器人有限公司 获取视差图像的方法、电子设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4998422B2 (ja) * 2008-09-25 2012-08-15 Kddi株式会社 画像生成装置、方法、通信システム及びプログラム
WO2012096054A1 (ja) * 2011-01-13 2012-07-19 富士フイルム株式会社 視差画像表示装置、視差画像表示方法及び視差画像表示プログラム
JP5949314B2 (ja) * 2012-08-20 2016-07-06 株式会社日本自動車部品総合研究所 視差マップ生成装置および視差マップ生成装置用のプログラム
CN110660088B (zh) * 2018-06-30 2023-08-22 华为技术有限公司 一种图像处理的方法和设备
CN111553850B (zh) * 2020-03-30 2023-10-24 深圳一清创新科技有限公司 基于双目立体视觉的三维信息获取方法和装置
CN111626927B (zh) * 2020-04-09 2023-05-30 上海交通大学 采用视差约束的双目图像超分辨率方法、系统及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160275691A1 (en) * 2015-03-18 2016-09-22 Politechnika Poznanska System and a method for generating a depth map
CN107358638A (zh) * 2017-07-19 2017-11-17 智车优行科技(北京)有限公司 视差图计算方法和装置、电子设备、计算机存储介质
CN110021055A (zh) * 2018-01-09 2019-07-16 纬创资通股份有限公司 产生视差图的方法及其图像处理装置与系统
CN108520536A (zh) * 2018-03-27 2018-09-11 海信集团有限公司 一种视差图的生成方法、装置及终端
CN112767293A (zh) * 2021-01-11 2021-05-07 达闼机器人有限公司 获取视差图像的方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN112767293B (zh) 2023-04-11
CN112767293A (zh) 2021-05-07

Similar Documents

Publication Publication Date Title
US9924153B2 (en) Parallel scaling engine for multi-view 3DTV display and method thereof
JP5561781B2 (ja) 2d画像データを立体画像データに変換する方法およびシステム
CN111047709B (zh) 一种双目视觉裸眼3d图像生成方法
WO2012068724A1 (zh) 立体图像获取系统及方法
US10586345B2 (en) Method for estimating aggregation results for generating three dimensional images
WO2020014901A1 (zh) 一种目标跟踪方法、装置、电子设备和可读存储介质
US11783447B2 (en) Methods and apparatus for optimized stitching of overcapture content
WO2022148307A1 (zh) 获取视差图像的方法、装置、电子设备、存储介质及计算机程序
US20240104770A1 (en) Three-dimensional scanning system and three-dimensional scanning method
WO2019223523A1 (zh) 图像处理方法、装置及三维成像系统
CN111295667A (zh) 图像立体匹配的方法和辅助驾驶装置
WO2018133027A1 (zh) 基于灰度约束的三维数字散斑的整像素搜索方法及装置
US10397540B2 (en) Method for obtaining and merging multi-resolution data
US10187623B2 (en) Stereo vision SoC and processing method thereof
US11288988B2 (en) Display control methods and apparatuses
EP4280615A1 (en) Image anti-shake method and electronic device
WO2022155950A1 (zh) 虚拟视点合成方法、电子设备和计算机可读介质
US20220028039A1 (en) Image restoration method and device
US20180227563A1 (en) Methods and devices for determining visual fatigue of three-dimensional image or video and computer readable storage medium
EP2839437B1 (en) View synthesis using low resolution depth maps
CN112365400A (zh) 一种快速光场角度超分辨重建方法
WO2023109871A1 (zh) 深度图的生成方法、装置、电子设备和存储介质
CN115131409B (zh) 一种基于深度学习的亲密矩阵视点合成方法、应用及系统
CN104103034A (zh) 超分辨率图像处理方法及其图像处理装置
KR101832940B1 (ko) 스테레오 영상 처리 장치 및 방법

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: 21917346

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.11.2023)