CN116681746B - Depth image determining method and device - Google Patents

Depth image determining method and device Download PDF

Info

Publication number
CN116681746B
CN116681746B CN202211718292.3A CN202211718292A CN116681746B CN 116681746 B CN116681746 B CN 116681746B CN 202211718292 A CN202211718292 A CN 202211718292A CN 116681746 B CN116681746 B CN 116681746B
Authority
CN
China
Prior art keywords
image
checkerboard
fusion
images
pixel point
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202211718292.3A
Other languages
Chinese (zh)
Other versions
CN116681746A (en
Inventor
周韬
聂凯
王炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Midea Group Co Ltd
Guangdong Midea White Goods Technology Innovation Center Co Ltd
Original Assignee
Midea Group Co Ltd
Guangdong Midea White Goods Technology Innovation Center Co Ltd
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 Midea Group Co Ltd, Guangdong Midea White Goods Technology Innovation Center Co Ltd filed Critical Midea Group Co Ltd
Priority to CN202211718292.3A priority Critical patent/CN116681746B/en
Publication of CN116681746A publication Critical patent/CN116681746A/en
Application granted granted Critical
Publication of CN116681746B publication Critical patent/CN116681746B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/557Depth or shape recovery from multiple images from light fields, e.g. from plenoptic cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Abstract

The application discloses a depth image determining method and device, and belongs to the technical field of visual imaging. The method comprises the following steps: respectively carrying out pixel alignment exclusive OR treatment on the checkerboard coding image and a plurality of different one-dimensional bar coding images to obtain a fusion coding image corresponding to each one-dimensional bar coding image, wherein the widths of vertical stripes in each one-dimensional bar coding image are different; controlling an optical machine to project the checkerboard coded image and the multiple fusion coded images onto a target area frame by frame; acquiring a checkerboard detection image corresponding to the checkerboard coding image and a fusion detection image corresponding to the fusion coding image in a target area detected by a depth camera; and determining a depth image corresponding to the target area based on the checkerboard detection image and the fusion detection images. By adopting the method and the device, the interference of the internal reflection phenomenon is reduced, so that the accuracy of the depth image is improved.

Description

Depth image determining method and device
Technical Field
The present disclosure relates to the field of visual imaging technologies, and in particular, to a method and an apparatus for determining a depth image.
Background
Currently, the field of visual imaging heavily uses structured light coding based depth cameras as the primary visual imaging device. The depth camera is favored by users with its relatively high imaging accuracy, moderate field of view, depth of field range, and controllable cost. In the visual imaging process, the depth value between the position point of the object surface in the scene and the depth camera is a very important data.
In general, the method of calculating the depth value is: the optical machine projects a one-dimensional coded image such as Gray codes onto an object, then the depth camera acquires an image of the projected object, and due to the different shapes of the surfaces of the object, the one-dimensional coded image is correspondingly deformed after being projected onto the object, and the image of the object acquired by the depth camera also carries the information, so that the optical structure decoding processing, the reconstruction processing and the like are carried out on the image of the projected object, and the depth value of a position point corresponding to each pixel point on the image of the object in a scene relative to the depth camera can be obtained.
However, in the above process, when the optical machine projects the one-dimensional coded image onto the object, the internal reflection phenomenon is very easy to occur, that is, the light is projected onto the surface a of the object and then reflected onto the surface B of the object, so that the original projected image on the surface B is interfered, and the accuracy of the depth image is reduced.
Disclosure of Invention
The embodiment of the application provides a method for determining a depth image, which can solve the problem of inaccurate depth image caused by internal reflection in the prior art.
In a first aspect, a method for determining a depth image is provided, the method comprising:
Respectively carrying out pixel alignment exclusive OR treatment on the checkerboard coding image and a plurality of different one-dimensional bar coding images to obtain a fusion coding image corresponding to each one-dimensional bar coding image, wherein the widths of vertical stripes in each one-dimensional bar coding image are different;
controlling an optical machine to project the checkerboard coded image and the fusion coded images onto a target area frame by frame;
acquiring a checkerboard detection image corresponding to the checkerboard coding image in the target area and a fusion detection image corresponding to the fusion coding image in the target area, which are detected by a depth camera;
and determining a depth image corresponding to the target area based on the checkerboard detection image and the fusion detection images.
In one possible implementation manner, the determining, based on the checkerboard detection image and the multiple fusion detection images, a depth image corresponding to the target area includes:
performing optical structure decoding processing based on the checkerboard detection image and the fusion detection images to obtain decoding data;
and determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
In one possible implementation, the plurality of different one-dimensional bar coded images are one of gray codes, complementary gray code-aided fringe displacement codes.
In one possible implementation manner, the performing optical structure decoding processing based on the checkerboard detection image and the multiple fusion detection images to obtain decoded data includes:
based on a binarization threshold, respectively performing binarization processing on the checkerboard detection image and the multiple fusion detection images to obtain a checkerboard binarization image corresponding to the checkerboard detection image and a fusion binarization image corresponding to the fusion detection image;
respectively carrying out pixel alignment exclusive OR processing on the checkerboard binarized image and a plurality of fusion binarized images to obtain one-dimensional bar-shaped binarized images corresponding to the fusion binarized images;
determining binary data corresponding to each pixel point based on the gray value of each pixel point in the one-dimensional bar-shaped binary image;
and determining binary data corresponding to a plurality of pixel points in the one-dimensional bar-shaped binary image as the decoding data.
In one possible implementation manner, the determining binary data corresponding to each pixel point based on the gray value of each pixel point in the one-dimensional bar-shaped binary image includes:
for each one-dimensional bar-shaped binary image, based on a preset window, sequentially framing a plurality of pixel points in the one-dimensional bar-shaped binary image, and if the number of the pixel points with the corresponding gray value equal to 1 or 0 in the plurality of pixel points in the preset window is larger than a number threshold, setting the gray value of the plurality of pixel points in the preset window to be 1 or 0 to obtain an adjustment binary image corresponding to the one-dimensional bar-shaped binary image;
And for each pixel point in the adjustment binarization image, sequentially acquiring gray values corresponding to the pixel points in a plurality of adjustment binarization images to form binary data corresponding to the pixel points.
In one possible implementation, the method further includes:
controlling the optical machine to respectively project the full black coded image and the full white coded image onto the target area;
acquiring a full black detection image corresponding to the full black coding image in the target area and a full white detection image corresponding to the full white coding image in the target area, which are detected by the depth camera;
for each pixel point in the full-black detection image, calculating the average value of the gray value of the pixel point in the full-black detection image and the gray value of the pixel point in the full-white detection image as a binarization threshold value corresponding to the pixel point;
based on a binarization threshold, performing binarization processing on the checkerboard detection image and the multiple fusion detection images respectively to obtain a checkerboard binarization image corresponding to the checkerboard detection image and a fusion binarization image corresponding to the fusion interval detection image, wherein the method comprises the following steps:
For each pixel point in the checkerboard detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the checkerboard binarization image corresponding to the checkerboard detection image;
and setting the gray value of the pixel point to be 1 if the gray value of the pixel point is larger than the binarization threshold value corresponding to the pixel point, and setting the gray value of the pixel point to be 0 if the gray value of the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, so as to obtain the fusion binarization image corresponding to the fusion detection image.
In one possible implementation manner, the performing pixel alignment exclusive-or processing on the checkerboard encoded image and a plurality of different one-dimensional bar encoded images to obtain a fusion encoded image corresponding to each one-dimensional bar encoded image includes:
obtaining a plurality of different checkerboard coded images, wherein the plurality of checkerboard coded images comprise a reference checkerboard coded image and a plurality of adjustment checkerboard coded images, and at least one adjustment checkerboard coded image is obtained by translating the reference checkerboard coded image to different directions by preset lengths;
For each checkerboard coded image, performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image;
the control optical machine projects the checkerboard coded image and a plurality of fusion coded images onto a target area frame by frame, comprising:
controlling an optical machine to project the plurality of checkerboard coded images and a plurality of fusion coded images corresponding to each checkerboard coded image onto the target area frame by frame;
the obtaining the checkerboard detection image corresponding to the checkerboard coding image in the target area and the fusion detection image corresponding to the fusion coding image in the target area, which are detected by the depth camera, includes:
acquiring a checkerboard detection image corresponding to each checkerboard coding image detected by the depth camera and a plurality of fusion detection images corresponding to each checkerboard coding image;
the optical structure decoding processing is performed based on the checkerboard detection image and the fusion detection images to obtain decoding data, including:
for each checkerboard detection image, calculating the variance between gray values of a plurality of fusion detection images corresponding to the checkerboard detection image at each pixel point;
For each pixel point, determining a corresponding checkerboard detection image with the maximum variance and a plurality of fusion detection images as a target checkerboard detection image and a plurality of target fusion detection images corresponding to the pixel point;
for each pixel point, determining binary data corresponding to the pixel point based on the target checkerboard detection image and the target fusion detection images;
and determining binary data corresponding to the plurality of pixel points as the decoding data.
In a possible implementation manner, the directions include a horizontal direction and a vertical direction, wherein the horizontal direction and the vertical direction are directions of two sides of a grid in the reference checkerboard coded image respectively;
the preset length is half of the side length of the grid in the reference checkerboard coded image.
In a second aspect, a method and apparatus for determining a depth image are provided, where the apparatus includes:
the fusion module is used for carrying out pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain fusion coded images corresponding to each one-dimensional bar coded image, wherein the widths of vertical stripes in each one-dimensional bar coded image are different;
The projection module is used for controlling the optical machine to project the checkerboard coded image and the fusion coded images onto a target area frame by frame;
the detection module is used for acquiring a checkerboard detection image corresponding to the checkerboard coding image in the target area detected by the depth camera and a fusion detection image corresponding to the fusion coding image in the target area;
and the determining module is used for determining the depth image corresponding to the target area based on the checkerboard detection image and the fusion detection images.
In one possible implementation, the plurality of different one-dimensional bar coded images are one of gray codes, complementary gray code-aided fringe displacement codes.
In one possible implementation manner, the determining module is configured to:
performing optical structure decoding processing based on the checkerboard detection image and the fusion detection images to obtain decoding data;
and determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
In one possible implementation manner, the determining module is configured to:
based on a binarization threshold, respectively performing binarization processing on the checkerboard detection image and the multiple fusion detection images to obtain a checkerboard binarization image corresponding to the checkerboard detection image and a fusion binarization image corresponding to the fusion detection image;
Respectively carrying out pixel alignment exclusive OR processing on the checkerboard binarized image and a plurality of fusion binarized images to obtain one-dimensional bar-shaped binarized images corresponding to the fusion binarized images;
determining binary data corresponding to each pixel point based on the gray value of each pixel point in the one-dimensional bar-shaped binary image;
and determining binary data corresponding to a plurality of pixel points in the one-dimensional bar-shaped binary image as the decoding data.
In one possible implementation manner, the determining module is configured to:
for each one-dimensional bar-shaped binary image, based on a preset window, sequentially framing a plurality of pixel points in the one-dimensional bar-shaped binary image, and if the number of the pixel points with the corresponding gray value equal to 1 or 0 in the plurality of pixel points in the preset window is larger than a number threshold, setting the gray value of the plurality of pixel points in the preset window to be 1 or 0 to obtain an adjustment binary image corresponding to the one-dimensional bar-shaped binary image;
and for each pixel point in the adjustment binarization image, sequentially acquiring gray values corresponding to the pixel points in a plurality of adjustment binarization images to form binary data corresponding to the pixel points.
In one possible implementation manner, the determining module is further configured to:
controlling the optical machine to respectively project the full black coded image and the full white coded image onto the target area;
acquiring a full black detection image corresponding to the full black coding image in the target area and a full white detection image corresponding to the full white coding image in the target area, which are detected by the depth camera;
for each pixel point in the full-black detection image, calculating the average value of the gray value of the pixel point in the full-black detection image and the gray value of the pixel point in the full-white detection image as a binarization threshold value corresponding to the pixel point;
the determining module is used for:
for each pixel point in the checkerboard detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the checkerboard binarization image corresponding to the checkerboard detection image;
and setting the gray value of the pixel point to be 1 if the gray value of the pixel point is larger than the binarization threshold value corresponding to the pixel point, and setting the gray value of the pixel point to be 0 if the gray value of the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, so as to obtain the fusion binarization image corresponding to the fusion detection image.
In one possible implementation manner, the fusion module is configured to:
obtaining a plurality of different checkerboard coded images, wherein the plurality of checkerboard coded images comprise a reference checkerboard coded image and a plurality of adjustment checkerboard coded images, and at least one adjustment checkerboard coded image is obtained by translating the reference checkerboard coded image to different directions by preset lengths;
for each checkerboard coded image, performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image;
the projection module is used for:
controlling an optical machine to project the plurality of checkerboard coded images and a plurality of fusion coded images corresponding to each checkerboard coded image onto the target area frame by frame;
the detection module is used for:
acquiring a checkerboard detection image corresponding to each checkerboard coding image detected by the depth camera and a plurality of fusion detection images corresponding to each checkerboard coding image;
the determining module is used for:
for each checkerboard detection image, calculating the variance between gray values of a plurality of fusion detection images corresponding to the checkerboard detection image at each pixel point;
For each pixel point, determining a corresponding checkerboard detection image with the maximum variance and a plurality of fusion detection images as a target checkerboard detection image and a plurality of target fusion detection images corresponding to the pixel point;
for each pixel point, determining binary data corresponding to the pixel point based on the target checkerboard detection image and the target fusion detection images;
and determining binary data corresponding to the plurality of pixel points as the decoding data.
In a possible implementation manner, the directions include a horizontal direction and a vertical direction, wherein the horizontal direction and the vertical direction are directions of two sides of a grid in the reference checkerboard coded image respectively;
the preset length is half of the side length of the grid in the reference checkerboard coded image.
In a third aspect, a computer device is provided, the computer device comprising a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by a method of determining a depth image.
In a fourth aspect, a computer-readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to perform operations performed by a method of determining a depth image is provided.
In a fifth aspect, a computer program product is provided, comprising at least one instruction therein, the at least one instruction being loaded and executed by a processor to implement operations performed by a method of determining a depth image.
The beneficial effects that technical scheme that this application embodiment provided brought are: according to the scheme, the checkerboard coded image with high frequency of pattern change in two dimensions is fused with the one-dimensional bar coded image with low frequency of pattern change in one dimension, so that the fused coded image with high frequency of pattern change in two dimensions and related data of the one-dimensional bar coded image is obtained, interference of internal reflection phenomenon caused by low pattern change frequency in the one-dimensional bar coded image is reduced, and the depth image is determined based on the fused coded image, so that accuracy of the depth image can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for determining a depth image according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a checkerboard encoded image provided by an embodiment of the present application;
fig. 3 is a schematic diagram of a gray code according to an embodiment of the present application;
FIG. 4 is a schematic illustration of a one-dimensional bar coded image provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a fusion encoded image provided in an embodiment of the present application;
FIG. 6 is a flow chart of a method for determining a depth image according to an embodiment of the present application;
FIG. 7 is a schematic diagram of an adjusted checkerboard encoded image provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of an adjusted checkerboard encoded image provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a depth image determining apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of a structure of a terminal according to an embodiment of the present application;
fig. 11 is a block diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The embodiment of the application provides a method for determining a depth image, which can be realized by computer equipment. The computer device may be a terminal, a server, etc., and the terminal may be a desktop computer, a notebook computer, a tablet computer, a mobile phone, etc.
The computer device may include a processor, memory, communication components, and the like.
The processor may be a central processing unit (central processing unit, CPU) that may be configured to read the instructions and process the data, for example, perform pixel-wise exclusive-or processing on the checkerboard encoded image and the one-dimensional bar encoded image to obtain a fusion encoded image corresponding to the one-dimensional bar encoded image, obtain a checkerboard detected image and a fusion detected image, perform optical structure decoding processing based on the checkerboard detected image and the plurality of fusion detected images to obtain decoded data, determine a depth image corresponding to the target area based on the decoded data and a triangular reconstruction algorithm, and so on.
The memory may be various volatile memory or nonvolatile memory, such as Solid State Disk (SSD), dynamic random access memory (dynamic random access memory, DRAM) memory, and the like. The memory may be used for data storage, for example, to store a checkerboard encoded image and a plurality of one-dimensional bar encoded images, to store a plurality of resulting fusion encoded images, to store an acquired checkerboard detected image and a plurality of fusion detected images, to store resulting decoded data, to store depth images corresponding to a determined target area, and so on.
The communication component may be a wired network connector, a wireless fidelity (wireless fidelity, wiFi) module, a bluetooth module, a cellular network communication module, or the like. The communication means may be used for data transmission with other devices.
Fig. 1 is a flowchart of a method for determining a depth image according to an embodiment of the present application. Referring to fig. 1, this embodiment includes:
101. and performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image.
Wherein the checkerboard encoded image is image data having a black and white checkerboard pattern, as shown in fig. 2, which has a relatively high frequency of pattern variation in two dimensions, i.e., a relatively high frequency of pattern variation in the direction of both sides of the checkerboard.
In the embodiment of the present application, the size of the grid in the checkerboard encoded image may be set according to the actual situation, and may be any reasonable size, for example, the size of the grid may be 4×4, or other sizes, which is not limited in the embodiment of the present application.
The one-dimensional bar code image is image data having a black-and-white alternate vertical stripe pattern, and the width of the vertical stripe in each one-dimensional bar code image is different among a plurality of different one-dimensional bar code images.
In one possible implementation, the plurality of different one-dimensional bar coded images may be one of gray code, complementary gray code-aided fringe displacement coding. Taking gray code as an example, as shown in fig. 3, the gray code includes a plurality of one-dimensional bar code images, and the widths of the vertical stripes of each one-dimensional bar code image are different.
In the related art, a one-dimensional bar code pattern such as a gray code is generally used directly to determine a depth image corresponding to a target area, but in the one-dimensional bar code pattern, a black-and-white pattern is only changed in one dimension or one direction, and the change frequency is low, so that when the gray code is projected onto the target area, white stripes therein are extremely easy to generate internal reflection on an object in the target area, thereby reducing the accuracy of the depth image.
In the embodiment of the application, in order to reduce the interference of the internal reflection phenomenon, checkerboard coded images with high-frequency variation in two dimensions are respectively fused with each one-dimensional bar coded image, so that the fused coded image corresponding to each one-dimensional bar coded image obtained after fusion can have high-frequency variation in two dimensions, and the internal reflection phenomenon is reduced.
The method for fusing the checkerboard coded image and the one-dimensional bar coded image comprises the following steps: and performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image.
In practice, the size of the checkerboard code image is the same as the size of the one-dimensional bar code image, and when fusion is performed, the following processing may be performed for each one-dimensional bar code image:
and for each pixel point in the one-dimensional bar code image, determining the gray value of the pixel point in the one-dimensional bar code image and the gray value of the pixel point in the checkerboard code image, and performing exclusive-or processing on the two gray values, namely, 1 (black) and 0 (white) to obtain the gray value of the pixel point in the fused and integrated code image. It will be appreciated that since there are only two colors, black and white, in both the one-dimensional bar coded image and the checkerboard coded image, the gray value of its pixel is either 0 or 1.
And fusing each pixel point in the mode, so as to determine the gray value of each pixel point in the fused coded image, and thus obtaining the fused coded image.
For example, if the checkerboard encoded image shown in fig. 2 and the one-dimensional bar encoded image shown in fig. 4 are subjected to pixel bit exclusive or processing, a fusion encoded image as shown in fig. 5 can be obtained. It can be seen that in the fusion encoded image shown in fig. 5, it has high frequency pattern variations in both dimensions.
102. The optical machine is controlled to project the checkerboard coded image and the fusion coded images onto a target area frame by frame.
In an implementation, a target area is selected, in which one or more objects are located.
And (3) programming the checkerboard code image and the fusion code image corresponding to each one-dimensional bar code image into a light machine, then placing the light machine in front of a target area, and controlling the light machine to project the checkerboard code image and the fusion code images onto the target area frame by frame.
103. And acquiring a checkerboard detection image corresponding to the checkerboard coding image in the target area detected by the depth camera and a fusion detection image corresponding to the fusion coding image in the target area.
In practice, the depth camera is also placed at a corresponding position in front of the target area, and the depth camera is electrically connected with the optical machine. And triggering the depth camera to acquire a checkerboard detection image corresponding to the checkerboard coding image and a fusion detection image corresponding to the fusion coding image in the target area after the optical machine projects one frame of the checkerboard coding image or the one-dimensional bar coding image onto the target area.
When the checkerboard coded image is transmitted to the target area, due to the influence of the surface shape of the object in the target area, the checkerboard detection image acquired by the depth camera has certain deformation and change of gray values relative to the checkerboard coded image, so that the space shape information of the object in the target area is carried in the checkerboard coded image. Similarly, the fusion detection image obtained after projecting the fusion encoded image also carries the spatial shape information of the object in the target area.
It will be appreciated that the checkerboard detection image and the fusion detection image described above are grayscale images.
104. And determining a depth image corresponding to the target area based on the checkerboard detection image and the fusion detection images.
In the implementation, after the checkerboard detection image and the multiple fusion detection images are obtained, the influence caused by the checkerboard detection image can be removed from the fusion detection images, the detection image corresponding to the one-dimensional bar code image is recovered, and then the depth image corresponding to the target area is determined based on the detection images corresponding to the multiple one-dimensional bar codes.
According to the scheme, the checkerboard coded image with high frequency of pattern change in two dimensions is fused with the one-dimensional bar coded image with low frequency of pattern change in one dimension, so that the fused coded image with high frequency of pattern change in two dimensions and related data of the one-dimensional bar coded image is obtained, interference of internal reflection phenomenon caused by low pattern change frequency in the one-dimensional bar coded image is reduced, and the depth image is determined based on the fused coded image, so that accuracy of the depth image can be effectively improved.
In one possible implementation manner, as shown in fig. 6, in the step 104, a method for determining a depth image corresponding to the target area may be:
1041. and performing optical structure decoding processing based on the checkered detection image and the fusion detection images to obtain decoding data.
In implementation, since the checkerboard detection image and the fusion detection image carry the spatial shape information of the object in the target area, the optical structure decoding processing can be performed on the checkerboard detection image and the fusion detection image, so that the decoded data for displaying the spatial shape information of the object in the target area can be obtained more clearly.
The optical structure decoding process may have the following method flow:
based on the binarization threshold, respectively performing binarization processing on the checkerboard detection image and the multiple fusion detection images to obtain a checkerboard binarization image corresponding to the checkerboard detection image and a fusion binarization image corresponding to the fusion detection image. And respectively carrying out pixel alignment exclusive OR processing on the checkerboard binarized image and the plurality of fusion binarized images to obtain one-dimensional bar-shaped binarized images corresponding to the plurality of fusion binarized images. And determining binary data corresponding to each pixel point based on the gray value of each pixel point in the one-dimensional bar-shaped binarized image. Binary data corresponding to a plurality of pixel points in the one-dimensional bar-shaped binarized image is determined as decoding data.
In implementation, binarization processing can be performed on the checkerboard detection image and the multiple fusion detection images respectively, namely when the gray value of a pixel point is greater than a binarization threshold value, the gray value of the pixel point is set to be 1, and when the gray value of the pixel point is smaller than or equal to the binarization threshold value, the gray value of the pixel point is set to be 0, so that the checkerboard binarization image corresponding to the checkerboard detection image and the fusion binarization image corresponding to each fusion detection image can be obtained.
Based on the principle that the two exclusive-or equals to the identity operation, pixel alignment exclusive-or processing is carried out on each fusion binarization image on the checkerboard binarization image and the fusion binarization image, so that a one-dimensional bar binarization image corresponding to the fusion binarization image is obtained, namely, the influence brought by the checkerboard coding image when the initial fusion is carried out is removed from the fusion binarization image by carrying out pixel alignment exclusive-or processing again, and the one-dimensional bar binarization image corresponding to the fusion binarization image is obtained, in the one-dimensional bar binarization image, the influence of internal reflection is weakened through the checkerboard coding image, and the change information of the one-dimensional bar coding image on a target area is also mainly embodied.
Based on the method, a one-dimensional bar-shaped binarization image corresponding to each fusion binarization image can be obtained. Then, for each pixel point in the one-dimensional bar-shaped binary image, gray values corresponding to the pixel point in the one-dimensional bar-shaped binary images can be sequentially obtained to form binary data corresponding to the pixel point. For example, when there are 8 one-dimensional bar-coded images, there will be 8 one-dimensional bar-binarized images, and if at pixel point a, the gray values of the plurality of one-dimensional bar-binarized images are 1, 0, 1, respectively, then the binary data corresponding to this pixel point a is 11010101.
Based on the method, binary data corresponding to each pixel point is obtained, and the binary data corresponding to the plurality of pixel points is decoding data.
1042. And determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
In implementation, based on the above decoded data, the conversion relationship between the optical machine and the depth camera, and the triangle reconstruction algorithm, the depth image corresponding to the target area can be determined, where the depth image includes a depth value between the depth camera and a position point in the target area corresponding to each pixel point in the fused two-dimensional image.
In the embodiment of the application, the checkerboard coding image with higher pattern change in two dimensions and the one-dimensional bar coding image with lower pattern change in one dimension are fused, so that the fusion coding image with higher pattern change in two dimensions and related data of the one-dimensional bar coding image is obtained, interference of internal reflection phenomenon caused by lower pattern change frequency in the one-dimensional bar coding image is reduced, and the depth image is determined based on the fusion coding image, so that the accuracy of the depth image can be effectively improved.
In the decoding process in step 1041, flying spot noise is very easy to generate, that is, there are inaccurate pixels, and in this case, the following processing may be performed to reduce the flying spots therein:
and sequentially framing a plurality of pixel points in the one-dimensional bar-shaped binary image based on a preset window for each one-dimensional bar-shaped binary image, and setting the gray values of the pixel points in the preset window to be 1 or 0 if the number of the pixel points with the gray values equal to 1 or 0 in the pixel points in the preset window is larger than a number threshold value, so as to obtain an adjustment binary image corresponding to the one-dimensional bar-shaped binary image. And for each pixel point in the adjustment binarization image, sequentially acquiring gray values corresponding to the pixel points in the adjustment binarization image to form binary data corresponding to the pixel points.
In the above process, when the gray values corresponding to the plurality of pixels in the preset window are equal to 1, it is indicated that the plurality of pixels in the preset window may display a white area, where the pixels not equal to 1 are very likely to be flying spots, and at this time, the gray values of the plurality of pixels in the preset window may be set to 1, so that flying spots in the one-dimensional bar-shaped binarized image are reduced, and the influence of flying spot noise is reduced.
Similarly, when the gray values corresponding to the pixels in the preset window are equal to 0, it is indicated that the pixels in the preset window may display a black area, where the pixels not equal to 0 are very likely to be flying spots, and at this time, the gray values of the pixels in the preset window may be set to 0, so as to reduce the flying spots in the one-dimensional bar-shaped binary image.
The size of the preset window may be any reasonable size, for example, the preset window may be a size of 7×7, the corresponding number threshold may be 44, 49 pixels are selected from the one-bit bar-shaped binarized image by using the preset window, if the gray value of the pixel with more than 44 pixels is equal to 1 in the 49 pixels, the gray value of the pixel with other equal to 0 is set to 1, and if the gray value of the pixel with more than 44 pixels is equal to 0 in the 49 pixels, the gray value of the pixel with other equal to 1 is set to 0.
In one possible implementation manner, before performing binarization processing on the checkerboard detection image and the multiple fusion detection images, a binarization threshold needs to be determined, where the binarization threshold may be any reasonable value, and the embodiment of the application provides a method for determining the binarization threshold, which corresponds to the following steps:
the control optical machine projects the full black coded image and the full white coded image onto the target area respectively. And acquiring a full-black detection image corresponding to the full-black coding image in the target area and a full-white detection image corresponding to the full-white coding image in the target area, which are detected by the depth camera. And calculating the average value of the gray value of the pixel point in the full-black detection image and the gray value of the pixel point in the full-white detection image as a binarization threshold value corresponding to the pixel point for each pixel point in the full-black detection image.
After calculating the binarization threshold value corresponding to each pixel point, respectively performing binarization processing on the checkerboard detection image and the multiple fusion detection images based on the binarization threshold value, namely:
and for each pixel point in the checkerboard detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the checkerboard binarization image corresponding to the checkerboard detection image.
And for each pixel point in the fusion detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the fusion binarization image corresponding to the fusion detection image.
Based on the method, the binarization threshold value corresponding to each pixel point can be calculated, and because the shapes of the space coordinates corresponding to each pixel point are different, the influence of the shapes of each pixel point on the gray value is different, the binarization threshold value corresponding to each pixel point calculated by the method can binarize the gray value of each pixel point according to the binarization threshold value of each pixel point, so that the obtained checkerboard binarization image and the fused binarization image are more accurate.
In the step 102, in the actual processing, since the image projected by the optical engine has a certain blurring effect, more noise is generated in the edge transition region between the black region and the white region in the projected checkered encoded image or the fusion encoded image, so that the gray level of the edge transition region is changed. Similarly, in step 103, the aperture and depth of field of the depth camera may also generate more noise in the edge transition region between the black region and the white region in the acquired checkerboard detection image and the fusion detection image. Noise generated in the edge transition region can cause binarization uncertainty when subsequent binarization processing is performed, so that accuracy of checkerboard binarization images and fusion of the binarization images is reduced.
In order to reduce noise generated in the edge transition region, the following processes may be performed:
in the above step 101, the following processing may be performed: and obtaining a plurality of different checkerboard encoded images, wherein the plurality of checkerboard encoded images comprise a reference checkerboard encoded image and a plurality of adjustment checkerboard encoded images, and at least one adjustment checkerboard encoded image is obtained by shifting the reference checkerboard encoded image to different directions by preset lengths. And for each checkerboard coded image, respectively carrying out pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images to obtain a fusion coded image corresponding to each one-dimensional bar coded image.
In practice, a reference checkerboard coded image, such as the one shown in FIG. 2, may be provided first. And then, respectively carrying out translation in different directions on the reference checkerboard coded images, thereby obtaining a plurality of adjustment checkerboard coded images.
In this embodiment of the present application, the directions may include a horizontal direction and a vertical direction, where the horizontal direction and the vertical direction are directions of two sides of a grid in the reference checkerboard encoded image, and the preset length may be half of a side length of the grid in the reference checkerboard encoded image.
For example, the plurality of checkerboard encoded images may include two adjustment checkerboard encoded images, wherein one adjustment checkerboard encoded image is obtained by shifting a pattern of a reference checkerboard encoded image to the left by half a side length of one grid (as shown in fig. 7) and the other adjustment checkerboard encoded image is obtained by shifting a pattern of a reference checkerboard encoded image to the bottom by half a side length of one grid (as shown in fig. 8).
After the plurality of adjustment checkerboard code images are obtained by the translation of the preset length, for each checkerboard code image (including a reference checkerboard code image and a plurality of adjustment checkerboard code images), pixel alignment exclusive-or processing is carried out on the checkerboard code image and a plurality of different one-dimensional bar code images respectively, so as to obtain a fusion code image corresponding to each one-dimensional bar code image. For example, when the checkerboard encoded image includes one reference checkerboard encoded image and two adjustment checkerboard encoded images, the above exclusive or processing is performed to obtain a plurality of fusion encoded images corresponding to the reference checkerboard encoded image and fusion encoded images corresponding to each adjustment checkerboard encoded image.
In the above step 102, the following processing may be performed: the control optical machine projects a plurality of checkerboard coded images and a plurality of fusion coded images corresponding to each checkerboard coded image onto a target area frame by frame.
In the above step 103, the following processing may be performed: and acquiring a checkerboard detection image corresponding to each checkerboard coding image detected by the depth camera and a plurality of fusion detection images corresponding to each checkerboard coding image.
In step 1041, the following process may be performed: for each checkerboard detection image, a variance between gray values of a plurality of fusion detection images corresponding to the checkerboard detection image at each pixel point is calculated. For each pixel point, determining the corresponding checkerboard detection image with the maximum variance and the multiple fusion detection images as a target checkerboard detection image and multiple target fusion detection images corresponding to the pixel point. For each pixel point, binary data corresponding to the pixel point is determined based on the target checkerboard detection image and the multiple target fusion detection images. Binary data corresponding to the plurality of pixel points is determined as decoded data.
For each pixel point: the pixel points correspond to gray values in a plurality of checkerboard detection images and gray values in a plurality of fusion detection images corresponding to each checkerboard detection image. If the variance between the gray values of one of the checkerboard detection images and the corresponding multiple fusion detection images is smaller, it is indicated that the gray value of the pixel point is still smaller after the black-and-white change of the multiple fusion detection images, which means that in a large part of the multiple fusion detection images, the pixel point is more likely to be located in the edge transition region in the fusion detection image. Correspondingly, if the variance between the gray values of the pixels of the other checkerboard detection image and the corresponding multiple fusion detection images is larger, it can be indicated that the gray value of the pixel is larger after the black-and-white change of the multiple fusion detection images, which indicates that the pixel is most likely to be located in the center of the grid in the fusion detection image and is not located in the edge transition region.
Therefore, for each pixel point, the group of checkerboard detection images with the maximum corresponding variance and the corresponding fusion detection images can be selected, and the group of checkerboard detection images and the corresponding fusion detection images can be determined as the target checkerboard detection images corresponding to the pixel point and the corresponding target fusion detection images.
Then, for each pixel point, based on the target checkerboard detection image and the target fusion detection image corresponding to each pixel point, binary data corresponding to each pixel point is determined, and the binary data corresponding to the plurality of pixel points is decoding data.
Based on the method, the occurrence of the condition of the pixel point in the edge transition area is avoided as far as possible by selecting the group of checkerboard detection images with the maximum variance and the corresponding fusion detection images corresponding to each pixel point, so that the accuracy of binary data corresponding to the pixel point is improved, and the accuracy of the checkerboard binarization image and the fusion binarization image is further improved.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein in detail.
According to the scheme, the checkerboard coded image with high frequency of pattern change in two dimensions is fused with the one-dimensional bar coded image with low frequency of pattern change in one dimension, so that the fused coded image with high frequency of pattern change in two dimensions and related data of the one-dimensional bar coded image is obtained, interference of internal reflection phenomenon caused by low pattern change frequency in the one-dimensional bar coded image is reduced, and the depth image is determined based on the fused coded image, so that accuracy of the depth image can be effectively improved.
The embodiment of the application provides a device of a method for determining a depth image, where the device may be a computer device in the foregoing embodiment, as shown in fig. 9, and the device includes:
the fusion module 910 is configured to perform pixel alignment exclusive-or processing on the checkerboard encoded image and a plurality of different one-dimensional bar encoded images, so as to obtain a fusion encoded image corresponding to each one-dimensional bar encoded image, where widths of vertical stripes in each one-dimensional bar encoded image are different;
the projection module 920 is configured to control the optical engine to project the checkerboard encoded image and the multiple fusion encoded images onto a target area frame by frame;
a detection module 930, configured to obtain a checkerboard detection image corresponding to the checkerboard encoded image in the target area and a fusion detection image corresponding to the fusion encoded image in the target area detected by a depth camera;
and a determining module 940, configured to determine a depth image corresponding to the target area based on the checkerboard detection image and the multiple fusion detection images.
In one possible implementation, the plurality of different one-dimensional bar coded images are one of gray codes, complementary gray code-aided fringe displacement codes.
In one possible implementation manner, the determining module 940 is configured to:
performing optical structure decoding processing based on the checkerboard detection image and the fusion detection images to obtain decoding data;
and determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
In one possible implementation manner, the determining module 940 is configured to:
based on a binarization threshold, respectively performing binarization processing on the checkerboard detection image and the multiple fusion detection images to obtain a checkerboard binarization image corresponding to the checkerboard detection image and a fusion binarization image corresponding to the fusion detection image;
respectively carrying out pixel alignment exclusive OR processing on the checkerboard binarized image and a plurality of fusion binarized images to obtain one-dimensional bar-shaped binarized images corresponding to the fusion binarized images;
determining binary data corresponding to each pixel point based on the gray value of each pixel point in the one-dimensional bar-shaped binary image;
and determining binary data corresponding to a plurality of pixel points in the one-dimensional bar-shaped binary image as the decoding data.
In one possible implementation manner, the determining module 940 is configured to:
For each one-dimensional bar-shaped binary image, based on a preset window, sequentially framing a plurality of pixel points in the one-dimensional bar-shaped binary image, and if the number of the pixel points with the corresponding gray value equal to 1 or 0 in the plurality of pixel points in the preset window is larger than a number threshold, setting the gray value of the plurality of pixel points in the preset window to be 1 or 0 to obtain an adjustment binary image corresponding to the one-dimensional bar-shaped binary image;
and for each pixel point in the adjustment binarization image, sequentially acquiring gray values corresponding to the pixel points in a plurality of adjustment binarization images to form binary data corresponding to the pixel points.
In one possible implementation, the determining module 940 is further configured to:
controlling the optical machine to respectively project the full black coded image and the full white coded image onto the target area;
acquiring a full black detection image corresponding to the full black coding image in the target area and a full white detection image corresponding to the full white coding image in the target area, which are detected by the depth camera;
for each pixel point in the full-black detection image, calculating the average value of the gray value of the pixel point in the full-black detection image and the gray value of the pixel point in the full-white detection image as a binarization threshold value corresponding to the pixel point;
The determining module 940 is configured to:
for each pixel point in the checkerboard detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the checkerboard binarization image corresponding to the checkerboard detection image;
and setting the gray value of the pixel point to be 1 if the gray value of the pixel point is larger than the binarization threshold value corresponding to the pixel point, and setting the gray value of the pixel point to be 0 if the gray value of the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, so as to obtain the fusion binarization image corresponding to the fusion detection image.
In one possible implementation, the fusion module 810 is configured to:
obtaining a plurality of different checkerboard coded images, wherein the plurality of checkerboard coded images comprise a reference checkerboard coded image and a plurality of adjustment checkerboard coded images, and at least one adjustment checkerboard coded image is obtained by translating the reference checkerboard coded image to different directions by preset lengths;
For each checkerboard coded image, performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image;
the projection module 820 is configured to:
controlling an optical machine to project the plurality of checkerboard coded images and a plurality of fusion coded images corresponding to each checkerboard coded image onto the target area frame by frame;
the detection module 830 is configured to:
acquiring a checkerboard detection image corresponding to each checkerboard coding image detected by the depth camera and a plurality of fusion detection images corresponding to each checkerboard coding image;
the determining module 940 is configured to:
for each checkerboard detection image, calculating the variance between gray values of a plurality of fusion detection images corresponding to the checkerboard detection image at each pixel point;
for each pixel point, determining a corresponding checkerboard detection image with the maximum variance and a plurality of fusion detection images as a target checkerboard detection image and a plurality of target fusion detection images corresponding to the pixel point;
for each pixel point, determining binary data corresponding to the pixel point based on the target checkerboard detection image and the target fusion detection images;
And determining binary data corresponding to the plurality of pixel points as the decoding data.
In a possible implementation manner, the directions include a horizontal direction and a vertical direction, wherein the horizontal direction and the vertical direction are directions of two sides of a grid in the reference checkerboard coded image respectively;
the preset length is half of the side length of the grid in the reference checkerboard coded image.
It should be noted that: in the method and apparatus for determining a depth image according to the embodiments, only the division of the functional modules is used for illustration, and in practical application, the functional allocation may be performed by different functional modules according to needs, i.e., the internal structure of the apparatus is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the method and apparatus for determining a depth image provided in the foregoing embodiments belong to the same concept as the method and apparatus for determining a depth image, and detailed implementation processes of the method and apparatus are shown in the method and apparatus, which are not described herein.
Fig. 10 shows a block diagram of a terminal 1000 according to an exemplary embodiment of the present application. The terminal may be a computer device in the above-described embodiments. The terminal 1000 may be: a smart phone, a tablet computer, an MP3 player (moving picture experts group audio layer III, motion picture expert compression standard audio plane 3), an MP4 (moving picture experts group audio layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal 1000 can also be referred to by other names of user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, terminal 1000 can include: a processor 1001 and a memory 1002.
The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 1001 may be implemented in at least one hardware form of DSP (digital signal processing ), FPGA (field-programmable gate array, field programmable gate array), PLA (programmable logic array ). The processor 1001 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (central processing unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may integrate a GPU (graphics processing unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 1001 may also include an AI (artificial intelligence ) processor for processing computing operations related to machine learning.
Memory 1002 may include one or more computer-readable storage media, which may be non-transitory. Memory 1002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1002 is used to store at least one instruction for execution by processor 1001 to implement the method of determining a depth image provided by a method embodiment in the present application.
In some embodiments, terminal 1000 can optionally further include: a peripheral interface 1003, and at least one peripheral. The processor 1001, the memory 1002, and the peripheral interface 1003 may be connected by a bus or signal line. The various peripheral devices may be connected to the peripheral device interface 1003 via a bus, signal wire, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1004, a display 1005, a camera 1006, audio circuitry 1007, a positioning component 1008, and a power supply 1009.
Peripheral interface 1003 may be used to connect I/O (input/output) related at least one peripheral to processor 1001 and memory 1002. In some embodiments, processor 1001, memory 1002, and peripheral interface 1003 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 1001, memory 1002, and peripheral interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
Radio frequency circuit 1004 is used to receive and transmit RF (radio frequency) signals, also known as electromagnetic signals. Radio frequency circuitry 1004 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1004 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. Radio frequency circuitry 1004 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (wireless fidelity ) networks. In some embodiments, the radio frequency circuitry 1004 may also include NFC (near field communication ) related circuitry, which is not limited in this application.
The display screen 1005 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1005 is a touch screen, the display 1005 also has the ability to capture touch signals at or above the surface of the display 1005. The touch signal may be input to the processor 1001 as a control signal for processing. At this time, the display 1005 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, display 1005 may be one, providing a front panel of terminal 1000; in other embodiments, display 1005 may be provided in at least two, separately provided on different surfaces of terminal 1000 or in a folded configuration; in still other embodiments, display 1005 may be a flexible display disposed on a curved surface or a folded surface of terminal 1000. Even more, the display 1005 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 1005 may be made of LCD (liquid crystal display ), OLED (organic light-emitting diode) or other materials.
The camera assembly 1006 is used to capture images or video. Optionally, camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera, and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and VR (virtual reality) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1006 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 1007 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 1001 for processing, or inputting the electric signals to the radio frequency circuit 1004 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple, each located at a different portion of terminal 1000. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 1007 may also include a headphone jack.
The location component 1008 is used to locate the current geographic location of terminal 1000 to enable navigation or LBS (location based service, location-based services). The positioning component 1008 may be a GPS (global positioning system ), beidou system, grainers system, or galileo system based positioning component.
Power supply 1009 is used to power the various components in terminal 1000. The power source 1009 may be alternating current, direct current, disposable battery or rechargeable battery. When the power source 1009 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1000 can further include one or more sensors 1010. The one or more sensors 1010 include, but are not limited to: acceleration sensor 1011, gyroscope sensor 1012, pressure sensor 1013, fingerprint sensor 1014, optical sensor 1015, and proximity sensor 1016.
The acceleration sensor 1011 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 1000. For example, the acceleration sensor 1011 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 1001 may control the display screen 1005 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 1011. The acceleration sensor 1011 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 1012 may detect the body direction and the rotation angle of the terminal 1000, and the gyro sensor 1012 may collect the 3D motion of the user to the terminal 1000 in cooperation with the acceleration sensor 1011. The processor 1001 may implement the following functions according to the data collected by the gyro sensor 1012: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
Pressure sensor 1013 may be disposed on a side frame of terminal 1000 and/or on an underlying layer of display 1005. When the pressure sensor 1013 is provided at a side frame of the terminal 1000, a grip signal of the terminal 1000 by a user can be detected, and the processor 1001 performs right-and-left hand recognition or quick operation according to the grip signal collected by the pressure sensor 1013. When the pressure sensor 1013 is provided at the lower layer of the display screen 1005, the processor 1001 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 1005. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 1014 is used to collect a fingerprint of the user, and the processor 1001 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 1014, or the fingerprint sensor 1014 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 1001 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. Fingerprint sensor 1014 may be provided on the front, back or side of terminal 1000. When a physical key or vendor Logo is provided on terminal 1000, fingerprint sensor 1014 may be integrated with the physical key or vendor Logo.
The optical sensor 1015 is used to collect ambient light intensity. In one embodiment, the processor 1001 may control the display brightness of the display screen 1005 based on the ambient light intensity collected by the optical sensor 1015. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 1005 is turned up; when the ambient light intensity is low, the display brightness of the display screen 1005 is turned down. In another embodiment, the processor 1001 may dynamically adjust the shooting parameters of the camera module 1006 according to the ambient light intensity collected by the optical sensor 1015.
Proximity sensor 1016, also referred to as a distance sensor, is typically located on the front panel of terminal 1000. Proximity sensor 1016 is used to collect the distance between the user and the front of terminal 1000. In one embodiment, when proximity sensor 1016 detects a gradual decrease in the distance between the user and the front face of terminal 1000, processor 1001 controls display 1005 to switch from the bright screen state to the off screen state; when proximity sensor 1016 detects a gradual increase in the distance between the user and the front of terminal 1000, processor 1001 controls display 1005 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 10 is not limiting and that terminal 1000 can include more or fewer components than shown, or certain components can be combined, or a different arrangement of components can be employed.
Fig. 11 is a schematic structural diagram of a server provided in the embodiments of the present application, where the server 1100 may have a relatively large difference due to configuration or performance, and may include one or more processors (central processing units, CPU) 1101 and one or more memories 1102, where the memories 1102 store at least one instruction, and the at least one instruction is loaded and executed by the processor 1101 to implement the methods provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium, such as a memory comprising instructions executable by a processor in a terminal to perform the method of determining a depth image of the above embodiment is also provided. The computer readable storage medium may be non-transitory. For example, the computer readable storage medium may be a ROM (read-only memory), a RAM (random access memory ), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals (including but not limited to signals transmitted between the user terminal and other devices, etc.) referred to in this application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, reference in the present application to "checkerboard detection image and fusion detection image" is made with sufficient authorization.
The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention.

Claims (9)

1. A method of determining a depth image, the method comprising:
obtaining a plurality of different checkerboard coded images, wherein the plurality of checkerboard coded images comprise a reference checkerboard coded image and a plurality of adjustment checkerboard coded images, and the plurality of adjustment checkerboard coded images are obtained by translating the reference checkerboard coded images to different directions by preset lengths;
for each checkerboard coded image, performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image, wherein the widths of vertical stripes in each one-dimensional bar coded image are different;
controlling an optical machine to project the checkerboard coded images and the fusion coded images onto a target area frame by frame;
acquiring a checkerboard detection image corresponding to each checkerboard coding image in the target area detected by a depth camera and a fusion detection image corresponding to each fusion coding image in the target area;
for each checkerboard detection image, calculating the variance between gray values of a plurality of fusion detection images corresponding to the checkerboard detection image at each pixel point;
For each pixel point, determining a corresponding checkerboard detection image with the maximum variance and a plurality of fusion detection images as a target checkerboard detection image and a plurality of target fusion detection images corresponding to the pixel point;
for each pixel point, determining binary data corresponding to the pixel point based on the target checkerboard detection image and the target fusion detection images;
binary data corresponding to a plurality of pixel points is determined as decoding data;
and determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
2. The method of claim 1, wherein the plurality of different one-dimensional bar coded images are one of gray code, complementary gray code aided fringe displacement coding.
3. The method of claim 1, wherein the determining binary data corresponding to the pixel based on the target checkerboard detection image and the plurality of target fusion detection images comprises:
based on a binarization threshold, respectively performing binarization processing on the target checkerboard detection image and the target fusion detection images to obtain a checkerboard binarization image corresponding to the target checkerboard detection image and a fusion binarization image corresponding to the target fusion detection image;
Respectively carrying out pixel alignment exclusive OR processing on the checkerboard binarized image and a plurality of fusion binarized images to obtain one-dimensional bar-shaped binarized images corresponding to the fusion binarized images;
and determining binary data corresponding to the pixel point based on the gray value of the pixel point in the one-dimensional bar-shaped binarized image.
4. A method according to claim 3, wherein said determining binary data corresponding to said pixel based on gray values of said pixel in said one-dimensional bar binarized image comprises:
for each one-dimensional bar-shaped binary image, based on a preset window, sequentially framing a plurality of pixel points in the one-dimensional bar-shaped binary image, and if the number of the pixel points with the corresponding gray value equal to 1 or 0 in the plurality of pixel points in the preset window is larger than a number threshold, setting the gray value of the plurality of pixel points in the preset window to be 1 or 0 to obtain an adjustment binary image corresponding to the one-dimensional bar-shaped binary image;
and for the pixel points, sequentially acquiring gray values corresponding to the pixel points in a plurality of adjustment binarization images to form binary data corresponding to the pixel points.
5. A method according to claim 3, characterized in that the method further comprises:
controlling the optical machine to respectively project the full black coded image and the full white coded image onto the target area;
acquiring a full black detection image corresponding to the full black coding image in the target area and a full white detection image corresponding to the full white coding image in the target area, which are detected by the depth camera;
for each pixel point in the full-black detection image, calculating the average value of the gray value of the pixel point in the full-black detection image and the gray value of the pixel point in the full-white detection image as a binarization threshold value corresponding to the pixel point;
the binarizing processing is performed on the target checkerboard detection image and the target fusion detection images based on the binarization threshold value to obtain a checkerboard binarization image corresponding to the target checkerboard detection image and a fusion binarization image corresponding to the target fusion detection image, including:
for each pixel point in the target checkerboard detection image, if the gray value corresponding to the pixel point is larger than the binarization threshold corresponding to the pixel point, setting the gray value of the pixel point to be 1, and if the gray value corresponding to the pixel point is smaller than or equal to the binarization threshold corresponding to the pixel point, setting the gray value of the pixel point to be 0, so as to obtain the checkerboard binarization image corresponding to the target checkerboard detection image;
And setting the gray value of the pixel point to be 1 if the gray value of the pixel point is larger than the binarization threshold value corresponding to the pixel point, and setting the gray value of the pixel point to be 0 if the gray value of the pixel point is smaller than or equal to the binarization threshold value corresponding to the pixel point, so as to obtain the fusion binarization image corresponding to the target fusion detection image.
6. The method of claim 1, wherein the directions include a horizontal direction and a vertical direction, wherein the horizontal direction and the vertical direction are directions of two sides of a grid in the reference checkerboard encoded image, respectively;
the preset length is half of the side length of the grid in the reference checkerboard coded image.
7. A method and apparatus for determining a depth image, the apparatus comprising:
the fusion module is used for acquiring a plurality of different checkerboard coded images, wherein the plurality of checkerboard coded images comprise a reference checkerboard coded image and a plurality of adjustment checkerboard coded images, and the plurality of adjustment checkerboard coded images are obtained by translating the reference checkerboard coded images to different directions by preset lengths; for each checkerboard coded image, performing pixel alignment exclusive OR processing on the checkerboard coded image and a plurality of different one-dimensional bar coded images respectively to obtain a fusion coded image corresponding to each one-dimensional bar coded image, wherein the widths of vertical stripes in each one-dimensional bar coded image are different;
The projection module is used for controlling the optical machine to project the checkerboard coded images and the fusion coded images onto a target area frame by frame;
the detection module is used for acquiring a checkerboard detection image corresponding to each checkerboard coding image in the target area detected by the depth camera and a fusion detection image corresponding to each fusion coding image in the target area;
the determining module is used for calculating the variance among gray values of a plurality of fusion detection images corresponding to each checkerboard detection image at each pixel point for each checkerboard detection image; for each pixel point, determining a corresponding checkerboard detection image with the maximum variance and a plurality of fusion detection images as a target checkerboard detection image and a plurality of target fusion detection images corresponding to the pixel point; for each pixel point, determining binary data corresponding to the pixel point based on the target checkerboard detection image and the target fusion detection images; binary data corresponding to a plurality of pixel points is determined as decoding data; and determining a depth image corresponding to the target region based on the decoded data and a triangle reconstruction algorithm.
8. A computer device comprising a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to implement the operations performed by the depth image determination method of any one of claims 1 to 6.
9. A computer-readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the operations performed by the depth image determining method of any one of claims 1 to 6.
CN202211718292.3A 2022-12-29 2022-12-29 Depth image determining method and device Active CN116681746B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211718292.3A CN116681746B (en) 2022-12-29 2022-12-29 Depth image determining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211718292.3A CN116681746B (en) 2022-12-29 2022-12-29 Depth image determining method and device

Publications (2)

Publication Number Publication Date
CN116681746A CN116681746A (en) 2023-09-01
CN116681746B true CN116681746B (en) 2024-02-09

Family

ID=87787877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211718292.3A Active CN116681746B (en) 2022-12-29 2022-12-29 Depth image determining method and device

Country Status (1)

Country Link
CN (1) CN116681746B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106683130A (en) * 2015-11-11 2017-05-17 杭州海康威视数字技术股份有限公司 Depth image acquisition method and device
CN113110451A (en) * 2021-04-14 2021-07-13 浙江工业大学 Mobile robot obstacle avoidance method with depth camera and single line laser radar fused
CN113936099A (en) * 2021-09-30 2022-01-14 东北大学 Three-dimensional image reconstruction method and system based on monocular structured light and rotating platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110809788B (en) * 2018-09-26 2021-11-02 深圳市大疆创新科技有限公司 Depth image fusion method and device and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106683130A (en) * 2015-11-11 2017-05-17 杭州海康威视数字技术股份有限公司 Depth image acquisition method and device
CN113110451A (en) * 2021-04-14 2021-07-13 浙江工业大学 Mobile robot obstacle avoidance method with depth camera and single line laser radar fused
CN113936099A (en) * 2021-09-30 2022-01-14 东北大学 Three-dimensional image reconstruction method and system based on monocular structured light and rotating platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于编码结构光的多视角三维重建技术研究》;蔡静怡;《优秀硕士论文》;全文 *

Also Published As

Publication number Publication date
CN116681746A (en) 2023-09-01

Similar Documents

Publication Publication Date Title
US11205282B2 (en) Relocalization method and apparatus in camera pose tracking process and storage medium
CN110502954B (en) Video analysis method and device
CN110097576B (en) Motion information determination method of image feature point, task execution method and equipment
CN110991457B (en) Two-dimensional code processing method and device, electronic equipment and storage medium
CN112565806B (en) Virtual gift giving method, device, computer equipment and medium
CN110738185B (en) Form object identification method, form object identification device and storage medium
CN110503159B (en) Character recognition method, device, equipment and medium
CN112308103B (en) Method and device for generating training samples
CN111586279B (en) Method, device and equipment for determining shooting state and storage medium
CN109754439B (en) Calibration method, calibration device, electronic equipment and medium
CN111127541B (en) Method and device for determining vehicle size and storage medium
CN113191976B (en) Image shooting method, device, terminal and storage medium
CN112396076A (en) License plate image generation method and device and computer storage medium
CN111353946A (en) Image restoration method, device, equipment and storage medium
CN111860064B (en) Video-based target detection method, device, equipment and storage medium
CN112235650A (en) Video processing method, device, terminal and storage medium
CN115798417A (en) Backlight brightness determination method, device, equipment and computer readable storage medium
CN116681746B (en) Depth image determining method and device
CN112950535B (en) Video processing method, device, electronic equipment and storage medium
CN112184802B (en) Calibration frame adjusting method, device and storage medium
CN111127539B (en) Parallax determination method and device, computer equipment and storage medium
CN110672036B (en) Method and device for determining projection area
CN107992230B (en) Image processing method, device and storage medium
CN112399080A (en) Video processing method, device, terminal and computer readable storage medium
CN113763486B (en) Dominant hue extraction method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant