# US 2023/0419522 A1 · Method for obtaining depth images, electronic device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0419522 A1
- Document ID: US20230419522A1
- Status: Published application
- Kind: A1
- Application number: 17/897,568
- Filed: 2022-08-29
- Published: 2023-12-28
- Earliest claimed: 2022-06-22
- Assignees: Hon Hai Precision Industry Co., Ltd.
- Applicants: Hon Hai Precision Industry Co., Ltd.
- Inventors: JUNG-HAO YANG; CHIN-PIN KUO; CHIH-TE LU
- Web page: https://patentgrep.com/patent/US20230419522A1

## CPC

- G06T 7/579: from motion
- G06T 7/174: involving the use of two or more images
- G06T 7/70: Determining position or orientation of objects or cameras (camera calibration G06T7/80)
- G06T 2207/10016: Video; Image sequence
- G06T 2207/10028: Range image; Depth image; 3D point clouds
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/30248: Vehicle exterior or interior
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A method for obtaining depth images implemented in an electronic device includes obtaining a first image and a second image; obtaining a predicted depth map of the first image, and calculating a first error value of the predicted depth map; determining a first transformation matrix between the first image and the second image; obtaining an instance segmentation image and obtaining a first mask image and a second mask image; obtaining a target transformation matrix; converting the predicted depth map into a first point cloud image, converting the first point cloud image into a second point cloud image, and converting the second point cloud image into a third image; calculating a second error value between the second image and the third image; obtaining a target deep learning network model; and inputting at least one image into the target deep learning network model, and obtaining at least one depth image.

## Claims

### Claim 1

A method for obtaining depth images implemented in an electronic device comprising:
obtaining a first image and a second image, the first image and the second image being adjacent frame images;
obtaining a predicted depth map of the first image based on a deep learning network model, and calculating a first error value of the predicted depth map by using a first preset loss function;
determining a first transformation matrix between the first image and the second image;
obtaining an instance segmentation image by performing an instance segmentation process on the first image, and obtaining a first mask image and a second mask image by performing a mask process on the instance segmentation image;
obtaining a target transformation matrix by performing an averaging process on the first transformation matrix according to the first mask image and the second mask image;
converting the predicted depth map into a first point cloud image based on internal parameters of a camera device, converting the first point cloud image into a second point cloud image based on the target transformation matrix, and converting the second point cloud image into a third image;
calculating a second error value between the second image and the third image by using a second preset loss function;
obtaining a target deep learning network model by adjusting the deep learning network model according to the first error value and the second error value; and
inputting at least one image to be detected into the target deep learning network model, and obtaining a depth image corresponding to each of the at least one image to be detected.

### Claim 2 (depends on 1)

The method according to claim 1, wherein obtaining a first mask image and a second mask image by performing a mask process on the instance segmentation image comprises:
obtaining the first mask image by performing the mask process on all moving objects in the instance segmentation image; and
obtaining the second mask image by performing the mask process on all non-moving objects in the instance segmentation image.

### Claim 3 (depends on 2)

The method according to claim 2, wherein obtaining a target transformation matrix by performing an averaging process on the first transformation matrix according to the first mask image and the second mask image comprises:
obtaining a second transformation matrix by performing the averaging process on the first transformation matrix based on the first mask image;
obtaining a third transformation matrix by perform the averaging process on the first transformation matrix based on the second mask image; and
obtaining a target transformation matrix by adding the second transformation matrix and the third transformation matrix.

### Claim 4 (depends on 3)

The method according to claim 3, wherein obtaining a second transformation matrix by performing the averaging process on the first transformation matrix based on the first mask image comprises:
obtaining a number of pixels of each moving object in the first mask image and the first transformation matrix corresponding to the pixels of each moving object; and
obtaining a transformation matrix of each moving object by performing the averaging process on the first transformation matrix according to the number of pixels of each moving object in the first mask image and the first transformation matrix, the transformation matrix of each moving object is taken as the second transformation matrix.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the deep learning network model includes a depth estimation network and a pose estimation network, obtaining the predicted depth map of the first image based on a deep learning network model comprises:
obtaining the predicted depth map by performing convolution and deconvolution operations on the first image through the depth estimation network.

### Claim 6 (depends on 5)

The method according to claim 5, wherein determining a first transformation matrix between the first image and the second image comprises:
obtaining the first transformation matrix between the first image and the second image by performing a convolution operation on the first image and the second image through the pose estimation network.

### Claim 7 (depends on 1)

The method according to claim 1, wherein obtaining an instance segmentation image by performing an instance segmentation process on the first image comprises:
obtaining an output image by inputting the first image into a pre-trained instance segmentation model;
detecting, based on the output image, segmentation accuracy of the instance segmentation model for segmenting the first image; and
in response that the segmentation accuracy is greater than a preset threshold, determining the output image to be the instance segmentation image.

### Claim 8 (depends on 1)

The method according to claim 1, wherein converting the predicted depth map into a first point cloud image based on internal parameters of a camera device comprises:
converting the predicted depth map into a first point cloud image according to the following formula:
D
[
x
1
y
1
1
]
=
KU
;
KU
=
[
f
x
0
c
x
0
f
y
c
y
0
0
1
]
[
x
y
z
]
,
in which, D represents a depth value of the predicted depth map, (x1, y1) represents a pixel coordinate corresponding to the depth value in the predicted depth map, K represents the internal parameters of the camera device, U represents a coordinate (x, y, z) of a point in the first point cloud image.

### Claim 9

An electronic device comprising:
at least one processor; and
a storage device coupled to the at least one processor and storing instructions for execution by the at least one processor to cause the at least one processor to:
obtain a first image and a second image, the first image and the second image are adjacent frame images;
obtain a predicted depth map of the first image based on a deep learning network model, and calculate a first error value of the predicted depth map by using a first preset loss function;
determine a first transformation matrix between the first image and the second image;
obtain an instance segmentation image by performing an instance segmentation process on the first image, and obtain a first mask image and a second mask image by performing a mask process on the instance segmentation image;
obtain a target transformation matrix by performing an averaging process on the first transformation matrix according to the first mask image and the second mask image;
convert the predicted depth map into a first point cloud image based on internal parameters of a camera device, convert the first point cloud image into a second point cloud image based on the target transformation matrix, and convert the second point cloud image into a third image;
calculate a second error value between the second image and the third image by using a second preset loss function;
obtain a target deep learning network model by adjusting the deep learning network model according to the first error value and the second error value; and
input at least one image to be detected into the target deep learning network model, and obtain a depth image corresponding to each of the at least one image to be detected.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor is further caused to:
obtain the first mask image by performing the mask process on all moving objects in the instance segmentation image; and
obtain the second mask image by performing the mask process on all non-moving objects in the instance segmentation image.

### Claim 11 (depends on 10)

The electronic device according to claim 10, wherein the at least one processor is further caused to:
obtain a second transformation matrix by performing the averaging process on the first transformation matrix based on the first mask image;
obtain a third transformation matrix by perform the averaging process on the first transformation matrix based on the second mask image; and
obtain a target transformation matrix by adding the second transformation matrix and the third transformation matrix.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the at least one processor is further caused to:
obtain a number of pixels of each moving object in the first mask image and the first transformation matrix corresponding to the pixels of each moving object; and
obtain a transformation matrix of each moving object by performing the averaging process on the first transformation matrix according to the number of pixels of each moving object in the first mask image and the first transformation matrix, the transformation matrix of each moving object is taken as the second transformation matrix.

### Claim 13 (depends on 9)

The electronic device according to claim 9, wherein the deep learning network model includes a depth estimation network and a pose estimation network, the at least one processor is further caused to:
obtain the predicted depth map by performing convolution and deconvolution operation on the first image through the depth estimation network.

### Claim 14 (depends on 13)

The electronic device according to claim 13, wherein the at least one processor is further caused to:
obtain the first transformation matrix between the first image and the second image by performing a convolution operation on the first image and the second image through the pose estimation network.

### Claim 15 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor is further caused to:
obtain an output image by inputting the first image into a pre-trained instance segmentation model;
detect, based on the output image, segmentation accuracy of the instance segmentation model for segmenting the first image; and
in response that the segmentation accuracy is greater than a preset threshold, determine the output image to be the instance segmentation image.

### Claim 16 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor is further caused to:
convert the predicted depth map into a first point cloud image according to the following formula:
D
[
x
1
y
1
1
]
=
KU
;
KU
=
[
f
x
0
c
x
0
f
y
c
y
0
0
1
]
[
x
y
z
]
,
in which, D represents a depth value of the predicted depth map, (x1, y1) represents a pixel coordinate corresponding to the depth value in the predicted depth map, K represents the internal parameters of the camera device, U represents a coordinate (x, y, z) of a point in the first point cloud image.

### Claim 17

A computer-readable storage medium having instructions stored thereon, when the instructions are executed by a processor of an electronic device, the processor is configured to perform a method for obtaining depth images, wherein the method comprises:
obtaining a first image and a second image, the first image and the second image being adjacent frame images;
obtaining a predicted depth map of the first image based on a deep learning network model, and calculating a first error value of the predicted depth map by using a first preset loss function;
determining a first transformation matrix between the first image and the second image;
obtaining an instance segmentation image by performing an instance segmentation process on the first image, and obtaining a first mask image and a second mask image by performing a mask process on the instance segmentation image;
obtaining a target transformation matrix by performing an averaging process on the first transformation matrix according to the first mask image and the second mask image;
converting the predicted depth map into a first point cloud image based on internal parameters of a camera device, converting the first point cloud image into a second point cloud image based on the target transformation matrix, and converting the second point cloud image into a third image;
calculating a second error value between the second image and the third image by using a second preset loss function;
obtaining a target deep learning network model by adjusting the deep learning network model according to the first error value and the second error value; and
inputting at least one image to be detected into the target deep learning network model, and obtaining a depth image corresponding to each of the at least one image to be detected.

### Claim 18 (depends on 17)

The storage medium according to claim 17, wherein obtaining a first mask image and a second mask image by performing a mask process on the instance segmentation image comprises:
obtaining the first mask image by performing the mask process on all moving objects in the instance segmentation image; and
obtaining the second mask image by performing the mask process on all non-moving objects in the instance segmentation image.

### Claim 19 (depends on 18)

The storage medium according to claim 18, wherein obtaining a target transformation matrix by performing an averaging process on the first transformation matrix according to the first mask image and the second mask image comprises:
obtaining a second transformation matrix by performing the averaging process on the first transformation matrix based on the first mask image;
obtaining a third transformation matrix by perform the averaging process on the first transformation matrix based on the second mask image; and
obtaining a target transformation matrix by adding the second transformation matrix and the third transformation matrix.

### Claim 20 (depends on 19)

The storage medium according to claim 19, wherein obtaining a second transformation matrix by performing the averaging process on the first transformation matrix based on the first mask image comprises:
obtaining a number of pixels of each moving object in the first mask image and the first transformation matrix corresponding to the pixels of each moving object; and
obtaining a transformation matrix of each moving object by performing the averaging process on the first transformation matrix according to the number of pixels of each moving object in the first mask image and the first transformation matrix, the transformation matrix of each moving object is taken as the second transformation matrix.
