CN113099210B - Three-dimensional image restoration method, device, computer equipment and storage medium - Google Patents
Three-dimensional image restoration method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113099210B CN113099210B CN202110349391.8A CN202110349391A CN113099210B CN 113099210 B CN113099210 B CN 113099210B CN 202110349391 A CN202110349391 A CN 202110349391A CN 113099210 B CN113099210 B CN 113099210B
- Authority
- CN
- China
- Prior art keywords
- image
- dimensional image
- dimensional
- relevant information
- restoration
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000013528 artificial neural network Methods 0.000 claims abstract description 58
- 238000012545 processing Methods 0.000 claims abstract description 30
- 238000004590 computer program Methods 0.000 claims description 29
- 230000008569 process Effects 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 9
- 238000012549 training Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 239000002131 composite material Substances 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 230000000903 blocking effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/20—Image signal generators
- H04N13/275—Image signal generators from 3D object models, e.g. computer-generated stereoscopic image signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/10—Processing, recording or transmission of stereoscopic or multi-view image signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/20—Image signal generators
- H04N13/204—Image signal generators using stereoscopic image cameras
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本申请涉及一种三维图像还原方法、装置、计算机设备和存储介质。所述方法包括:通过获取第一三维图像;将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;然后根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。采用本方法能够对目标进行三维图像还原,并判断真实三维图像中是否存在遮挡或者阴影,然后在判断真实三维图像中存在遮挡或阴影时,根据判断结果选择输出还原三维图像,从而达到提高三维图像还原精度的目的。
The present application relates to a three-dimensional image restoration method, device, computer equipment and storage medium. The method includes: acquiring a first three-dimensional image; inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image; and then judging the first three-dimensional image according to the first three-dimensional image and the second three-dimensional image. Whether there is an occluded part or a shadow part in the 3D image; if there is a occluded part or a shadow part in the first 3D image, output a second 3D image. This method can restore the 3D image of the target, and judge whether there is occlusion or shadow in the real 3D image, and then when judging that there is occlusion or shadow in the real 3D image, select and output the restored 3D image according to the judgment result, so as to improve the 3D image The purpose of restoring precision.
Description
技术领域technical field
本申请涉及三维图像处理技术领域,特别是涉及一种三维图像还原方法、装置、计算机设备和存储介质。The present application relates to the technical field of three-dimensional image processing, in particular to a three-dimensional image restoration method, device, computer equipment and storage medium.
背景技术Background technique
随着深度相机、激光传感器、图像处理器等硬件的发展及深度神经网络的发展,三维视觉技术已广泛应用于辅助智能驾驶汽车、服务机器人及工业机器人。由于这些机器人系统都处在动态场景中,这些系统经常会在移动过程中遇到遮挡、超出视野范围和光线变化的问题,遮挡会引起目标图像信息的丢失,会使得接下来的识别、检测和定位产生误差或失败;超出视野范围也会引起图像信息的丢失;光线变化会给目标图像信息带来误差。With the development of hardware such as depth cameras, laser sensors, and image processors, and the development of deep neural networks, 3D vision technology has been widely used in assisting intelligent driving cars, service robots, and industrial robots. Because these robot systems are in dynamic scenes, these systems often encounter problems such as occlusion, out of view range and light changes during the movement process. Occlusion will cause the loss of target image information, which will make the subsequent recognition, detection and Positioning errors or failures; exceeding the field of view will also cause loss of image information; changes in light will cause errors in target image information.
传统技术中,常见的例如用欧拉圆弧曲线的方法对三维物体模型的缺失轮廓来修复,此方法主要针对轮廓信息的修复,无法解决因遮挡而导致的图像还原精度不高的问题。In the traditional technology, it is common to repair the missing contour of the 3D object model by using the method of Euler arc curve. This method is mainly aimed at the restoration of contour information, and cannot solve the problem of low image restoration accuracy caused by occlusion.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种能够提高图像还原精度的三维图像还原方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a three-dimensional image restoration method, device, computer equipment and storage medium capable of improving image restoration accuracy in order to address the above technical problems.
一种三维图像还原方法,方法包括:A method for restoring a three-dimensional image, the method comprising:
获取第一三维图像;acquiring a first three-dimensional image;
将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;Inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;According to the first three-dimensional image and the second three-dimensional image, determine whether there is an occluded part or a shadow part in the first three-dimensional image;
若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。If the first three-dimensional image has an occluded part or a shadow part, output the second three-dimensional image.
在其中一个实施例中,获取第一三维图像,包括:In one of the embodiments, acquiring the first three-dimensional image includes:
获取拍摄对象的图像;acquire an image of the subject;
对拍摄对象的图像进行三维重建,得到第一三维图像。Three-dimensional reconstruction is performed on the image of the subject to obtain a first three-dimensional image.
在其中一个实施例中,对对拍摄对象的图像进行三维重建,得到第一三维图像包括:In one of the embodiments, performing three-dimensional reconstruction on the image of the subject to obtain the first three-dimensional image includes:
根据拍摄对象的图像,获取拍摄对象的三维点云信息;Obtain the 3D point cloud information of the subject according to the image of the subject;
根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。According to the 3D point cloud information of the shooting object, three-dimensional reconstruction is performed on the image of the shooting object to obtain a first three-dimensional image.
在其中一个实施例中,预设的图像还原神经网络通过以下方法获取:In one of the embodiments, the preset image restoration neural network is obtained by the following method:
获取初始样本图像,对初始样本图像进行随机区域的裁剪,并对被裁剪的区域赋值为黑色,得到样本图像;Obtain the initial sample image, crop the random area of the initial sample image, and assign black to the cropped area to obtain the sample image;
将样本图像输入初始的图像还原神经网络,经过卷积注意力层、三维卷积网络层和三维反卷积网络层处理,得到还原样本图像;Input the sample image into the initial image restoration neural network, and process it through the convolutional attention layer, the 3D convolutional network layer and the 3D deconvolutional network layer to obtain the restored sample image;
根据还原样本图像和初始样本图像调整初始的图像还原神经网络的网络权重,得到预设的图像还原神经网络。The network weights of the initial image restoration neural network are adjusted according to the restoration sample image and the initial sample image to obtain a preset image restoration neural network.
在其中一个实施例中,根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分,包括:In one of the embodiments, according to the first 3D image and the second 3D image, judging whether the first 3D image has an occluded part or a shadow part includes:
分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息;Respectively acquire relevant information of the first three-dimensional image and the second three-dimensional image, where the relevant information is color information or histogram information;
根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差;Obtaining a related information difference between the first 3D image and the second 3D image according to the related information of the first 3D image and the second 3D image;
根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分。According to the relevant information difference between the first 3D image and the second 3D image, it is judged whether there is an occluded part or a shadow part in the first 3D image.
在其中一个实施例中,根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分,包括:In one of the embodiments, according to the relevant information difference between the first 3D image and the second 3D image, it is judged whether there is an occluded part or a shadow part in the first 3D image, including:
根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值;According to the type of the relevant information, the relevant information difference range threshold corresponding to the relevant information is obtained;
若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;If the relevant information difference between the first three-dimensional image and the second three-dimensional image is within the relevant information difference range threshold, it is determined that there is no blocked part or shadow part in the three-dimensional image;
若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。If the relevant information difference between the first 3D image and the second 3D image is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the 3D image.
在其中一个实施例中,方法还包括:In one embodiment, the method also includes:
若三维图像不存在被遮挡部分且不存在阴影部分,输出三维图像。If there is no occluded part and no shadow part in the 3D image, output the 3D image.
一种三维图像还原装置,装置包括:A three-dimensional image restoration device, the device comprising:
图像获取模块,用于获取第一三维图像;An image acquisition module, configured to acquire the first three-dimensional image;
图像还原模块,用于将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;An image restoration module, configured to input the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
图像判断模块,用于根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;An image judging module, configured to judge whether there is an occluded part or a shadow part in the first three-dimensional image according to the first three-dimensional image and the second three-dimensional image;
图像输出模块,用于若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。The image output module is configured to output the second three-dimensional image if the first three-dimensional image has an occluded portion or a shadow portion.
一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现以下步骤:A computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
获取第一三维图像;acquiring a first three-dimensional image;
将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;Inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;According to the first three-dimensional image and the second three-dimensional image, determine whether there is an occluded part or a shadow part in the first three-dimensional image;
若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。If the first three-dimensional image has an occluded part or a shadow part, output the second three-dimensional image.
一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取第一三维图像;acquiring a first three-dimensional image;
将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;Inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;According to the first three-dimensional image and the second three-dimensional image, determine whether there is an occluded part or a shadow part in the first three-dimensional image;
若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。If the first three-dimensional image has an occluded part or a shadow part, output the second three-dimensional image.
上述三维图像还原方法、装置、计算机设备和存储介质,通过获取第一三维图像;将所述第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;然后根据所述第一三维图像和所述第二三维图像,判断所述第一三维图像是否存在被遮挡部分或阴影部分;若所述第一三维图像存在被遮挡部分或阴影部分,输出所述第二三维图像。本方案能够对目标进行三维图像还原,并判断真实三维图像中是否存在遮挡或者阴影,然后在判断真实三维图像中存在遮挡或阴影时,根据判断结果选择输出还原三维图像,从而达到提高三维图像还原精度的目的。The above-mentioned three-dimensional image restoration method, device, computer equipment, and storage medium obtain a first three-dimensional image; input the first three-dimensional image into a preset image restoration neural network for restoration processing, and obtain a second three-dimensional image; and then obtain a second three-dimensional image according to the The first three-dimensional image and the second three-dimensional image, judging whether the first three-dimensional image has an occluded portion or a shadow portion; if the first three-dimensional image has an occluded portion or a shadow portion, outputting the second three-dimensional image . This scheme can restore the 3D image of the target, and judge whether there is occlusion or shadow in the real 3D image, and then select and output the restored 3D image according to the judgment result when judging that there is occlusion or shadow in the real 3D image, so as to improve the restoration of 3D image purpose of precision.
附图说明Description of drawings
图1为一个实施例中一种三维图像还原方法的流程示意图;Fig. 1 is a schematic flow chart of a three-dimensional image restoration method in an embodiment;
图2为一个实施例中获取三维图像的流程示意图;Fig. 2 is a schematic flow chart of acquiring a three-dimensional image in one embodiment;
图3为一个实施例中建立预设的图像还原神经网络的流程示意图;Fig. 3 is a schematic flow chart of establishing a preset image restoration neural network in one embodiment;
图4为一个实施例中一种预设的图像还原神经网络的结构示意图;Fig. 4 is a schematic structural diagram of a preset image restoration neural network in an embodiment;
图5为一个实施例中判断是否存在被遮挡部分或阴影部分的流程示意图;Fig. 5 is a schematic flow chart of judging whether there is an occluded part or a shadow part in an embodiment;
图6为一个实施例中还原三维图像连续生成的流程示意图;Fig. 6 is a schematic flow chart of continuous generation of restored three-dimensional images in an embodiment;
图7为一个实施例中工业环境中一种三维图像还原的场景示意图;Fig. 7 is a schematic diagram of a scene of three-dimensional image restoration in an industrial environment in an embodiment;
图8为一个实施例中一种三维图像还原装置的结构框图;Fig. 8 is a structural block diagram of a three-dimensional image restoration device in an embodiment;
图9为一个实施例中计算机设备的内部结构图。Figure 9 is an internal block diagram of a computer device in one embodiment.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
在一个实施例中,如图1所示,提供了一种三维图像还原方法,本实施例以该方法应用于终端进行举例说明,可以理解的是,该方法也可以应用于服务器,还可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。本实施例中,该方法包括以下步骤:In one embodiment, as shown in FIG. 1 , a method for restoring a three-dimensional image is provided. In this embodiment, the method is applied to a terminal for illustration. It can be understood that the method can also be applied to a server or It is based on a system including a terminal and a server, and is realized through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
步骤102,获取第一三维图像。Step 102, acquiring a first three-dimensional image.
具体的,处理器获取图像,对该图像建立第一三维图像,其中第一三维图像就是指真实三维图像。在计算机视觉中,建立三维图像是指根据单视图或者多视图的图像重建三维信息的过程。单视图的信息不完全,因此根据单视图进行三维重建需要利用经验知识。而多视图的三维重建(类似人的双目定位)相对比较容易,其方法是先对摄像机进行标定,即计算出摄像机的图像坐标系与世界坐标系的关系,然后利用多个二维图像中的信息重建出三维信息。Specifically, the processor acquires an image, and establishes a first three-dimensional image on the image, where the first three-dimensional image refers to a real three-dimensional image. In computer vision, creating a 3D image refers to the process of reconstructing 3D information from single-view or multi-view images. The information of a single view is incomplete, so 3D reconstruction from a single view needs to utilize empirical knowledge. The multi-view 3D reconstruction (similar to human binocular positioning) is relatively easy. The method is to calibrate the camera first, that is, calculate the relationship between the camera's image coordinate system and the world coordinate system, and then use multiple 2D images to information to reconstruct three-dimensional information.
步骤104,将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像。Step 104, inputting the first 3D image into a preset image restoration neural network for restoration processing to obtain a second 3D image.
具体的,将真实三维图像输入预设的图像还原神经网络中,预设的图像还原神经网络输出第二三维图像,其中,第二三维图像就是指还原三维图像。Specifically, the real 3D image is input into a preset image restoration neural network, and the preset image restoration neural network outputs a second 3D image, wherein the second 3D image refers to a restored 3D image.
其中,预设的图像还原神经网络是根据样本三维图像提取的训练集训练获取的,训练集的样本越多,训练完成后的预设的图像还原神经网络的精度越高,预设的图像还原神经网络输出的还原三维图像越准确。预设的图像还原神经网络可以是由单个神经网络构成,例如三维卷积网络;也可以是由多个神经网络组成的复合神经网络,例如由多个三维卷积网络和三维反卷积网络组成的复合神经网络。Among them, the preset image restoration neural network is obtained according to the training set extracted from the three-dimensional image of the sample. The more samples in the training set, the higher the accuracy of the preset image restoration neural network after the training is completed. The preset image restoration The restored 3D image output by the neural network is more accurate. The preset image restoration neural network can be composed of a single neural network, such as a three-dimensional convolutional network; it can also be a composite neural network composed of multiple neural networks, such as multiple three-dimensional convolutional networks and three-dimensional deconvolutional networks composite neural network.
步骤106,根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分。Step 106, according to the first 3D image and the second 3D image, determine whether there is an occluded part or a shadow part in the first 3D image.
具体的,比较还原三维图像和真实三维图像,采用遮挡判断算法,判断第真实三维图像中是否存在被遮挡部分或阴影部分。Specifically, compare the restored 3D image and the real 3D image, and use an occlusion judgment algorithm to judge whether there is an occluded part or a shadow part in the first real 3D image.
其中,目前存在多种遮挡判断算法,例如迭代次数判定法:在当前帧图像中运用Kalman滤波算法预估其在下一帧的位置,得到估计位置,在估计位置处设置跟踪窗口,在跟踪窗口内用Mean Shift算法搜索与导弹弹标模板最相似的位置作为导弹弹标的精确位置,根据Mean Shift算法的迭代次数判断目标是否发生遮挡或丢失,对算法的迭代次数进行限制,如果在限制次数内找到目标,则没有丢失,直接给出位置;如果在限制次数内没有找到目标,则发生遮挡或丢失,扩大窗口宽度重新寻找。还例如相似度判定法:对于第k帧图像,给定阈值Th,如果Bhattacharyya系数ρ(yk)≥Th,则没有遮挡,正常跟踪;反之如果ρ(yk)<;Th,则表示发生遮挡;还例如残差判定法:在当前帧中,根据Kalman滤波器关于目标位置的估计值与由Mean Shift算法得到的Kalman滤波器的测量值之间残差的大小来判断是否出现了大比例的遮挡。本实施例中,根据不同的实施场景,选择适合的遮挡判断算法。Among them, there are currently many occlusion judgment algorithms, such as the number of iterations judgment method: use the Kalman filter algorithm to estimate its position in the next frame in the current frame image, obtain the estimated position, set the tracking window at the estimated position, and set the tracking window in the tracking window Use the Mean Shift algorithm to search for the position most similar to the missile target template as the precise position of the missile target, judge whether the target is blocked or lost according to the number of iterations of the Mean Shift algorithm, and limit the number of iterations of the algorithm. If the target is not lost, the position is given directly; if the target is not found within the limited number of times, occlusion or loss occurs, and the window width is enlarged to search again. Also for example similarity determination method: for the k frame image, given threshold Th, if Bhattacharyya coefficient ρ (yk) ≥ Th, then there is no occlusion, normal tracking; otherwise if ρ (yk) < Th, it means occlusion occurs; Another example is the residual judgment method: In the current frame, it is judged whether a large proportion of occlusions occurs according to the magnitude of the residual between the estimated value of the Kalman filter on the target position and the measured value of the Kalman filter obtained by the Mean Shift algorithm . In this embodiment, an appropriate occlusion judgment algorithm is selected according to different implementation scenarios.
步骤108,若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。Step 108, if the first 3D image has an occluded portion or a shadow portion, output a second 3D image.
具体的,若真实三维图像中存在被遮挡部分或阴影部分,则需要对该真实三维图像进行还原处理,生成无遮挡无阴影的三维图像,故输出还原三维图像。若真实三维图像中不存在被遮挡部分或阴影部分,则无需对该真实三维图像进行还原处理,直接输出该真实三维图像。Specifically, if there is an occluded part or a shadow part in the real 3D image, the real 3D image needs to be restored to generate a 3D image without occlusion and shadow, so the restored 3D image is output. If there is no occluded part or shadow part in the real 3D image, the real 3D image is directly output without restoring the real 3D image.
上述三维图像还原方法,通过获取第一三维图像;将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;然后根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。本方案能够对目标进行三维图像还原,并判断真实三维图像中是否存在遮挡或者阴影,然后在判断真实三维图像中存在遮挡或阴影时,根据判断结果选择输出还原三维图像,从而达到提高三维图像还原精度的目的。The above three-dimensional image restoration method obtains the first three-dimensional image; inputs the first three-dimensional image into the preset image restoration neural network for restoration processing, and obtains the second three-dimensional image; then judges the second three-dimensional image according to the first three-dimensional image and the second three-dimensional image. Whether there is a occluded part or a shadow part in a 3D image; if there is a occluded part or a shadow part in the first 3D image, output a second 3D image. This scheme can restore the 3D image of the target, and judge whether there is occlusion or shadow in the real 3D image, and then select and output the restored 3D image according to the judgment result when judging that there is occlusion or shadow in the real 3D image, so as to improve the restoration of 3D image purpose of precision.
在一个实施例中,获取第一三维图像,包括:获取拍摄对象的图像;对拍摄对象的图像进行三维重建,得到第一三维图像。In one embodiment, acquiring the first three-dimensional image includes: acquiring an image of the subject; performing three-dimensional reconstruction on the image of the subject to obtain the first three-dimensional image.
进一步的,对对拍摄对象的图像进行三维重建,得到第一三维图像包括:根据拍摄对象的图像,获取拍摄对象的三维点云信息;根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。Further, performing 3D reconstruction on the image of the subject to obtain the first 3D image includes: acquiring 3D point cloud information of the subject according to the image of the subject; 3D reconstruction to obtain the first 3D image.
在一个实施例中,如图2所示,获取第一三维图像,包括:In one embodiment, as shown in Figure 2, acquiring the first three-dimensional image includes:
步骤202,获取拍摄对象的图像。Step 202, acquiring an image of the object to be photographed.
具体的,通过图像采集装置对拍摄对象采集连续时刻图像。图像采集装置可以是摄像头或者相机。相机搭载在机器人系统上,机器人系统通过相机采集的信息完成多目标识别,机器人系统可以是指包括智能驾驶汽车、服务机器人、工业机器人等;拍摄对象可以指汽车、人、工业零件等。光照条件、相机的几何特性等对后续的图像处理造成很大的影响。Specifically, an image acquisition device is used to acquire continuous time images of the subject. The image acquisition device may be a camera or a camera. The camera is mounted on the robot system, and the robot system completes multi-target recognition through the information collected by the camera. The robot system can refer to smart driving cars, service robots, industrial robots, etc.; the shooting objects can refer to cars, people, industrial parts, etc. The lighting conditions, the geometric characteristics of the camera, etc. have a great influence on the subsequent image processing.
步骤204,根据拍摄对象的图像,获取拍摄对象的三维点云信息。Step 204, according to the image of the subject, acquire the three-dimensional point cloud information of the subject.
具体的,三维点云信息又称三维点云数据。某些情况下,三维点云信息还包含彩色图像信息。Specifically, three-dimensional point cloud information is also called three-dimensional point cloud data. In some cases, the 3D point cloud information also contains color image information.
步骤206,根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。Step 206: Perform 3D reconstruction on the image of the subject according to the 3D point cloud information of the subject to obtain a first 3D image.
具体的,基于拍摄对象在不同时刻的三维点云信息,对拍摄对象进行三维重建,获取全局点云信息。然后选取与全局点云信息对应的区域存在重叠区的局部区域进行测量,获取局部点云信息再进行配准并更新全局点云信息,重复此过程直至完成所有表面区域的测量,最后对测量完成后更新的全局点云数据进行全局优化处理,得到点云模型。Specifically, based on the three-dimensional point cloud information of the shooting object at different moments, the three-dimensional reconstruction of the shooting object is performed to obtain the global point cloud information. Then select the local area that overlaps with the global point cloud information for measurement, obtain the local point cloud information and then register and update the global point cloud information, repeat this process until the measurement of all surface areas is completed, and finally the measurement is completed The updated global point cloud data is then globally optimized to obtain a point cloud model.
可选的,根据拍摄对象的图像进行三维重建,获取重建后的三维图像通常包括摄像机标定、特征提取、立体匹配和三维重建。Optionally, 3D reconstruction is performed according to the image of the subject, and obtaining the reconstructed 3D image usually includes camera calibration, feature extraction, stereo matching and 3D reconstruction.
在一个实施例中,如图3所示,预设的图像还原神经网络通过以下方法获取:In one embodiment, as shown in Figure 3, the preset image restoration neural network is obtained by the following method:
步骤302,获取初始样本图像,对初始样本图像进行随机区域的裁剪,并对被裁剪的区域赋值为黑色,得到样本图像。Step 302, acquiring an initial sample image, clipping a random area on the initial sample image, and assigning a black value to the cropped area to obtain a sample image.
具体的,获取训练集,训练集至少包括一个进行随机区域的裁剪的样本图像。Specifically, a training set is obtained, and the training set includes at least one sample image for cropping a random region.
步骤304,将样本图像输入初始的图像还原神经网络,经过卷积注意力层、三维卷积网络层和三维反卷积网络层处理,得到还原样本图像。Step 304, input the sample image into the initial image restoration neural network, and process through the convolution attention layer, the 3D convolution network layer and the 3D deconvolution network layer to obtain the restored sample image.
具体的,图像还原神经网络可以是由单个神经网络模型构成,例如三维卷积网络;也可以是由多个神经网络组成的复合神经网络,例如由多个三维卷积网络和三维反卷积网络组成的复合神经网络。Specifically, the image restoration neural network can be composed of a single neural network model, such as a three-dimensional convolutional network; it can also be a composite neural network composed of multiple neural networks, such as multiple three-dimensional convolutional networks and three-dimensional deconvolutional networks composed of composite neural networks.
步骤306,根据还原样本图像和初始样本图像调整初始的图像还原神经网络的网络权重,得到预设的图像还原神经网络。Step 306 , adjusting the network weights of the initial image restoration neural network according to the restored sample image and the initial sample image to obtain a preset image restoration neural network.
具体地,图像还原神经网络是根据样本图像提取的训练集训练获取的。Specifically, the image restoration neural network is trained and acquired according to the training set extracted from sample images.
例如,图像还原神经网络包括依次串联的输入层、不少于一个注意力层、不少于一个三维卷积网络层、不少于一个三维反卷积网络层和输出层;注意力层用于对接收到的图像特征执行卷积注意力计算得到注意力图像特征。三维卷积网络层和三维反卷积网络层用于根据接收的图像特征进行三维图像还原。For example, the image restoration neural network includes sequentially connected input layers, no less than one attention layer, no less than one three-dimensional convolutional network layer, no less than one three-dimensional deconvolution network layer, and an output layer; the attention layer is used for Attention image features are obtained by performing convolutional attention computation on the received image features. The 3D convolutional network layer and the 3D deconvolutional network layer are used for 3D image restoration according to the received image features.
如图4所示,为一个实施例中图像还原神经网络的网络拓扑图,图4中的图像还原神经网络中依次串联输入层Input、卷积注意力层ConvAttention、三维卷积网络层Conv3D、卷积注意力层ConvAttention、3个三维卷积网络层Conv3D、2个三维反卷积网络层Conv3DT、卷积注意力层ConvAttention、三维反卷积网络层Conv3DT、卷积注意力层ConvAttention、2个三维反卷积网络层Conv3DT和输出层Output。图4包含网络基本配置及处理后张量的尺寸(网络中每层处理后的输出成为张量)。“2*2*2*64”指卷积核的尺寸是2*2*2,步长是2,卷积核个数是64,每层都需要进行补零操作。例如,“[l/2,w/2,h/2,64]”指的是经过处理的张量的尺寸。三维卷积网络层与三维反卷积网络层结合的结构因本身是时序结构,能更好地学习目标三维图像的运动时序关系。引入卷积注意力层能促进网络更关注三维图像的主要部分,提升网络学习和还原三维图像的能力。As shown in Figure 4, it is a network topology diagram of the image restoration neural network in one embodiment, in the image restoration neural network in Figure 4, the input layer Input, the convolutional attention layer ConvAttention, the three-dimensional convolutional network layer Conv3D, the volume Product attention layer ConvAttention, 3 3D convolution network layers Conv3D, 2 3D deconvolution network layers Conv3DT, convolution attention layer ConvAttention, 3D deconvolution network layer Conv3DT, convolution attention layer ConvAttention, 2 3D The deconvolution network layer Conv3DT and the output layer Output. Figure 4 contains the basic configuration of the network and the size of the processed tensor (the processed output of each layer in the network becomes a tensor). "2*2*2*64" means that the size of the convolution kernel is 2*2*2, the step size is 2, the number of convolution kernels is 64, and zero padding is required for each layer. For example, "[l/2,w/2,h/2,64]" refers to the dimensions of the processed tensor. The structure of the combination of the 3D convolutional network layer and the 3D deconvolutional network layer is a sequential structure, which can better learn the motion timing relationship of the target 3D image. The introduction of the convolutional attention layer can promote the network to pay more attention to the main part of the 3D image, and improve the ability of the network to learn and restore the 3D image.
例如,假设输入1个图像,其尺寸是[l,w,h,c],l、w、h、c分别指的是长、宽、高和通道数目。经过连接和ConvAttention处理后得到张量尺寸为[l,w,h,c],经过64个2*2*2卷积核步长为2的Conv3D处理后得到张量尺寸为[l/2,w/2,h/2,64],经过ConvAttention处理和128个卷积核的Conv3D处理后得到张量尺寸为[l/4,w/4,h/4,128],经过256个2*2*2卷积核步长为2的Conv3D处理后得到张量尺寸为[l/8,w/8,h/8,256],经过512个2*2*2卷积核步长为2的Conv3D处理后得到张量尺寸为[l/16,w/16,h/16,512],经过1024个2*2*2卷积核步长为2的Conv3DT处理后得到张量尺寸为[l/8,w/8,h/8,1024],经过512个2*2*2卷积核步长为2的Conv3DT处理后得到张量尺寸为[l/4,w/4,h/4,512],经过ConvAttention处理和256个卷积核的Conv3DT处理后得到张量尺寸为[l/2,w/2,h/2,256],经过ConvAttention处理和128个卷积核的Conv3DT处理后得到张量尺寸为[l,w,h,128],经过c个2*2*2卷积核步长为2的Conv3DT处理后得到张量尺寸为[l,w,h,c],输出该张量。For example, suppose an image is input, and its size is [l, w, h, c], where l, w, h, and c refer to the length, width, height, and number of channels, respectively. After connection and ConvAttention processing, the tensor size is [l,w,h,c], and the tensor size is [l/2, w/2,h/2,64], after ConvAttention processing and Conv3D processing of 128 convolution kernels, the tensor size is [l/4,w/4,h/4,128], after 256 2*2* 2 After Conv3D processing with a convolution kernel step size of 2, the tensor size is [l/8, w/8, h/8, 256], after 512 Conv3D processing with a 2*2*2 convolution kernel step size of 2 The obtained tensor size is [l/16,w/16,h/16,512], after 1024 Conv3DT processing with 2*2*2 convolution kernel step size 2, the tensor size is [l/8,w/ 8, h/8, 1024], after 512 Conv3DT processing with 2*2*2 convolution kernel step size 2, the tensor size is [l/4, w/4, h/4, 512], after ConvAttention processing After Conv3DT processing with 256 convolution kernels, the tensor size is [l/2, w/2, h/2, 256], after ConvAttention processing and Conv3DT processing with 128 convolution kernels, the tensor size is [l, w,h,128], after c Conv3DT processing with a 2*2*2 convolution kernel step size of 2, the tensor size is [l,w,h,c], and the tensor is output.
在一个实施例中,根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分,包括:分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息;根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差;根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分。In one embodiment, according to the first 3D image and the second 3D image, judging whether there is an occluded part or a shadow part in the first 3D image includes: obtaining relevant information of the first 3D image and the second 3D image respectively, and the relevant information is color information or histogram information; according to the relevant information of the first 3D image and the second 3D image, the relevant information difference between the first 3D image and the second 3D image is obtained; according to the relevant information of the first 3D image and the second 3D image Poor, determine whether there is an occluded part or a shadow part in the first 3D image.
进一步的,根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分,包括:根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值;若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。Further, according to the relevant information difference between the first 3D image and the second 3D image, judging whether there is an occluded part or a shadow part in the first 3D image, including: according to the type of relevant information, obtaining the relevant information difference range corresponding to the relevant information Threshold; if the relevant information difference between the first three-dimensional image and the second three-dimensional image is in the relevant information difference range threshold, it is determined that there is no occluded part or shadow part in the three-dimensional image; if the relevant information difference between the first three-dimensional image and the second three-dimensional image If it is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the three-dimensional image.
在一个实施例中,如图5所示,根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分,包括:In one embodiment, as shown in FIG. 5, according to the first three-dimensional image and the second three-dimensional image, judging whether there is an occluded part or a shadow part in the first three-dimensional image includes:
步骤502,分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息或其他信息。In step 502, relevant information of the first 3D image and the second 3D image are obtained respectively, and the relevant information is color information or histogram information or other information.
具体的,分别获取真实三维图像和还原三维图像的颜色信息或直方图信息。Specifically, color information or histogram information of the real 3D image and the restored 3D image are acquired respectively.
步骤504,根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差。Step 504, according to the relevant information of the first 3D image and the second 3D image, obtain the difference of relevant information between the first 3D image and the second 3D image.
具体的,根据真实三维图像和还原三维图像的颜色信息或直方图信息,得到真实三维图像和还原三维图像的颜色信息差或直方图信息差。Specifically, according to the color information or histogram information of the real 3D image and the restored 3D image, a color information difference or a histogram information difference between the real 3D image and the restored 3D image is obtained.
步骤506,根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值。Step 506, according to the type of the relevant information, obtain the relevant information difference range threshold corresponding to the relevant information.
具体的,根据颜色信息和直方图信息的特点,设定不同的相关信息差阈值,若当前获取的是颜色信息,就设定一个颜色信息差阈值±M%,若当前获取的是直方图信息,就设定一个直方图信息差阈值±N%,通常情况下,M和N不小于3。Specifically, according to the characteristics of color information and histogram information, set different relevant information difference thresholds. If the current acquisition is color information, set a color information difference threshold ±M%. If the current acquisition is histogram information , set a histogram information difference threshold ±N%, usually, M and N are not less than 3.
步骤508,若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。Step 508, if the relevant information difference between the first 3D image and the second 3D image is within the relevant information difference range threshold, it is determined that there is no occluded part or shadow part in the 3D image; if the relevant information of the first 3D image and the second 3D image If the difference is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the 3D image.
具体的,例如,若真实三维图像和还原三维图像的颜色信息差处于颜色信息差阈值范围,判定真实三维图像中不存在被遮挡部分或阴影部分;若真实三维图像和还原三维图像的颜色信息差不处于颜色信息差阈值范围,判定真实三维图像中存在被遮挡部分或阴影部分。Specifically, for example, if the color information difference between the real 3D image and the restored 3D image is within the color information difference threshold range, it is determined that there is no occluded or shadowed portion in the real 3D image; if the color information difference between the real 3D image and the restored 3D image is If it is not within the color information difference threshold range, it is determined that there is an occluded part or a shadow part in the real 3D image.
在一个实施例中,方法还包括:若三维图像不存在被遮挡部分且不存在阴影部分,输出三维图像。In one embodiment, the method further includes: if there is no occluded part and no shadow part in the three-dimensional image, outputting the three-dimensional image.
具体的,若真实三维图像就不存在被遮挡部分且不存在阴影部分,则原图像无需被还原,故直接输出真实三维图像。Specifically, if there is no occluded part and no shadow part in the real 3D image, the original image does not need to be restored, so the real 3D image is directly output.
在一个实施例中,如图6所示,提供了一种三维图像还原方法,该方法以应用于如图7所示的工业环境进行举例说明,该方法包括:获取传送带上工件的图像。对工件的图像进行三维重建,得到真实三维图像。获取真实三维图像,将真实三维图像输入预设的图像还原神经网络进行还原处理,得到还原三维图像;根据真实三维图像和还原三维图像,判断真实三维图像是否存在被遮挡部分或阴影部分;若真实三维图像存在被遮挡部分或阴影部分,输出还原三维图像。In one embodiment, as shown in FIG. 6 , a method for restoring a three-dimensional image is provided. The method is illustrated by being applied to an industrial environment as shown in FIG. 7 . The method includes: acquiring an image of a workpiece on a conveyor belt. Perform 3D reconstruction on the image of the workpiece to obtain a real 3D image. Obtain a real 3D image, input the real 3D image into the preset image restoration neural network for restoration processing, and obtain a restored 3D image; according to the real 3D image and the restored 3D image, judge whether there is an occluded part or a shadow part in the real 3D image; if true If there are occluded or shadowed parts in the 3D image, the restored 3D image will be output.
具体的,传送带开始运行,自动化装置开始往传送带上摆放工件。开始工件三维图像还原,工业机器人上的三维相机采集传送带上的工件的三维点云,对该三维点云进行三维重建得出三维图像i。使用三维图像i输入预设的图像还原神经网络中得到还原三维图像i’,根据遮挡判断算法比较i和i’判断当前工件的状态是否处于遮挡状态,可以比较i和i’的颜色信息,如果两者的颜色信息差值在±M%(M≥3)范围内,则认为工件不处于遮挡状态,输出i。如果两者的颜色信息差值比处于±M%(M≥3)范围,则认为工件处于遮挡状态,则输出i’。判断是否要继续进行图像采集,若需要,则采集下一张图像,并对下一张图像进行上述还原处理,若不需要,则停止工件三维图像还原。Specifically, the conveyor belt starts to run, and the automatic device starts to place workpieces on the conveyor belt. Start the restoration of the 3D image of the workpiece. The 3D camera on the industrial robot collects the 3D point cloud of the workpiece on the conveyor belt, and performs 3D reconstruction on the 3D point cloud to obtain a 3D image i. Use the 3D image i to input the preset image restoration neural network to obtain the restored 3D image i', compare i and i' according to the occlusion judgment algorithm to judge whether the state of the current workpiece is in the occlusion state, and compare the color information of i and i', if If the color information difference between the two is within the range of ±M% (M≥3), it is considered that the workpiece is not in a blocking state, and i is output. If the color information difference ratio of the two is in the range of ±M% (M≥3), it is considered that the workpiece is in a blocking state, and i' is output. Determine whether to continue image acquisition, if necessary, acquire the next image, and perform the above restoration process on the next image, if not, stop the restoration of the three-dimensional image of the workpiece.
本实施例中,通过获取真实三维图像;将真实三维图像输入预设的图像还原神经网络进行还原处理,得到还原三维图像;然后根据真实三维图像和还原三维图像,判断真实三维图像是否存在被遮挡部分或阴影部分;若真实三维图像存在被遮挡部分或阴影部分,输出还原三维图像。本方案能够对目标进行三维图像还原,并判断真实三维图像中是否存在遮挡或者阴影,然后在判断真实三维图像中存在遮挡或阴影时,根据判断结果选择输出还原三维图像,从而达到提高三维图像还原精度的目的。In this embodiment, by acquiring a real 3D image; inputting the real 3D image into a preset image restoration neural network for restoration processing, a restored 3D image is obtained; and then judging whether the real 3D image is blocked according to the real 3D image and the restored 3D image part or shaded part; if the real 3D image has an occluded part or a shadowed part, output the restored 3D image. This scheme can restore the 3D image of the target, and judge whether there is occlusion or shadow in the real 3D image, and then select and output the restored 3D image according to the judgment result when judging that there is occlusion or shadow in the real 3D image, so as to improve the restoration of 3D image purpose of precision.
应该理解的是,虽然图1-3、5-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-3、5-6中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of FIGS. 1-3 and 5-6 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figures 1-3, 5-6 may include multiple steps or stages, these steps or stages are not necessarily executed at the same time, but may be executed at different times, these steps Or the execution sequence of the stages is not necessarily performed sequentially, but may be executed in turn or alternately with other steps or at least a part of steps or stages in other steps.
在一个实施例中,如图8所示,提供了一种三维图像还原装置800,包括:图像获取模块801、图像还原模块802、图像判断模块803和图像输出模块804,In one embodiment, as shown in FIG. 8 , a three-dimensional image restoration device 800 is provided, including: an
其中:in:
图像获取模块801,用于获取第一三维图像。An
图像还原模块802,用于将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像。The
图像判断模块803,用于根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分。The
图像输出模块804,用于若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。An
在一个实施例中,图像获取模块801包括:In one embodiment, the
图像拍摄子模块,用于获取拍摄对象的图像。The image capture sub-module is used to acquire images of objects to be photographed.
三维重建子模块,用于对拍摄对象的图像进行三维重建,得到第一三维图像。The three-dimensional reconstruction sub-module is used to perform three-dimensional reconstruction on the image of the subject to obtain the first three-dimensional image.
在一个实施例中,三维重建子模块还包括:In one embodiment, the three-dimensional reconstruction submodule also includes:
三维信息获取单元,用于根据拍摄对象的图像,获取拍摄对象的三维点云信息。The three-dimensional information acquisition unit is configured to acquire the three-dimensional point cloud information of the object according to the image of the object.
三维图像重建单元,用于根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。The three-dimensional image reconstruction unit is configured to perform three-dimensional reconstruction on the image of the object to obtain the first three-dimensional image according to the three-dimensional point cloud information of the object.
在一个实施例中,图像还原模块802包括:In one embodiment, the
样本获取子模块,用于获取初始样本图像,对初始样本图像进行随机区域的裁剪,并对被裁剪的区域赋值为黑色,得到样本图像。The sample acquisition sub-module is used to acquire an initial sample image, crop a random area of the initial sample image, and assign a black color to the cropped area to obtain a sample image.
模型训练子模块,用于将样本图像输入初始的图像还原神经网络,经过卷积注意力层、三维卷积网络层和三维反卷积网络层处理,得到还原样本图像。The model training sub-module is used to input the sample image into the initial image restoration neural network, and obtain the restored sample image through the convolution attention layer, the 3D convolution network layer and the 3D deconvolution network layer.
模型生成子模块,用于根据还原样本图像和初始样本图像调整初始的图像还原神经网络的网络权重,得到预设的图像还原神经网络。The model generation sub-module is used to adjust the network weights of the initial image restoration neural network according to the restored sample image and the initial sample image to obtain a preset image restoration neural network.
在一个实施例中,图像判断模块803包括:In one embodiment, the
相关信息获取子模块,用于分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息。The related information acquiring sub-module is used to acquire related information of the first three-dimensional image and the second three-dimensional image respectively, and the related information is color information or histogram information.
信息差获取子模块,用于根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差。The information difference obtaining sub-module is used to obtain the relevant information difference between the first 3D image and the second 3D image according to the relevant information of the first 3D image and the second 3D image.
信息差判定子模块,用于根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分。The information difference judging sub-module is used to judge whether there is an occluded part or a shadow part in the first 3D image according to the related information difference between the first 3D image and the second 3D image.
在一个实施例中,信息差判定子模块还包括:In one embodiment, the information difference determination submodule also includes:
范围阈值设定单元,用于根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值。The range threshold setting unit is configured to acquire the related information difference range threshold corresponding to the related information according to the type of the related information.
范围阈值判定单元,用于若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。A range threshold judging unit, configured to determine that there is no occluded part or shadow part in the three-dimensional image if the relevant information difference between the first three-dimensional image and the second three-dimensional image is within the relevant information difference range threshold; if the first three-dimensional image and the second three-dimensional If the relevant information difference of the image is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the three-dimensional image.
在一个实施例中,图像输出模块804还用于若三维图像不存在被遮挡部分且不存在阴影部分,输出三维图像。In one embodiment, the
关于三维图像还原装置的具体限定可以参见上文中对于三维图像还原方法的限定,在此不再赘述。上述三维图像还原装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the three-dimensional image restoration apparatus, refer to the above-mentioned limitations on the three-dimensional image restoration method, which will not be repeated here. Each module in the above-mentioned three-dimensional image restoration device may be fully or partially realized by software, hardware or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种三维图像还原方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure may be as shown in FIG. 9 . The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, an operator network, NFC (Near Field Communication) or other technologies. When the computer program is executed by a processor, a method for restoring a three-dimensional image is realized. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad or mouse.
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
获取第一三维图像;acquiring a first three-dimensional image;
将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;Inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;According to the first three-dimensional image and the second three-dimensional image, determine whether there is an occluded part or a shadow part in the first three-dimensional image;
若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。If the first three-dimensional image has an occluded part or a shadow part, output the second three-dimensional image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
获取拍摄对象的图像;acquire an image of the subject;
对拍摄对象的图像进行三维重建,得到第一三维图像。Three-dimensional reconstruction is performed on the image of the subject to obtain a first three-dimensional image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
根据拍摄对象的图像,获取拍摄对象的三维点云信息;Obtain the 3D point cloud information of the subject according to the image of the subject;
根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。According to the 3D point cloud information of the shooting object, three-dimensional reconstruction is performed on the image of the shooting object to obtain a first three-dimensional image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
获取初始样本图像,对初始样本图像进行随机区域的裁剪,并对被裁剪的区域赋值为黑色,得到样本图像;Obtain the initial sample image, crop the random area of the initial sample image, and assign black to the cropped area to obtain the sample image;
将样本图像输入初始的图像还原神经网络,经过卷积注意力层、三维卷积网络层和三维反卷积网络层处理,得到还原样本图像;Input the sample image into the initial image restoration neural network, and process it through the convolutional attention layer, the 3D convolutional network layer and the 3D deconvolutional network layer to obtain the restored sample image;
根据还原样本图像和初始样本图像调整初始的图像还原神经网络的网络权重,得到预设的图像还原神经网络。The network weights of the initial image restoration neural network are adjusted according to the restoration sample image and the initial sample image to obtain a preset image restoration neural network.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息;Respectively acquire relevant information of the first three-dimensional image and the second three-dimensional image, where the relevant information is color information or histogram information;
根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差;Obtaining a related information difference between the first 3D image and the second 3D image according to the related information of the first 3D image and the second 3D image;
根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分。According to the relevant information difference between the first 3D image and the second 3D image, it is judged whether there is an occluded part or a shadow part in the first 3D image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值;According to the type of the relevant information, the relevant information difference range threshold corresponding to the relevant information is obtained;
若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;If the relevant information difference between the first three-dimensional image and the second three-dimensional image is within the relevant information difference range threshold, it is determined that there is no blocked part or shadow part in the three-dimensional image;
若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。If the relevant information difference between the first 3D image and the second 3D image is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the 3D image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the following steps are also implemented when the processor executes the computer program:
若三维图像不存在被遮挡部分且不存在阴影部分,输出三维图像。If there is no occluded part and no shadow part in the 3D image, output the 3D image.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取第一三维图像;acquiring a first three-dimensional image;
将第一三维图像输入预设的图像还原神经网络进行还原处理,得到第二三维图像;Inputting the first three-dimensional image into a preset image restoration neural network for restoration processing to obtain a second three-dimensional image;
根据第一三维图像和第二三维图像,判断第一三维图像是否存在被遮挡部分或阴影部分;According to the first three-dimensional image and the second three-dimensional image, determine whether there is an occluded part or a shadow part in the first three-dimensional image;
若第一三维图像存在被遮挡部分或阴影部分,输出第二三维图像。If the first three-dimensional image has an occluded part or a shadow part, output the second three-dimensional image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
获取拍摄对象的图像;acquire an image of the subject;
对拍摄对象的图像进行三维重建,得到第一三维图像。Three-dimensional reconstruction is performed on the image of the subject to obtain a first three-dimensional image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
根据拍摄对象的图像,获取拍摄对象的三维点云信息;Obtain the 3D point cloud information of the subject according to the image of the subject;
根据拍摄对象的三维点云信息,对拍摄对象的图像进行三维重建,得到第一三维图像。According to the 3D point cloud information of the shooting object, three-dimensional reconstruction is performed on the image of the shooting object to obtain a first three-dimensional image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
获取初始样本图像,对初始样本图像进行随机区域的裁剪,并对被裁剪的区域赋值为黑色,得到样本图像;Obtain the initial sample image, crop the random area of the initial sample image, and assign black to the cropped area to obtain the sample image;
将样本图像输入初始的图像还原神经网络,经过卷积注意力层、三维卷积网络层和三维反卷积网络层处理,得到还原样本图像;Input the sample image into the initial image restoration neural network, and process it through the convolutional attention layer, the 3D convolutional network layer and the 3D deconvolutional network layer to obtain the restored sample image;
根据还原样本图像和初始样本图像调整初始的图像还原神经网络的网络权重,得到预设的图像还原神经网络。The network weights of the initial image restoration neural network are adjusted according to the restoration sample image and the initial sample image to obtain a preset image restoration neural network.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
分别获取第一三维图像和第二三维图像的相关信息,相关信息是颜色信息或直方图信息;Respectively acquire relevant information of the first three-dimensional image and the second three-dimensional image, where the relevant information is color information or histogram information;
根据第一三维图像和第二三维图像的相关信息,得到第一三维图像和第二三维图像的相关信息差;Obtaining a related information difference between the first 3D image and the second 3D image according to the related information of the first 3D image and the second 3D image;
根据第一三维图像和第二三维图像的相关信息差,判断第一三维图像是否存在被遮挡部分或阴影部分。According to the relevant information difference between the first 3D image and the second 3D image, it is judged whether there is an occluded part or a shadow part in the first 3D image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
根据相关信息的类型,获取相关信息所对应的相关信息差范围阈值;According to the type of the relevant information, the relevant information difference range threshold corresponding to the relevant information is obtained;
若第一三维图像和第二三维图像的相关信息差处于相关信息差范围阈值,判定三维图像中不存在被遮挡部分或阴影部分;If the relevant information difference between the first three-dimensional image and the second three-dimensional image is within the relevant information difference range threshold, it is determined that there is no blocked part or shadow part in the three-dimensional image;
若第一三维图像和第二三维图像的相关信息差不处于相关信息差范围阈值,判定三维图像中存在被遮挡部分或阴影部分。If the relevant information difference between the first 3D image and the second 3D image is not within the relevant information difference range threshold, it is determined that there is an occluded part or a shadow part in the 3D image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are also implemented:
若三维图像不存在被遮挡部分且不存在阴影部分,输出三维图像。If there is no occluded part and no shadow part in the 3D image, output the 3D image.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile memory and volatile memory. The non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, and the like. Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110349391.8A CN113099210B (en) | 2021-03-31 | 2021-03-31 | Three-dimensional image restoration method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110349391.8A CN113099210B (en) | 2021-03-31 | 2021-03-31 | Three-dimensional image restoration method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113099210A CN113099210A (en) | 2021-07-09 |
CN113099210B true CN113099210B (en) | 2023-01-10 |
Family
ID=76672102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110349391.8A Expired - Fee Related CN113099210B (en) | 2021-03-31 | 2021-03-31 | Three-dimensional image restoration method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113099210B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05181980A (en) * | 1991-10-30 | 1993-07-23 | Sony Corp | Method and device for three-dimensional shape restoration |
WO2012053521A1 (en) * | 2010-10-18 | 2012-04-26 | 株式会社トプコン | Optical information processing device, optical information processing method, optical information processing system, and optical information processing program |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102106694B1 (en) * | 2018-05-17 | 2020-05-04 | 한국과학기술원 | An image processing apparatus using neural network and a method performed by the image processing apparatus |
CN110766646A (en) * | 2018-07-26 | 2020-02-07 | 北京京东尚科信息技术有限公司 | Display rack shielding detection method and device and storage medium |
CN110033487A (en) * | 2019-02-25 | 2019-07-19 | 上海交通大学 | Vegetables and fruits collecting method is blocked based on depth association perception algorithm |
CN111079545A (en) * | 2019-11-21 | 2020-04-28 | 上海工程技术大学 | Three-dimensional target detection method and system based on image restoration |
CN112530027A (en) * | 2020-12-11 | 2021-03-19 | 北京奇艺世纪科技有限公司 | Three-dimensional point cloud repairing method and device and electronic equipment |
-
2021
- 2021-03-31 CN CN202110349391.8A patent/CN113099210B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05181980A (en) * | 1991-10-30 | 1993-07-23 | Sony Corp | Method and device for three-dimensional shape restoration |
WO2012053521A1 (en) * | 2010-10-18 | 2012-04-26 | 株式会社トプコン | Optical information processing device, optical information processing method, optical information processing system, and optical information processing program |
Also Published As
Publication number | Publication date |
---|---|
CN113099210A (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110135455B (en) | Image matching method, device and computer readable storage medium | |
CN108198145B (en) | Method and device for point cloud data restoration | |
CN108352071B (en) | Method for motion structure processing in computer vision system | |
US9715761B2 (en) | Real-time 3D computer vision processing engine for object recognition, reconstruction, and analysis | |
EP3201881B1 (en) | 3-dimensional model generation using edges | |
US8755630B2 (en) | Object pose recognition apparatus and object pose recognition method using the same | |
CN113689578B (en) | Human body data set generation method and device | |
CN109472828B (en) | Positioning method, positioning device, electronic equipment and computer readable storage medium | |
US9253415B2 (en) | Simulating tracking shots from image sequences | |
CN111080776B (en) | Human body action three-dimensional data acquisition and reproduction processing method and system | |
CN112967388B (en) | Training method and device for three-dimensional time sequence image neural network model | |
CN106952247B (en) | Double-camera terminal and image processing method and system thereof | |
JP2022027464A (en) | Method and device related to depth estimation of video | |
CN113610918B (en) | Position calculation method and device, electronic device, and readable storage medium | |
CN109902675B (en) | Object pose acquisition method, scene reconstruction method and device | |
CN116921932A (en) | Welding track recognition method, device, equipment and storage medium | |
CN113099210B (en) | Three-dimensional image restoration method, device, computer equipment and storage medium | |
CN115937002B (en) | Method, apparatus, electronic device and storage medium for estimating video rotation | |
CN112967399A (en) | Three-dimensional time sequence image generation method and device, computer equipment and storage medium | |
CN112949761A (en) | Training method and device for three-dimensional image neural network model and computer equipment | |
CN109087338B (en) | A method and device for extracting sparse optical flow from images | |
CN109478326B (en) | Image processing method, terminal equipment and computer storage medium | |
CN111489439A (en) | A three-dimensional line graph reconstruction method, device and electronic device | |
CN117496074B (en) | Efficient three-dimensional scene reconstruction method suitable for rapid movement of camera | |
CN112950767A (en) | Target occlusion judgment method and device, computer 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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20230110 |
|
CF01 | Termination of patent right due to non-payment of annual fee |