CN111080542B - Image processing method, device, electronic equipment and storage medium - Google Patents
Image processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111080542B CN111080542B CN201911252815.8A CN201911252815A CN111080542B CN 111080542 B CN111080542 B CN 111080542B CN 201911252815 A CN201911252815 A CN 201911252815A CN 111080542 B CN111080542 B CN 111080542B
- Authority
- CN
- China
- Prior art keywords
- captured image
- face
- distortion
- image
- portrait
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
本申请提出一种图像处理方法、装置、电子设备以及存储介质,其中,方法包括:通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变程度较大的主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。
The present application proposes an image processing method, device, electronic device and storage medium, wherein the method comprises: obtaining a captured image, identifying a subject in the captured image, determining the degree of distortion of the subject if the subject is identified, and determining whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject. Thus, by performing de-distortion processing only on the subject with a greater degree of distortion in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
Description
技术领域Technical Field
本申请涉及图像处理技术领域,尤其涉及一种图像处理方法、装置、电子设备以及存储介质。The present application relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium.
背景技术Background technique
目前,随着智能终端制造技术的进步,智能终端上设置有相机模组以供用户拍照,其中,智能终端上安装广角摄像头较为普遍。其中,广角镜头相机与传统镜头相机相比,具有更大的视场角(Field of Vision,FOV),但广角镜头畸变较大,图像边缘会产生严重失真。At present, with the advancement of smart terminal manufacturing technology, smart terminals are equipped with camera modules for users to take photos, among which wide-angle cameras are more commonly installed on smart terminals. Compared with traditional lens cameras, wide-angle lens cameras have a larger field of view (FOV), but wide-angle lenses have larger distortion, and the edges of images will be seriously distorted.
相关技术中,为了补偿广角摄像头拍摄的图像的畸变,需要对图像进行畸变校正处理。当前对图像进行畸变校正处理,是对整体拍摄图像进行畸变校正处理,存在处理效率低的问题。In the related art, in order to compensate for the distortion of the image captured by the wide-angle camera, it is necessary to perform distortion correction processing on the image. Currently, the distortion correction processing on the image is performed on the entire captured image, which has the problem of low processing efficiency.
发明内容Summary of the invention
本申请旨在至少在一定程度上解决相关技术中的技术问题之一。The present application aims to solve one of the technical problems in the related art at least to some extent.
本申请第一方面实施例提出了一种图像处理方法,包括:The first embodiment of the present application provides an image processing method, including:
获取拍摄图像;Acquire captured images;
识别所述拍摄图像中的主体人物;Identifying a subject person in the captured image;
若识别出所述主体人物,则确定所述主体人物的畸变程度;If the subject person is identified, determining the degree of distortion of the subject person;
根据所述主体人物的畸变程度,确定是否对所述拍摄图像中的人像区域进行去畸变处理。According to the degree of distortion of the subject person, it is determined whether to perform dedistortion processing on the portrait area in the captured image.
作为本申请实施例的第一种可能的情况,所述识别所述拍摄图像中的主体人物之后,还包括:As a first possible scenario of an embodiment of the present application, after identifying the subject person in the captured image, the method further includes:
若未识别出所述主体人物,则查询所述拍摄图像中所述人像区域的个数;If the subject person is not identified, querying the number of the portrait areas in the captured image;
所述人像区域的个数大于或等于第一阈值,则统计所述人像区域呈现的人脸中正脸的占比;If the number of the portrait areas is greater than or equal to a first threshold, the proportion of front faces in the faces presented in the portrait areas is counted;
若所述正脸的占比大于第二阈值,则确定对所述拍摄图像中的人像区域去畸变处理;If the proportion of the front face is greater than a second threshold, determining to perform a dedistortion process on the portrait area in the captured image;
若所述正脸的占比小于或等于大于第二阈值,则确定无需对所述拍摄图像中的人像区域去畸变处理。If the proportion of the front face is less than or equal to or greater than the second threshold, it is determined that there is no need to perform dedistortion processing on the portrait area in the captured image.
作为本申请实施例的第二种可能的情况,所述查询所述拍摄图像中所述人像区域的个数之后,还包括:As a second possible situation of the embodiment of the present application, after querying the number of the portrait areas in the captured image, the method further includes:
所述人像区域的个数小于所述第一阈值,则确定无需对所述拍摄图像中的人像区域去畸变处理。If the number of the portrait areas is less than the first threshold, it is determined that there is no need to perform dedistortion processing on the portrait areas in the captured image.
作为本申请实施例的第三种可能的情况,所述识别所述拍摄图像中的主体人物,包括:As a third possible situation of the embodiment of the present application, the identifying the subject person in the captured image includes:
对所述拍摄图像进行人脸识别;Performing face recognition on the captured image;
对每一个人脸分别确定人脸尺寸、人脸旋转角度和人脸清晰程度;Determine the face size, face rotation angle and face clarity for each face;
将所述人脸尺寸、人脸旋转角度和人脸清晰程度均满足设定条件的人脸作为所述拍摄图像中的主体人物。The face whose face size, face rotation angle and face clarity all meet the set conditions is taken as the main person in the captured image.
作为本申请实施例的第四种可能的情况,所述确定所述主体人物的畸变程度,包括:As a fourth possible situation of the embodiment of the present application, determining the degree of distortion of the subject person includes:
根据所述主体人物在所述拍摄图像中的位置,确定所述主体人物的视角FOV;Determining the FOV of the subject person according to the position of the subject person in the captured image;
若确定FOV小于预定角度阈值,确定所述主体人物无畸变;If it is determined that the FOV is less than the predetermined angle threshold, it is determined that the subject person has no distortion;
若确定所述FOV大于或等于所述角度阈值,根据所述主体人物的成像轮廓预测真实轮廓;If it is determined that the FOV is greater than or equal to the angle threshold, predicting the real contour according to the imaging contour of the subject person;
根据所述成像轮廓与所述真实轮廓之间的差异度,确定所述主体人物的畸变程度。The degree of distortion of the subject person is determined according to the difference between the imaging contour and the real contour.
作为本申请实施例的第五种可能的情况,所述确定对所述拍摄图像中的人像区域去畸变处理之后,还包括:As a fifth possible situation of the embodiment of the present application, after determining to perform a dedistortion process on the portrait area in the captured image, the method further includes:
识别所述拍摄图像中的直线线段;Identifying straight line segments in the captured image;
根据所述拍摄图像中的直线线段对所述拍摄图像中的人像区域去畸变,以保持所述直线线段在去畸变前后形态相同。The portrait region in the captured image is dedistorted according to the straight line segments in the captured image, so as to keep the straight line segments in the same shape before and after the dedistortion.
作为本申请实施例的第六种可能的情况,所述识别所述拍摄图像中的直线线段,包括:As a sixth possible situation of the embodiment of the present application, the identifying straight line segments in the captured image includes:
根据所述拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定多个边缘点;Determining a plurality of edge points from each pixel according to a gradient value of each pixel in the captured image and pixel values of adjacent pixels;
对所述多个边缘点拟合,得到多条初始直线段;其中,每一条初始直线段是对梯度方向相似的边缘点拟合得到的;Fitting the multiple edge points to obtain multiple initial straight line segments; wherein each initial straight line segment is obtained by fitting edge points with similar gradient directions;
对所述多条初始直线段合并,得到所述拍摄图像中的直线线段。The multiple initial straight line segments are merged to obtain straight line segments in the captured image.
作为本申请实施例的第七种可能的情况,所述对所述多个边缘点拟合,得到多条初始直线段,包括:As a seventh possible situation of the embodiment of the present application, the fitting of the multiple edge points to obtain multiple initial straight line segments includes:
根据所述多个边缘点中梯度方向相似的边缘点,确定多个集合;其中,同一集合中的边缘点梯度方向相似;Determine multiple sets according to edge points with similar gradient directions among the multiple edge points; wherein the edge points in the same set have similar gradient directions;
对每一个集合,对相应集合中的边缘点拟合,得到一条初始直线段。For each set, the edge points in the corresponding set are fitted to obtain an initial straight line segment.
作为本申请实施例的第八种可能的情况,所述根据所述多个边缘点中梯度方向相似的边缘点,确定多个集合,包括:As an eighth possible situation of the embodiment of the present application, determining multiple sets according to edge points with similar gradient directions among the multiple edge points includes:
从未添加到任一集合的边缘点中确定初始的参考点;Determine the initial reference point from the edge points that have not been added to either set;
查询与所述参考点之间梯度方向差值小于角度阈值,且与所述参考点相邻的边缘点;Querying edge points whose gradient direction difference with the reference point is less than an angle threshold and which are adjacent to the reference point;
将查询到的边缘点和所述参考点添加至同一集合中;Adding the queried edge points and the reference points to the same set;
若所述同一集合中各边缘点的梯度方向离散程度小于或等于设定离散程度,则将所述查询到的边缘点作为更新的参考点,以重复执行查询与所述参考点之间梯度方向差值小于角度阈值,且与所述参考点相邻的边缘点,将查询到的边缘点和所述参考点添加至相应集合中的步骤,直至相应集合中各边缘点的梯度方向离散程度大于所述设定离散程度。If the degree of discreteness of the gradient direction of each edge point in the same set is less than or equal to the set discreteness, the queried edge point is used as the updated reference point to repeatedly execute the step of querying the edge point whose gradient direction difference with the reference point is less than the angle threshold and is adjacent to the reference point, and adding the queried edge point and the reference point to the corresponding set until the degree of discreteness of the gradient direction of each edge point in the corresponding set is greater than the set discreteness.
本申请实施例的图像处理方法,通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变程度较大的主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。The image processing method of the embodiment of the present application obtains a captured image, identifies the subject person in the captured image, and if the subject person is identified, determines the degree of distortion of the subject person, and determines whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject person. Thus, by only performing de-distortion processing on the subject person with a large degree of distortion in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
本申请第二方面实施例提出了一种图像处理装置,包括:The second aspect of the present application provides an image processing device, including:
获取模块,用于获取拍摄图像;An acquisition module, used for acquiring captured images;
识别模块,用于识别所述拍摄图像中的主体人物;A recognition module, used to recognize the subject person in the captured image;
确定模块,用于若识别出所述主体人物,则确定所述主体人物的畸变程度;A determination module, configured to determine the degree of distortion of the subject person if the subject person is identified;
处理模块,用于根据所述主体人物的畸变程度,确定是否对所述拍摄图像中的人像区域进行去畸变处理。The processing module is used to determine whether to perform de-distortion processing on the portrait area in the captured image according to the distortion degree of the subject.
本申请实施例的图像处理装置,通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变程度较大的主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。The image processing device of the embodiment of the present application obtains a captured image, identifies the subject person in the captured image, and if the subject person is identified, determines the degree of distortion of the subject person, and determines whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject person. Thus, by performing de-distortion processing only on the subject person with a large degree of distortion in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
本申请第三方面实施例提出了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上述实施例中所述的图像处理方法。The third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image processing method as described in the above embodiment is implemented.
本申请第四方面实施例提出了一种非临时性计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述实施例中所述的图像处理方法。The fourth aspect of the present application provides a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method described in the above embodiment is implemented.
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1为本申请实施例提供的第一种图像处理方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a first image processing method provided in an embodiment of the present application;
图2为本申请实施例提供的第二种图像处理方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a second image processing method provided in an embodiment of the present application;
图3为本申请实施例提供的第三种图像处理方法的流程示意图;FIG3 is a schematic diagram of a flow chart of a third image processing method provided in an embodiment of the present application;
图4为本申请实施例提供的第四种图像处理方法的流程示意图;FIG4 is a schematic diagram of a fourth image processing method according to an embodiment of the present application;
图5为本申请实施例提供的第五种图像处理方法的流程示意图;FIG5 is a schematic diagram of a fifth image processing method according to an embodiment of the present application;
图6为本申请实施例提供的一种图像处理方法的示例图;FIG6 is an exemplary diagram of an image processing method provided by an embodiment of the present application;
图7为本申请实施例提供的第六种图像处理方法的流程示意图;FIG7 is a schematic diagram of a sixth image processing method provided in an embodiment of the present application;
图8为本申请实施例提供的一种图像处理装置的结构示意图;FIG8 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
图9是根据本申请一个实施例的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
相关技术中,对拍摄图像进行去畸变处理时,通常对整体的拍摄图像进行校正,从而导致整个去畸变过程运算量较大的技术问题。In the related art, when performing de-distortion processing on a captured image, the entire captured image is usually corrected, which leads to a technical problem that the amount of computation required for the entire de-distortion process is relatively large.
针对相关技术中的技术问题,本申请提出了一种图像处理方法,通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。In view of the technical problems in the related art, the present application proposes an image processing method, which obtains a captured image, identifies the subject in the captured image, and if the subject is identified, determines the degree of distortion of the subject, and determines whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject. Thus, by only performing de-distortion processing on the distorted subject in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
下面参考附图描述本申请实施例的图像处理方法、装置、电子设备以及存储介质。The following describes the image processing method, device, electronic device and storage medium of the embodiments of the present application with reference to the accompanying drawings.
图1为本申请实施例提供的第一种图像处理方法的流程示意图。FIG1 is a schematic flow chart of a first image processing method provided in an embodiment of the present application.
本申请实施例以该基于图像的图像处理方法被配置于图像处理装置中来举例说明,该图像处理装置可以应用于任一电子设备中,以使该电子设备可以执行图像处理功能。The embodiment of the present application takes the image-based image processing method being configured in an image processing device as an example. The image processing device can be applied to any electronic device so that the electronic device can perform an image processing function.
其中,电子设备可以为个人电脑(Personal Computer,简称PC)、云端设备、移动设备等,移动设备例如可以为手机、平板电脑、个人数字助理、穿戴式设备、车载设备等具有各种操作系统的硬件设备。Among them, the electronic device may be a personal computer (PC), a cloud device, a mobile device, etc. The mobile device may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a car device, and other hardware devices with various operating systems.
如图1所示,该图像处理方法包括以下步骤:As shown in FIG1 , the image processing method comprises the following steps:
步骤101,获取拍摄图像。Step 101, obtaining a captured image.
本申请实施例中,可以通过设置于电子设备的图像传感器采集得到拍摄图像。In the embodiment of the present application, the captured image can be acquired by an image sensor provided in the electronic device.
作为一种可能的情况,电子设备可以包括可见光图像传感器,可以基于电子设备中的可见光图像传感器采集拍摄图像。具体地,可见光图像传感器可以包括可见光摄像头,可见光摄像头可以捕获由成像对象反射的可见光进行成像。As a possible scenario, the electronic device may include a visible light image sensor, and the image may be captured based on the visible light image sensor in the electronic device. Specifically, the visible light image sensor may include a visible light camera, and the visible light camera may capture visible light reflected by an imaging object for imaging.
作为另一种可能的情况,本申请实施例中,电子设备还可以包括结构光图像传感器,可以基于电子设备中的结构光图像传感器采集拍摄图像。可选地,结构光图像传感器可以包括镭射灯以及激光摄像头。脉冲宽度调制(Pulse Width Modulation,简称PWM)可以调制镭射灯以发出结构光,结构光照射至成像对象,激光摄像头可以捕获由成像对象反射的结构光进行成像,得到成像对象对应的结构光图像。As another possible situation, in an embodiment of the present application, the electronic device may further include a structured light image sensor, and images may be captured based on the structured light image sensor in the electronic device. Optionally, the structured light image sensor may include a laser lamp and a laser camera. Pulse Width Modulation (PWM) may modulate the laser lamp to emit structured light, and the structured light is irradiated to the imaging object. The laser camera may capture the structured light reflected by the imaging object for imaging, and obtain a structured light image corresponding to the imaging object.
需要说明的是,设置于电子设备的图像传感器,不限于上述的可见光传感器和结构光传感器,还可以为其他类型的图像传感器,例如深度传感器,等等,本申请中对此不做限制。It should be noted that the image sensor provided in the electronic device is not limited to the above-mentioned visible light sensor and structured light sensor, but may also be other types of image sensors, such as depth sensors, etc., which is not limited in the present application.
步骤102,识别拍摄图像中的主体人物。Step 102: Identify the subject person in the captured image.
本申请实施例中,在获取到拍摄图像后,进一步的识别拍摄图像中的主体人物。In the embodiment of the present application, after the captured image is acquired, the subject person in the captured image is further identified.
作为一种可能的实现方式,可以将拍摄图像输入已经经过训练的主体人物识别模型中,以识别出拍摄图像中的主体人物。As a possible implementation manner, the captured image may be input into a trained subject person recognition model to recognize the subject person in the captured image.
作为另一种可能的实现方式,可以首先对拍摄图像进行人脸识别,再对识别到的每一个人脸分别确定人脸尺寸、人脸旋转角度和人脸清晰程度。进而,将人脸尺寸、人脸旋转角度和人脸清晰程度均满足设定条件的人脸作为拍摄图像中的主体人物。As another possible implementation, face recognition can be performed on the captured image first, and then the face size, face rotation angle and face clarity of each recognized face can be determined. Then, the face whose face size, face rotation angle and face clarity meet the set conditions can be regarded as the main person in the captured image.
具体地,可以采用基于卷积神经网络(Convolutional Neural Network,简称CNN)的人脸识别模型对拍摄图像进行人脸识别,以识别得到拍摄图像中的每一个人脸,并确定每一个人脸的人脸尺寸和位置。其中,人脸识别模型,是采用大量的训练样本图像进行训练得到的。Specifically, a face recognition model based on a convolutional neural network (CNN) can be used to perform face recognition on the captured image to identify each face in the captured image and determine the face size and position of each face. The face recognition model is trained using a large number of training sample images.
本申请实施例中,对拍摄图像进行人脸识别,识别得到每一个人脸的人脸尺寸和人脸位置后,对每一个人脸进行人脸关键点检测,以确定人脸的关键点,进而确定人脸的关键区域位置。其中,人脸关键点检测也称为人脸关键点检测、定位或者人脸对齐,是指给定人脸图像,定位出人脸面部的关键区域位置,包括眉毛、眼睛、鼻子、嘴巴、脸部轮廓等。例如,可以对每一个人脸进行106点的人脸关键点检测,以得到人脸的五官和轮廓。In the embodiment of the present application, face recognition is performed on the captured image, and after the face size and face position of each face are identified, face key point detection is performed on each face to determine the key points of the face, and then determine the key area position of the face. Among them, face key point detection is also called face key point detection, positioning or face alignment, which means locating the key area position of the face, including eyebrows, eyes, nose, mouth, facial contour, etc., given a face image. For example, 106 points of face key point detection can be performed on each face to obtain the facial features and contours of the face.
再者,确定出每一个人脸的关键点后,根据各个人脸的关键点可以计算出每一个人脸的人脸旋转角度。其中,人脸旋转角度,是指脸部朝向信息,如脸朝向为正面或者侧面。Furthermore, after determining the key points of each face, the face rotation angle of each face can be calculated based on the key points of each face. The face rotation angle refers to the face orientation information, such as whether the face is facing forward or sideways.
作为一种可能的实现方式,可以根据每一个人脸的关键点计算出人脸的旋转参数(roll,pitch,yaw),从而确定各人脸的旋转角度。As a possible implementation method, the rotation parameters (roll, pitch, yaw) of the face can be calculated according to the key points of each face, so as to determine the rotation angle of each face.
本申请实施例中,对每一个人脸确定人脸清晰程度时,可以首先对拍摄图像中识别到的人脸进行剪裁,得到每一个人脸图像。进而,对每一个人脸图像进行高斯模糊去噪,并转换为灰度图像,在各灰度图像上利用拉普拉斯算子滤波,统计每一个灰度图像中各灰度级的个数,得到各灰度图像的灰度直方图。将每一个灰度直方图进行归一化映射到0至255的范围内,并求映射后的各灰度图像的像素值的均值。若均值大于设定阈值,则确定该人脸图像中人脸清晰;若均值小于或等于设定阈值,则确定该人脸图像中人脸模糊。In the embodiment of the present application, when determining the degree of facial clarity for each face, the face identified in the captured image can be first cropped to obtain each face image. Then, each face image is subjected to Gaussian blur denoising and converted into a grayscale image. The Laplace operator is used for filtering on each grayscale image, and the number of grayscale levels in each grayscale image is counted to obtain a grayscale histogram of each grayscale image. Each grayscale histogram is normalized and mapped to a range of 0 to 255, and the mean of the pixel values of each grayscale image after mapping is calculated. If the mean is greater than the set threshold, it is determined that the face in the face image is clear; if the mean is less than or equal to the set threshold, it is determined that the face in the face image is blurred.
本申请实施例中,确定出每一个人脸的人脸尺寸、人脸旋转角度和人脸清晰程度后,将人脸尺寸、人脸旋转角度和人脸清晰程度均满足设定条件的人脸作为拍摄图像中的主体人物。In the embodiment of the present application, after determining the face size, face rotation angle and face clarity of each face, the face whose face size, face rotation angle and face clarity meet the set conditions is taken as the main person in the captured image.
例如,人脸尺寸小于设定的尺寸,可能是人脸距离镜头较远,可以将该人脸认为是图像背景。还例如,确定的人脸旋转角度大于设定角度阈值,可能拍摄的是侧脸,也可以将该人脸认为是图像背景。还例如,人脸比较模糊,并且人脸清晰程度小于设定清晰度阈值时,可以将该人脸认为为图像背景。For example, if the face size is smaller than the set size, it may be that the face is far away from the camera, and the face can be considered as the image background. For another example, if the determined face rotation angle is greater than the set angle threshold, it may be that the face is in profile, and the face can also be considered as the image background. For another example, if the face is blurry and the face clarity is less than the set clarity threshold, the face can be considered as the image background.
步骤103,若识别出主体人物,则确定主体人物的畸变程度。Step 103: If the subject person is identified, the degree of distortion of the subject person is determined.
可以理解的是,通过设置于电子设备的图像传感器采集图像时,由于图像传感器性能误差,如摄像头的焦距变动、镜头光学畸变等,成像时的透视误差,等等,使得采集的拍摄图像不可避免的存在畸变。It is understandable that when images are captured by an image sensor installed in an electronic device, due to image sensor performance errors, such as camera focal length changes, lens optical distortion, perspective errors during imaging, etc., the captured images are inevitably distorted.
本申请实施例中,从拍摄图像中识别出主体人物后,需要进一步确定主体人物的畸变程度,以根据主体人物的畸变程度,确定是否进一步对主体人物进行去畸变处理。In the embodiment of the present application, after the subject person is identified from the captured image, it is necessary to further determine the degree of distortion of the subject person, so as to determine whether to further perform de-distortion processing on the subject person according to the degree of distortion of the subject person.
作为一种可能的实现方式,可以根据各主体人物在拍摄图像中的位置,确定各主体人物相对镜头光轴的偏移角度,进而根据各主体人物的偏移角度确定主体人物是否存在畸变现象。若偏移角度小于角度阈值,例如60°,确定主体人物无畸变。若偏移角度大于或等于角度阈值,则进一步根据主体人物的成像轮廓预测真实轮廓,以比较成像轮廓与真实轮廓之间的差异程度。若成像轮廓与真实轮廓之间的差异较大,则可以确定该主体人物的畸变程度较严重;若成像轮廓与真实轮廓之间的差异较小,或者基本无差异,则可以确定该主体人物无畸变。As a possible implementation method, the offset angle of each subject character relative to the lens optical axis can be determined according to the position of each subject character in the captured image, and then whether the subject character is distorted can be determined according to the offset angle of each subject character. If the offset angle is less than an angle threshold, such as 60°, it is determined that the subject character is not distorted. If the offset angle is greater than or equal to the angle threshold, the real contour is further predicted based on the imaging contour of the subject character to compare the degree of difference between the imaging contour and the real contour. If the difference between the imaging contour and the real contour is large, it can be determined that the degree of distortion of the subject character is more serious; if the difference between the imaging contour and the real contour is small, or there is basically no difference, it can be determined that the subject character is not distorted.
步骤104,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。Step 104: Determine whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject person.
本申请实施例中,确定拍摄图像中各主体人物的畸变程度后,可以根据主体人物的畸变程度,确定是否需要对拍摄图像中的人像区域进行去畸变处理。In an embodiment of the present application, after determining the degree of distortion of each subject person in the captured image, it can be determined whether de-distortion processing needs to be performed on the portrait area in the captured image based on the degree of distortion of the subject person.
作为一种可能的实现方式,可以根据设定的畸变程度阈值,将确定的各主体人物的畸变程度与畸变程度阈值进行比较。若主体人物的畸变程度大于畸变程度阈值,则对拍摄图像中该主体人物对应的人像区域进行去畸变处理;若主体人物的畸变程度小于畸变程度阈值,则无需对拍摄图像中该主体人物对应的人像区域进行去畸变处理;As a possible implementation method, the determined distortion degree of each subject person can be compared with the distortion degree threshold according to the set distortion degree threshold. If the distortion degree of the subject person is greater than the distortion degree threshold, the portrait area corresponding to the subject person in the captured image is subjected to dedistortion processing; if the distortion degree of the subject person is less than the distortion degree threshold, the portrait area corresponding to the subject person in the captured image does not need to be subjected to dedistortion processing;
本申请实施例中,在对拍摄图像中的人像区域进行去畸变处理时,可以首先将人像区域划分为人脸区域和身体区域,进而根据预设的初始投影网格对人像区域校正计算,获取与人脸区域对应的第一校正尺寸值和与身体区域对应的第二校正尺寸值,进一步的,在第一校正尺寸值和第二校正尺寸值中,确定满足预设条件的目标校正尺寸值,以根据目标校正尺寸值对图像中的人像区域进行校正处理,以得到去畸变后的拍摄图像。In an embodiment of the present application, when de-distorting a portrait area in a captured image, the portrait area can be first divided into a face area and a body area, and then the portrait area correction calculation is performed according to a preset initial projection grid to obtain a first correction size value corresponding to the face area and a second correction size value corresponding to the body area. Furthermore, among the first correction size value and the second correction size value, a target correction size value that meets preset conditions is determined, so that the portrait area in the image is corrected according to the target correction size value to obtain a de-distorted captured image.
在获取与人脸区域对应的第一校正尺寸值和与身体区域对应的第二校正尺寸值时,作为一种可能的实现方式,可以根据人像区域中像素点的坐标构建人像区域中的原始网格,预设的初始投影网格对所述人像区域校正计算,获取与人脸区域对应的第一变换网格以及与身体区域对应的第二变换网格,计算第一变换网格与原始网格的尺寸比值获取第一校正尺寸值,并计算第二变换网格与所述原始网格的尺寸比值获取第二校正尺寸值。When obtaining a first corrected size value corresponding to the face area and a second corrected size value corresponding to the body area, as a possible implementation method, an original grid in the portrait area can be constructed according to the coordinates of the pixel points in the portrait area, a preset initial projection grid is used to perform correction calculation on the portrait area, a first transformed grid corresponding to the face area and a second transformed grid corresponding to the body area are obtained, a size ratio of the first transformed grid to the original grid is calculated to obtain a first corrected size value, and a size ratio of the second transformed grid to the original grid is calculated to obtain a second corrected size value.
在获取与人脸区域对应的第一校正尺寸值和与身体区域对应的第二校正尺寸值时,作为另一种可能的实现方式,可以通过获取人像区域中每个像素点坐标的深度值,将人像区域中每个像素点的像素坐标和深度值输入初始投影网格,获取与每个像素点对应的映射像素坐标。进一步的,计算每个像素点的映射像素坐标和对应的像素坐标的像素差值;计算人脸区域中所有像素点对应的像素差值的均值,获取第一校正尺寸值;计算身体区域中所有像素点对应的像素差值的均值,获取第二校正尺寸值。When obtaining the first corrected size value corresponding to the face area and the second corrected size value corresponding to the body area, as another possible implementation method, the depth value of the coordinates of each pixel point in the portrait area can be obtained, and the pixel coordinates and depth value of each pixel point in the portrait area can be input into the initial projection grid to obtain the mapped pixel coordinates corresponding to each pixel point. Further, the pixel difference between the mapped pixel coordinates and the corresponding pixel coordinates of each pixel point is calculated; the average of the pixel difference values corresponding to all the pixels in the face area is calculated to obtain the first corrected size value; the average of the pixel difference values corresponding to all the pixels in the body area is calculated to obtain the second corrected size value.
本申请实施例的图像处理方法,通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。The image processing method of the embodiment of the present application obtains a captured image, identifies the subject person in the captured image, and if the subject person is identified, determines the degree of distortion of the subject person, and determines whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject person. Thus, by performing de-distortion processing only on the distorted subject person in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
在上述实施例的基础上,在上述步骤102中识别拍摄图像中的主体人物之后,可以通过人像区域中人脸中正脸的占比,确定是否对拍摄图像中的人像区域进行去畸变处理。下面结合图2对上述过程进行详细介绍,图2为本申请实施例提供的第二种图像处理方法的流程示意图。On the basis of the above embodiment, after the subject person in the captured image is identified in the above step 102, it can be determined whether to perform dedistortion processing on the portrait area in the captured image according to the proportion of the front face in the portrait area. The above process is described in detail below in conjunction with Figure 2, which is a flow chart of the second image processing method provided in the embodiment of the present application.
如图2所示,该图像处理方法可以包括以下步骤:As shown in FIG2 , the image processing method may include the following steps:
步骤201,获取拍摄图像。Step 201, acquiring a captured image.
步骤202,识别拍摄图像中的主体人物。Step 202: Identify the subject person in the captured image.
本申请实施例中,步骤201和步骤202的实现过程,可以参见上述实施例中步骤101和步骤102的实现过程,在此不再赘述。In the embodiment of the present application, the implementation process of step 201 and step 202 can refer to the implementation process of step 101 and step 102 in the above embodiment, which will not be repeated here.
步骤203,若未识别出主体人物,则查询拍摄图像中人像区域的个数。Step 203: If the subject person is not identified, the number of portrait areas in the captured image is queried.
本申请实施例中,在对拍摄图像中的主体人物进行识别时,可能存在未识别出主体人物的情况。这种情况下,查询拍摄图像中人像区域的个数。In the embodiment of the present application, when identifying the subject person in the captured image, there may be a situation where the subject person is not identified. In this case, the number of portrait areas in the captured image is queried.
步骤204,判断人像区域的个数是否大于或等于第一阈值。Step 204: determine whether the number of portrait regions is greater than or equal to a first threshold.
本申请实施例中,通过判断人像区域的个数是否大于或等于第一阈值,以确定是否对拍摄图像中的人像进行去畸变处理。In the embodiment of the present application, it is determined whether to perform dedistortion processing on the portrait in the captured image by judging whether the number of portrait areas is greater than or equal to a first threshold.
步骤205,人像区域的个数小于第一阈值,则确定无需对拍摄图像中的人像区域去畸变处理。Step 205: If the number of portrait regions is less than a first threshold, it is determined that there is no need to perform dedistortion processing on the portrait regions in the captured image.
在一种可能的情况下,拍摄图像中人像区域的个数较少,人像区域的个数小于第一阈值,这种情况下,可以确定拍摄图像为风景照,确定无需对拍摄图像中的人像区域去畸变处理。In one possible case, the number of portrait areas in the captured image is small, and the number of portrait areas is less than a first threshold. In this case, it can be determined that the captured image is a landscape photo, and it is determined that there is no need to perform dedistortion processing on the portrait areas in the captured image.
可以理解为,在电子设备采集图像时,拍摄的对象为自然风景,但是拍摄图像中存在人像区域,这种情况下,无需对拍摄图像中的人像区域进行去畸变处理。It can be understood that when an electronic device captures an image, the object being photographed is a natural scenery, but there is a portrait area in the photographed image. In this case, there is no need to perform de-distortion processing on the portrait area in the photographed image.
步骤206,人像区域的个数大于或等于第一阈值,则统计人像区域呈现的人脸中正脸的占比。Step 206: If the number of portrait areas is greater than or equal to the first threshold, the proportion of front faces in the faces presented in the portrait areas is counted.
其中,人脸中正脸的占比,是指正脸在人像区域中呈现的人脸中所占的比例。例如,人像区域中呈现的人脸一共有15个,正脸的个数为13个,则正脸的占比为13/15。The proportion of frontal faces in faces refers to the proportion of frontal faces in faces presented in the portrait area. For example, if there are 15 faces presented in the portrait area and 13 of them are frontal, the proportion of frontal faces is 13/15.
在一种可能的情况下,拍摄图像中人像区域的个数较多,人像区域的个数大于或等于第一阈值,这种情况下,可能是多人进行合影得到的拍摄图像,也可能是随拍时拍摄得到的拍摄图像。In one possible case, there are a large number of portrait areas in the captured image, and the number of portrait areas is greater than or equal to a first threshold. In this case, the captured image may be a group photo of multiple people, or it may be a random shot.
因此,需要进一步统计人像区域呈现的人脸中正脸的占比,以根据人脸中正脸的占比,确定拍摄场景,以确定是否对拍摄图像中的人像区域进行去畸变处理。Therefore, it is necessary to further count the proportion of the front face in the faces presented in the portrait area, so as to determine the shooting scene according to the proportion of the front face in the faces, so as to determine whether to perform de-distortion processing on the portrait area in the captured image.
步骤207,判断正脸的占比是否大于第二阈值。Step 207, determining whether the proportion of the front face is greater than a second threshold.
本申请实施例中,统计得到人像区域呈现的人脸中正脸的占比后,将正脸的占比与设定的第二阈值进行比较,以根据比较结果确定是否对拍摄场景中的人像区域进行去畸变处理。In an embodiment of the present application, after obtaining the proportion of frontal faces in the faces presented in the portrait area, the proportion of frontal faces is compared with a set second threshold to determine whether to perform dedistortion processing on the portrait area in the shooting scene based on the comparison result.
步骤208,若正脸的占比大于第二阈值,则确定对拍摄图像中的人像区域去畸变处理。Step 208: If the proportion of the front face is greater than the second threshold, determine to perform dedistortion processing on the portrait area in the captured image.
在一种可能的场景下,统计人像区域呈现的人脸中正脸的占比大于第二阈值,这种情况下,可以将拍摄场景确定为多人合影,因此,需要对拍摄场景中的人像区域进行去畸变处理。In one possible scenario, the proportion of front faces in the faces presented in the portrait area is greater than the second threshold. In this case, the shooting scene can be determined as a group photo. Therefore, it is necessary to perform dedistortion processing on the portrait area in the shooting scene.
步骤209,若正脸的占比小于或等于大于第二阈值,则确定无需对拍摄图像中的人像区域去畸变处理。Step 209: If the proportion of the front face is less than or equal to or greater than the second threshold, it is determined that there is no need to perform dedistortion processing on the portrait area in the captured image.
在一种可能的场景下,统计人像区域呈现的人脸中正脸的占比小于或等于第二阈值,这种情况下,可以将拍摄场景确定为随拍,无需对拍摄图像中的人像区域去畸变处理。In one possible scenario, the proportion of front faces in the faces presented in the portrait area is less than or equal to the second threshold. In this case, the shooting scene can be determined as a random shot, and there is no need to perform dedistortion processing on the portrait area in the captured image.
本申请实施例的图像处理方法,通过获取拍摄图像,识别拍摄图像中的主体人物,若未识别出主体人物,则查询拍摄图像中人像区域的个数,人像区域的个数大于或等于第一阈值,则统计人像区域呈现的人脸中正脸的占比,若正脸的占比大于第二阈值,则确定对拍摄图像中的人像区域去畸变处理;若正脸的占比小于或等于大于第二阈值,则确定无需对拍摄图像中的人像区域去畸变处理。由此,在拍摄图像中未识别出主体人物时,根据人像区域呈现的人脸中正脸的占比是否大于第二阈值,来触发是否对人像区域进行去畸变处理,从而有效地规避了风景、随拍等不需要图像校正的场景,最大程度的保留图片的原始状态。The image processing method of the embodiment of the present application obtains a captured image and identifies the main person in the captured image. If the main person is not identified, the number of portrait areas in the captured image is queried. If the number of portrait areas is greater than or equal to a first threshold, the proportion of the front face in the faces presented in the portrait area is counted. If the proportion of the front face is greater than a second threshold, it is determined that the portrait area in the captured image needs to be dedistorted; if the proportion of the front face is less than or equal to or greater than the second threshold, it is determined that the portrait area in the captured image does not need to be dedistorted. Therefore, when the main person is not identified in the captured image, whether the portrait area needs to be dedistorted is triggered based on whether the proportion of the front face in the faces presented in the portrait area is greater than the second threshold, thereby effectively avoiding scenes that do not require image correction, such as landscapes and casual shots, and retaining the original state of the image to the greatest extent.
在上述实施例的基础上,在步骤103中确定主体人物的畸变程度时,还可以根据主体人物的视角FOV的大小来确定主体人物的畸变程度。下面结合图3对上述过程进行详细介绍,图3为本申请实施例提供的第三中图像处理方法的流程示意图。On the basis of the above embodiment, when determining the degree of distortion of the subject in step 103, the degree of distortion of the subject may also be determined according to the size of the subject's field of view FOV. The above process is described in detail below in conjunction with FIG3 , which is a flowchart of the third image processing method provided in the embodiment of the present application.
如图3所述,上述步骤103还可以包括以下步骤:As shown in FIG. 3 , the above step 103 may further include the following steps:
步骤301,根据主体人物在拍摄图像中的位置,确定主体人物的视角FOV。Step 301, determining the field of view (FOV) of the subject person according to the position of the subject person in the captured image.
其中,主体人物的视角FOV,是指主体人物相对于摄像头光轴的偏移角度。The FOV of the subject refers to the offset angle of the subject relative to the optical axis of the camera.
本申请实施例中,识别拍摄图像中的主体人物后,根据主体人物在拍摄图像中的位置,确定主体人物的FOV。In the embodiment of the present application, after the main character in the captured image is identified, the FOV of the main character is determined according to the position of the main character in the captured image.
作为一种可能的实现方式,采用人脸识别模型对拍摄图像进行人脸识别,以识别得到拍摄图像中的主体人物的位置后,建立主体人物映射到成像图中的三维模型,根据坐标点(x,y)的坐标值,计算该主体人物相对于摄像头光轴的偏移角度。As a possible implementation method, a face recognition model is used to perform face recognition on the captured image to identify the position of the main person in the captured image, and then a three-dimensional model of the main person mapped to the imaging image is established. According to the coordinate value of the coordinate point (x, y), the offset angle of the main person relative to the camera optical axis is calculated.
步骤302,判断FOV是否小于预定角度阈值。Step 302, determining whether the FOV is less than a predetermined angle threshold.
其中,角度阈值,为预先设定的角度值,例如,可以设定角度阈值为60°。The angle threshold is a preset angle value. For example, the angle threshold can be set to 60°.
本申请实施例中,根据识别拍摄图像得到的各主体人物在拍摄图像中的位置,确定各主体人物的FOV之后,判断主体人物的FOV是否小于角度阈值。In the embodiment of the present application, after the FOV of each subject character is determined based on the position of each subject character in the captured image obtained by identifying the captured image, it is determined whether the FOV of the subject character is less than the angle threshold.
步骤303,若确定FOV小于角度阈值,确定主体人物无畸变。Step 303: If it is determined that the FOV is smaller than the angle threshold, it is determined that the subject is not distorted.
在一种可能的场景下,若确定主体人物的FOV小于角度阈值,这种情况下,确定主体人物无畸变,无需对主体人物进行去畸变处理。In a possible scenario, if it is determined that the FOV of the main character is smaller than the angle threshold, in this case, it is determined that the main character has no distortion, and there is no need to perform de-distortion processing on the main character.
步骤304,若确定FOV大于或等于角度阈值,根据主体人物的成像轮廓预测真实轮廓。Step 304: If it is determined that the FOV is greater than or equal to the angle threshold, the real contour is predicted based on the imaging contour of the subject.
在一种可能的情况下,若确定主体人物的FOV大于或等于角度阈值,这种情况下,需要进一步判断主体人物的畸变程度,以根据主体人物的畸变程度确定是否对该主体人物对应的人像区域进行去畸变处理。In one possible case, if it is determined that the FOV of the subject is greater than or equal to the angle threshold, in this case, it is necessary to further determine the degree of distortion of the subject to determine whether to perform de-distortion processing on the portrait area corresponding to the subject based on the degree of distortion of the subject.
本申请实施例中,确定主体人物的FOV大于或等于角度阈值,根据主体人物的成像轮廓预测真实轮廓。具体地,通过对拍摄图像进行关键点检测,得到各主体人物的成像轮廓后,根据保形投影方法计算得到主体人物的真实轮廓。In the embodiment of the present application, it is determined that the FOV of the subject is greater than or equal to the angle threshold, and the real contour is predicted based on the imaging contour of the subject. Specifically, after the imaging contour of each subject is obtained by performing key point detection on the captured image, the real contour of the subject is calculated using the conformal projection method.
步骤305,根据成像轮廓与真实轮廓之间的差异度,确定主体人物的畸变程度。Step 305: Determine the degree of distortion of the subject person according to the difference between the imaged outline and the real outline.
本申请实施例中,在根据主体人物的成像轮廓预测相应主体人物的真实轮廓后,根据成像轮廓与真实轮廓之间的差异度,确定主体人物的畸变程度。In the embodiment of the present application, after predicting the real contour of the corresponding subject character according to the imaging contour of the subject character, the degree of distortion of the subject character is determined according to the difference between the imaging contour and the real contour.
在一种可能的情况下,主体人物的成像轮廓与真实轮廓之间的差异度较大,可以确定主体人物的畸变程度较大。如,主体人物的整体尺寸变化较大,或者人脸关键点的偏移程度较大。In one possible case, the difference between the imaged outline of the subject and the real outline is large, and it can be determined that the distortion degree of the subject is large, for example, the overall size of the subject changes greatly, or the displacement degree of the key points of the face is large.
在另一种可能的情况下,主体人物的成像轮廓与真实轮廓之间的差异度较小,可以确定主体人物的畸变程度较小。In another possible case, the difference between the imaged outline of the main character and the real outline is small, so it can be determined that the distortion degree of the main character is small.
本申请实施例的图像处理方法,通过根据主体人物在拍摄图像中的位置,确定主体人物的视角FOV,若确定FOV小于角度阈值,确定主体人物无畸变,若确定FOV大于或等于角度阈值,根据主体人物的成像轮廓预测真实轮廓;根据成像轮廓与真实轮廓之间的差异度,确定主体人物的畸变程度。由此,通过主体人物的FOV与角度阈值进行比较,在FOV大于或等于角度阈值时,根据主体人物的成像轮廓与真实轮廓之间的差异度,确定主体人物的畸变程度,从而根据主体人物的畸变程度确定是否对主体人物对应的人像区域进行去畸变处理,通过减少对背景的处理以及减少人像区域处理的个数,从而有利于提高图像处理的效率。The image processing method of the embodiment of the present application determines the FOV of the subject according to the position of the subject in the captured image. If the FOV is determined to be less than the angle threshold, it is determined that the subject is not distorted. If the FOV is determined to be greater than or equal to the angle threshold, the real contour is predicted according to the imaging contour of the subject; and the degree of distortion of the subject is determined according to the difference between the imaging contour and the real contour. Thus, by comparing the FOV of the subject with the angle threshold, when the FOV is greater than or equal to the angle threshold, the degree of distortion of the subject is determined according to the difference between the imaging contour of the subject and the real contour, and thus whether to perform de-distortion processing on the portrait area corresponding to the subject according to the degree of distortion of the subject is determined, and by reducing the processing of the background and reducing the number of portrait areas to be processed, the efficiency of image processing is improved.
在上述实施例的基础上,在对拍摄图像中的人像区域去畸变处理之后,还可以识别拍摄图像中的直线线段,根据拍摄图像中的直线线段,对拍摄图像中的人像区域去畸变,以保持直线线段在去畸变前后形态相同,以提高人像区域去畸变的准确度。下面结合图4对上述过程进行详细介绍,图4为本申请实施例提供的第四种图像处理方法的流程示意图。On the basis of the above embodiment, after the portrait area in the captured image is dedistorted, the straight line segments in the captured image can also be identified, and the portrait area in the captured image can be dedistorted according to the straight line segments in the captured image, so as to keep the straight line segments in the same shape before and after dedistortion, so as to improve the accuracy of dedistortion of the portrait area. The above process is described in detail below in conjunction with FIG4, which is a flowchart of the fourth image processing method provided in the embodiment of the present application.
如图4所示,该图像处理方法,还可以包括以下步骤:As shown in FIG4 , the image processing method may further include the following steps:
步骤401,识别拍摄图像中的直线线段。Step 401, identifying straight line segments in a captured image.
本申请实施例中,获取到拍摄图像后,可以进一步识别得到拍摄图像中的直线线段。In the embodiment of the present application, after acquiring the captured image, straight line segments in the captured image can be further identified.
作为一种可能的实现方式,可以采用霍夫变换识别拍摄图像中的直线线段。其中,霍夫变换是图像处理中从图像中识别几何形状的基本方法之一,应用很广泛,也有很多改进算法。霍夫变换主要用来从图像中分离出具有某种相同特征的几何形状(如,直线,圆等)。最基本的霍夫变换是从图像中检测直线线段。As a possible implementation method, Hough transform can be used to identify straight line segments in captured images. Among them, Hough transform is one of the basic methods for identifying geometric shapes from images in image processing. It is widely used and has many improved algorithms. Hough transform is mainly used to separate geometric shapes with certain common features (such as straight lines, circles, etc.) from images. The most basic Hough transform is to detect straight line segments from images.
需要说明的是,本申请中对识别拍摄图像中直线线段的方法不做限制,也可以为其他直线检测方法。It should be noted that the present application does not limit the method for identifying straight line segments in the captured image, and other straight line detection methods may also be used.
步骤402,根据拍摄图像中的直线线段对拍摄图像中的人像区域去畸变,以保持直线线段在去畸变前后形态相同。Step 402 : Dedistorting the portrait region in the captured image according to the straight line segments in the captured image, so as to keep the straight line segments in the same shape before and after dedistortion.
本申请实施例中,识别得到拍摄图像中的直线线段后,可以根据拍摄图像中的直线线段,对拍摄图像中的人像区域去畸变,以保持直线线段在去畸变前后形态相同。In an embodiment of the present application, after the straight line segments in the captured image are identified, the portrait area in the captured image can be dedistorted based on the straight line segments in the captured image to keep the straight line segments in the same shape before and after dedistortion.
可以理解的是,三维空间中的直线投影到图像平面上仍然为直线,但是,由于图像传感器性能的影响导致三维空间中的直线投影到平面上可能为曲线。因此,需要根据拍摄图像中的直线线段对拍摄图像中的人像区域去畸变,以使得三维空间中的直线线段投影到平面上后仍为形态一致的直线线段。It is understandable that a straight line in a three-dimensional space is still a straight line when projected onto an image plane, but due to the influence of image sensor performance, a straight line in a three-dimensional space may be a curve when projected onto a plane. Therefore, it is necessary to dedistort the portrait area in the captured image based on the straight line segments in the captured image, so that the straight line segments in the three-dimensional space are still straight line segments with consistent shapes after being projected onto a plane.
本申请实施例的图像处理方法,通过识别拍摄图像中的直线线段,根据拍摄图像中的直线线段,对拍摄图像中的人像区域去畸变,以保持直线线段在去畸变前后形态相同。由此,通过根据拍摄图像中的直线线段对人像区域进行去畸形处理,确保直线线段在去畸变前后形态相同,从而在最大程度上保留了拍摄图像的原始状态。The image processing method of the embodiment of the present application, by identifying the straight line segments in the captured image, dedistorts the portrait area in the captured image according to the straight line segments in the captured image, so as to keep the straight line segments in the same shape before and after dedistortion. Thus, by dedistorting the portrait area according to the straight line segments in the captured image, it is ensured that the straight line segments have the same shape before and after dedistortion, thereby retaining the original state of the captured image to the greatest extent.
作为一种可能的实现方式,在上述步骤401中,还可以根据拍摄图像中各像素点的梯度值和像素值,从各像素点中确定多个边缘点,对多个边缘点拟合,得到各初始直线段,对多条初始直线段合并,得到拍摄图像中的直线线段。下面结合图5对上述过程进行详细介绍,图5为本申请实施例提供的第五种图像处理方法的流程示意图。As a possible implementation, in the above step 401, multiple edge points can also be determined from each pixel point according to the gradient value and pixel value of each pixel point in the captured image, multiple edge points are fitted to obtain each initial straight line segment, and multiple initial straight line segments are merged to obtain the straight line segment in the captured image. The above process is described in detail below in conjunction with FIG5, which is a flowchart of the fifth image processing method provided in an embodiment of the present application.
如图5所示,上述步骤401还可以包括以下步骤:As shown in FIG. 5 , the above step 401 may further include the following steps:
步骤501,根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定多个边缘点。Step 501 : determining a plurality of edge points from each pixel according to the gradient value of each pixel in the captured image and the pixel values of adjacent pixels.
本申请实施例中,拍摄图像中各像素点的梯度值包括各像素点的梯度和梯度方向。当图像中存在边缘时,一定有较大的梯度值,相反,当图像中有比较平滑的部分时,灰度值变化较小,则相应的梯度也较小,图像处理中把梯度的模简称为梯度,由图像梯度构成的图像成为梯度图像。图像的梯度相当于两个相邻像素之间的差值,图像中某一点的梯度方向即通过计算该点与其8邻域点的梯度角,梯度角最大即为梯度方向。其中,8邻域点为某个点的上、下、左、右、左上、右上、左下、右下的8个点。In the embodiment of the present application, the gradient value of each pixel in the captured image includes the gradient and gradient direction of each pixel. When there is an edge in the image, there must be a larger gradient value. On the contrary, when there is a relatively smooth part in the image, the gray value changes less, and the corresponding gradient is also smaller. In image processing, the modulus of the gradient is referred to as the gradient, and the image composed of the image gradient is called a gradient image. The gradient of an image is equivalent to the difference between two adjacent pixels. The gradient direction of a point in the image is calculated by calculating the gradient angle between the point and its 8 neighboring points. The maximum gradient angle is the gradient direction. Among them, the 8 neighboring points are 8 points of the top, bottom, left, right, upper left, upper right, lower left, and lower right of a point.
下面结合图6对像素点的梯度、梯度角以及梯度方向进行详细说明,可以通过Sobel算子具体解释检测图像中各像素点的梯度、梯度角以及梯度方向。其中,Sobel算子是像素图像边缘检测中最重要的算子之一,在机器学习、数字媒体、计算机视觉等信息科技领域起着举足轻重的作用。在技术上,它是一个离散的一阶差分算子,用来计算图像亮度函数的一阶梯度之近似值。在图像的任何一点使用此算子,将会产生该点对应的梯度矢量或是其法矢量。The gradient, gradient angle and gradient direction of the pixel point are described in detail below in conjunction with FIG6. The gradient, gradient angle and gradient direction of each pixel point in the detection image can be specifically explained by the Sobel operator. Among them, the Sobel operator is one of the most important operators in pixel image edge detection, and plays a vital role in information technology fields such as machine learning, digital media, and computer vision. Technically, it is a discrete first-order difference operator used to calculate the approximate value of the first-order gradient of the image brightness function. Using this operator at any point in the image will generate the gradient vector or its normal vector corresponding to the point.
如图6所示,对于像素点A,用Sobel算子首先计算出Gx,Gy,然后计算出像素点A的梯度角θ=arctan(Gy/Gx),梯度方向即检测图像中灰度增大的方向,其中梯度方向的梯度夹角大于平坦区域的梯度夹角。如图6所示,灰度值增加的方向梯度夹角大,像素点A的梯度方向为像素点A与其8邻域点的梯度角最大的方向。As shown in Figure 6, for pixel A, the Sobel operator is used to first calculate G x , G y , and then the gradient angle θ = arctan (G y /G x ) of pixel A is calculated. The gradient direction is the direction in which the grayscale in the detected image increases, where the gradient angle of the gradient direction is greater than the gradient angle of the flat area. As shown in Figure 6, the direction in which the grayscale value increases has a large gradient angle, and the gradient direction of pixel A is the direction in which the gradient angle between pixel A and its 8 neighboring points is the largest.
本申请实施例中,获取到拍摄图像后,可以对拍摄图像进行边缘检测,以确定多个边缘点。边缘检测的算法主要是基于图像强度的一阶和二阶导数,但是导数通常对噪声很敏感,因此首先要对检测图像进行滤波,以去除拍摄图像中的噪声。其中,常见的滤波方法有高斯滤波,即采用离散化的高斯函数产生一组归一化的高斯核,然后基于高斯核函数对图像灰度矩阵的每一点进行加权求和。对检测图像进行高斯滤波时的高斯核半径可根据检测图像的尺寸调整,例如,高斯核半径可以设置为5。In an embodiment of the present application, after acquiring the captured image, edge detection can be performed on the captured image to determine multiple edge points. The edge detection algorithm is mainly based on the first-order and second-order derivatives of the image intensity, but the derivatives are usually very sensitive to noise, so the detection image must first be filtered to remove the noise in the captured image. Among them, a common filtering method is Gaussian filtering, that is, a set of normalized Gaussian kernels are generated using a discretized Gaussian function, and then a weighted sum is performed on each point of the image grayscale matrix based on the Gaussian kernel function. The radius of the Gaussian kernel when Gaussian filtering is performed on the detection image can be adjusted according to the size of the detection image. For example, the Gaussian kernel radius can be set to 5.
其中,高斯滤波是一种线性平滑滤波,适用于消除高斯噪声,广泛应用于图像处理的减噪过程。高斯滤波通过高斯核对图像的逐个像素进行卷积,从而得到每个像素的值。在卷积的过程中,利用周围像素的值,将距离作为权重计算卷积核中心位置的像素。高斯滤波的具体操作是:用一个大小为2*N+1的模板(或称卷积、掩模)扫描图像中的每一个像素,用模板确定的邻域内像素的加权平均灰度值去替代模板中心像素点的值。Among them, Gaussian filtering is a linear smoothing filter, which is suitable for eliminating Gaussian noise and is widely used in the noise reduction process of image processing. Gaussian filtering convolves each pixel of the image with a Gaussian kernel to obtain the value of each pixel. In the convolution process, the values of the surrounding pixels are used and the distance is used as the weight to calculate the pixel at the center of the convolution kernel. The specific operation of Gaussian filtering is: use a template (or convolution, mask) of size 2*N+1 to scan each pixel in the image, and replace the value of the central pixel of the template with the weighted average gray value of the pixels in the neighborhood determined by the template.
由此,通过对拍摄图像进行高斯滤波,避免了图像的噪声影响各像素点的梯度方向,继而影响直线段检测精度的技术问题,从而提高了直线段的检测精度。Therefore, by performing Gaussian filtering on the captured image, the technical problem that the noise of the image affects the gradient direction of each pixel point and then affects the accuracy of straight line segment detection is avoided, thereby improving the detection accuracy of the straight line segment.
本申请实施例中的边缘检测方法,包括但不限于canny边缘检测方法、prewitt边缘检测方法,等等。The edge detection method in the embodiments of the present application includes but is not limited to the canny edge detection method, the prewitt edge detection method, and the like.
作为一种可能的实现方式,确定拍摄图像中各像素点的梯度值和相邻像素点的像素值后,针对每一个像素点,将各像素点的梯度值和第一梯度阈值进行比较,在一种可能的情况下,若某一像素点的梯度值大于第一梯度阈值,则查询在梯度方向上与相应像素点相邻的第一相邻像素点;若相应像素点与第一相邻像素点的像素值之差大于第二梯度阈值,则确定相应像素点为边缘点。As a possible implementation method, after determining the gradient value of each pixel point and the pixel value of the adjacent pixel point in the captured image, for each pixel point, the gradient value of each pixel point is compared with a first gradient threshold. In one possible case, if the gradient value of a certain pixel point is greater than the first gradient threshold, the first adjacent pixel point adjacent to the corresponding pixel point in the gradient direction is queried; if the difference between the pixel value of the corresponding pixel point and the first adjacent pixel point is greater than the second gradient threshold, the corresponding pixel point is determined to be an edge point.
作为一种示例,以第一相邻像素点为各像素点8邻域内的各像素点为例,针对检测图像中的每一个像素点,若梯度值大于第一梯度阈值,则将相应像素点的梯度值与8邻域内像素点点的梯度值进行差值计算,若在其梯度方向上与8邻域内像素点的梯度值的差值均大于第二梯度阈值,则确定相应像素点为边缘点。As an example, taking the first adjacent pixel points as the pixel points in the 8-neighborhood of each pixel point as an example, for each pixel point in the detection image, if the gradient value is greater than the first gradient threshold, the gradient value of the corresponding pixel point is calculated differentially with the gradient value of the pixel points in the 8-neighborhood. If the difference in its gradient direction with the gradient value of the pixel points in the 8-neighborhood is greater than the second gradient threshold, the corresponding pixel point is determined to be an edge point.
需要说明的是,从增强处理后的拍摄图像的各像素点中确定多个边缘点时,可能会将一些噪点确定为边缘点,因此,需要进一步的对各边缘点进行筛选,以筛选掉图像中的噪点,从而有利于提高直线段检测的精确度。It should be noted that when determining multiple edge points from each pixel point of the enhanced captured image, some noise points may be determined as edge points. Therefore, it is necessary to further screen each edge point to filter out the noise points in the image, which is beneficial to improve the accuracy of straight line segment detection.
本申请实施例中,从各像素点中确定多个边缘点之后,针对每一个边缘点,查询在梯度方向上与相应边缘点相邻的第二相邻像素点,若相应边缘点与第二相邻像素点的梯度值之差大于第三梯度阈值,则保留相应的边缘点,若相应边缘点与第二相邻像素点的梯度值之差小于或等于第三梯度阈值,则筛选掉相应的边缘点。由此,通过对边缘点的筛选,以筛选掉图像中的噪点,从而有利于提高直线检测方法的识别率。In the embodiment of the present application, after determining multiple edge points from each pixel point, for each edge point, the second adjacent pixel point adjacent to the corresponding edge point in the gradient direction is queried, and if the difference between the gradient value of the corresponding edge point and the second adjacent pixel point is greater than the third gradient threshold, the corresponding edge point is retained, and if the difference between the gradient value of the corresponding edge point and the second adjacent pixel point is less than or equal to the third gradient threshold, the corresponding edge point is filtered out. Thus, by filtering the edge points, the noise points in the image are filtered out, which is conducive to improving the recognition rate of the straight line detection method.
步骤502,对多个边缘点拟合,得到多条初始直线段;其中,每一条初始直线段是对梯度方向相似的边缘点拟合得到的。Step 502: fit multiple edge points to obtain multiple initial straight line segments; wherein each initial straight line segment is obtained by fitting edge points with similar gradient directions.
本申请实施例中,根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定出多个边缘点之后,由于多个边缘点为多个离散的点,需要对多个边缘点进行拟合,得到多条初始直线段。In an embodiment of the present application, after multiple edge points are determined from each pixel based on the gradient value of each pixel in the captured image and the pixel values of adjacent pixels, since the multiple edge points are multiple discrete points, the multiple edge points need to be fitted to obtain multiple initial straight line segments.
需要说明的是,每一条初始直线段可以是对梯度方向相似的边缘点拟合得到的。具体地,根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,确定多个边缘点后,将多个边缘点中梯度方向相似的边缘点,确定为一个集合。进而,可以将多个边缘点划分为多个集合。其中,同一集合中的边缘点梯度方向相似。针对各个集合,对相应集合中的边缘点拟合,得到各初始直线段。It should be noted that each initial straight line segment can be obtained by fitting edge points with similar gradient directions. Specifically, after determining multiple edge points based on the gradient value of each pixel point in the captured image and the pixel value of the adjacent pixel point, the edge points with similar gradient directions among the multiple edge points are determined as a set. Furthermore, the multiple edge points can be divided into multiple sets. Among them, the edge points in the same set have similar gradient directions. For each set, the edge points in the corresponding set are fitted to obtain each initial straight line segment.
步骤503,对多条初始直线段合并,得到拍摄图像中的直线线段。Step 503: merge multiple initial straight line segments to obtain straight line segments in the captured image.
本申请实施例中,由于图像中噪声的影响,可能存在拍摄图像中边缘线段被切断,导致图像边缘不连续。因此,需对多个边缘点拟合得到的多条初始直线段进行合并,以得到拍摄图像中的目标直线线段。In the embodiment of the present application, due to the influence of noise in the image, edge segments in the captured image may be cut off, resulting in discontinuity of the image edge. Therefore, it is necessary to merge multiple initial straight line segments obtained by fitting multiple edge points to obtain the target straight line segment in the captured image.
本申请实施例的图像处理方法,通过根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定多个边缘点,对多个边缘点拟合,得到多条初始直线段;其中,每一条初始直线段是对梯度方向相似的边缘点拟合得到的,对多条初始直线段合并,得到检测图像中的目标直线线段。该方法通过对拍摄图像中各像素点中确定的多个边缘点进行拟合,得到各初始直线段,进而对多条初始直线段进行合并得到检测图像中的目标直线段,由于不需要对图像中各像素点进行重复处理,因此能够快速的检测出图像中的直线段,从而提高了图像中的直线检测速度。The image processing method of the embodiment of the present application determines multiple edge points from each pixel point according to the gradient value of each pixel point in the captured image and the pixel value of the adjacent pixel point, fits the multiple edge points, and obtains multiple initial straight line segments; wherein each initial straight line segment is obtained by fitting edge points with similar gradient directions, and multiple initial straight line segments are merged to obtain the target straight line segment in the detected image. The method fits multiple edge points determined in each pixel point in the captured image to obtain each initial straight line segment, and then merges the multiple initial straight line segments to obtain the target straight line segment in the detected image. Since it is not necessary to repeatedly process each pixel point in the image, the straight line segment in the image can be detected quickly, thereby improving the speed of straight line detection in the image.
在上述实施例的基础上,在上述步骤502中,对多个边缘点拟合,得到多条初始直线段时,还可以首先根据多个边缘点中梯度方向相似的边缘点,确定多个集合,进而,针对每一个集合,对相应集合中的边缘点拟合,得到一条初始直线段。下面结合图7对上述过程进行详细介绍,图7为本申请实施例提供的第六种图像处理方法的流程示意图。On the basis of the above embodiment, in the above step 502, when fitting multiple edge points to obtain multiple initial straight line segments, multiple sets can also be determined first according to edge points with similar gradient directions among the multiple edge points, and then, for each set, the edge points in the corresponding set are fitted to obtain an initial straight line segment. The above process is described in detail below in conjunction with FIG. 7, which is a flow chart of the sixth image processing method provided in the embodiment of the present application.
如图7所示,上述步骤502还可以包括以下步骤:As shown in FIG. 7 , the above step 502 may further include the following steps:
步骤601,根据多个边缘点中梯度方向相似的边缘点,确定多个集合;其中,同一集合中的边缘点梯度方向相似。Step 601, determining multiple sets according to edge points with similar gradient directions among multiple edge points; wherein the edge points in the same set have similar gradient directions.
本申请实施例中,根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定多个边缘点后,将边缘点梯度方向相似的边缘点,划分到同一个集合中,以得到多个集合。In an embodiment of the present application, after multiple edge points are determined from each pixel based on the gradient value of each pixel in the captured image and the pixel values of adjacent pixels, edge points with similar edge point gradient directions are divided into the same set to obtain multiple sets.
作为一种可能的实现方式,针对多个边缘点,从未添加到任一集合的边缘点中确定一边缘点为初始的参考点,查询与参考点之间梯度方向差值小于角度阈值,且与参考点相邻的边缘点,将查询到的边缘点和参考点添加至同一集合中。As a possible implementation method, for multiple edge points, an edge point is determined as the initial reference point from the edge points that have not been added to any set, and the edge point whose gradient direction difference between the query and the reference point is less than an angle threshold and is adjacent to the reference point, the queried edge point and the reference point are added to the same set.
本申请实施例中,从各像素点中确定多个边缘点后,可以根据各边缘点的梯度值大小对各边缘点进行排序,在未添加到任一集合的边缘点中,可以将梯度最大的边缘点作为初始的参考点。与参考点相邻的边缘点,可以为初始的参考点8邻域内的边缘点,即参考点的上、下、左、右、左上、右上、左下、右下的8个点。In the embodiment of the present application, after determining multiple edge points from each pixel point, each edge point can be sorted according to the size of the gradient value of each edge point, and among the edge points not added to any set, the edge point with the largest gradient can be used as the initial reference point. The edge points adjacent to the reference point can be edge points within the initial reference point 8 neighborhoods, that is, the 8 points above, below, left, right, upper left, upper right, lower left, and lower right of the reference point.
例如,可以计算参考点的梯度角与8邻域内的各边缘点的梯度方向之间的差值,假设参考点的上方和左上方的边缘点与参考点之间的梯度方向差值小于角度阈值,此时,可以将上方和左上方的边缘点与参考点一起添加至同一集合中。For example, the difference between the gradient angle of the reference point and the gradient direction of each edge point in the 8-neighborhood can be calculated. Assuming that the gradient direction difference between the edge points above and to the upper left of the reference point and the reference point is less than the angle threshold, the edge points above and to the upper left can be added to the same set together with the reference point.
本申请实施例中,若同一集合中各边缘点的梯度方向离散程度小于或等于设定离散程度,则将查询到的边缘点作为更新的参考点,以重复执行查询与参考点之间梯度方向差值小于角度阈值,且与参考点相邻的边缘点,将查询到的边缘点和参考点添加至相应集合中的步骤,直至相应集合中各边缘点的梯度方向离散程度大于设定离散程度。In an embodiment of the present application, if the degree of discreteness of the gradient direction of each edge point in the same set is less than or equal to the set discreteness, the queried edge point is used as the updated reference point to repeatedly execute the step of adding the queried edge point and the reference point to the corresponding set for the edge point whose gradient direction difference between the query and the reference point is less than the angle threshold and is adjacent to the reference point, until the degree of discreteness of the gradient direction of each edge point in the corresponding set is greater than the set discreteness.
步骤602,对每一个集合,对相应集合中的边缘点拟合,得到一条初始直线段。Step 602: For each set, edge points in the corresponding set are fitted to obtain an initial straight line segment.
本申请实施例中,根据多个边缘点中梯度方向相似的边缘点,确定多个集合后,对每一个集合中的多个边缘点进行拟合,以得到一条初始直线段。In the embodiment of the present application, after determining multiple sets based on edge points with similar gradient directions among multiple edge points, multiple edge points in each set are fitted to obtain an initial straight line segment.
本申请实施例中,对对每一个集合中的多个边缘点进行拟合,就是把每一个集合中的多个边缘点,用一条直线段连接起来,以得到一条初始直线段。In the embodiment of the present application, fitting is performed on multiple edge points in each set, that is, connecting the multiple edge points in each set with a straight line segment to obtain an initial straight line segment.
本申请实施例的图像处理方法,通过根据多个边缘点中梯度方向相似的边缘点,确定多个集合;其中,同一集合中的边缘点梯度方向相似,对每一个集合,对相应集合中的边缘点拟合,得到一条初始直线段。由此,通过对每一个集合中的边缘点进行拟合,得到相应集合的初始直线段,实现了对离散的边缘点进行结合的操作。The image processing method of the embodiment of the present application determines multiple sets based on edge points with similar gradient directions among multiple edge points; wherein the edge points in the same set have similar gradient directions, and for each set, the edge points in the corresponding set are fitted to obtain an initial straight line segment. Thus, by fitting the edge points in each set, the initial straight line segment of the corresponding set is obtained, thereby realizing the operation of combining discrete edge points.
为了实现上述实施例,本申请还提出一种图像处理装置。In order to implement the above embodiment, the present application also proposes an image processing device.
图8为本申请实施例提供的一种图像处理装置的结构示意图。FIG8 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application.
如图8所示,该图像处理装置700,可以包括:获取模块710、识别模块720、确定模块730以及处理模块740。As shown in FIG. 8 , the image processing device 700 may include: an acquisition module 710 , a recognition module 720 , a determination module 730 and a processing module 740 .
其中,获取模块710,用于获取拍摄图像。The acquisition module 710 is used to acquire the captured image.
识别模块720,用于识别拍摄图像中的主体人物。The recognition module 720 is used to recognize the subject person in the captured image.
确定模块730,用于若识别出主体人物,则确定主体人物的畸变程度。The determination module 730 is used to determine the degree of distortion of the subject person if the subject person is identified.
处理模块740,用于根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。The processing module 740 is used to determine whether to perform de-distortion processing on the portrait area in the captured image according to the distortion degree of the subject.
作为一种可能的情况,该图像处理装置700,还可以包括:As a possible scenario, the image processing device 700 may further include:
查询模块,用于若未识别出主体人物,则查询拍摄图像中人像区域的个数。The query module is used to query the number of portrait areas in the captured image if the subject person is not recognized.
统计模块,用于人像区域的个数大于或等于第一阈值,则统计人像区域呈现的人脸中正脸的占比。The statistical module is used to count the proportion of front faces among the faces presented in the portrait areas when the number of portrait areas is greater than or equal to the first threshold.
确定模块730,还用于若正脸的占比大于第二阈值,则确定对拍摄图像中的人像区域去畸变处理。The determination module 730 is further used to determine to perform dedistortion processing on the portrait area in the captured image if the proportion of the front face is greater than the second threshold.
确定模块730,还用于若正脸的占比小于或等于大于第二阈值,则确定无需对拍摄图像中的人像区域去畸变处理。The determination module 730 is further configured to determine that it is not necessary to perform dedistortion processing on the portrait area in the captured image if the proportion of the front face is less than or equal to or greater than a second threshold.
作为另一种可能的情况,确定模块730,还可以用于:As another possible situation, the determination module 730 may also be used to:
人像区域的个数小于第一阈值,则确定无需对拍摄图像中的人像区域去畸变处理。If the number of portrait regions is less than the first threshold, it is determined that there is no need to perform dedistortion processing on the portrait regions in the captured image.
作为另一种可能的情况,识别模块720,还可以用于:As another possible situation, the identification module 720 may also be used for:
对拍摄图像进行人脸识别;对每一个人脸分别确定人脸尺寸、人脸旋转角度和人脸清晰程度;将人脸尺寸、人脸旋转角度和人脸清晰程度均满足设定条件的人脸作为拍摄图像中的主体人物。Perform face recognition on the captured image; determine the face size, face rotation angle and face clarity for each face; and regard the face whose face size, face rotation angle and face clarity meet the set conditions as the main person in the captured image.
作为另一种可能的情况,确定模块730,还可以用于:As another possible situation, the determination module 730 may also be used to:
根据主体人物在所述拍摄图像中的位置,确定主体人物的视角FOV;Determine the FOV of the subject according to the position of the subject in the captured image;
若确定FOV小于预定角度阈值,确定主体人物无畸变;If it is determined that the FOV is less than the predetermined angle threshold, it is determined that the subject is not distorted;
若确定FOV大于或等于角度阈值,根据主体人物的成像轮廓预测真实轮廓;If it is determined that the FOV is greater than or equal to the angle threshold, the real contour is predicted based on the imaging contour of the subject;
根据成像轮廓与真实轮廓之间的差异度,确定主体人物的畸变程度。The degree of distortion of the subject is determined based on the difference between the imaged outline and the real outline.
作为另一种可能的情况,该图像处理装置700,还可以包括:As another possible situation, the image processing device 700 may further include:
线段识别模块,用于识别拍摄图像中的直线线段。The line segment recognition module is used to recognize straight line segments in the captured image.
去畸变模块,用于根据拍摄图像中的直线线段对拍摄图像中的人像区域去畸变,以保持直线线段在去畸变前后形态相同。The dedistortion module is used to dedistort the portrait area in the captured image according to the straight line segments in the captured image, so as to keep the straight line segments in the same shape before and after the dedistortion.
作为另一种可能的情况,线段识别模块,还可以用于:As another possible case, the line segment recognition module can also be used to:
确定单元,用于根据拍摄图像中各像素点的梯度值和相邻像素点的像素值,从各像素点中确定多个边缘点。The determination unit is used to determine a plurality of edge points from each pixel point according to the gradient value of each pixel point in the captured image and the pixel values of adjacent pixels.
拟合单元,用于对多个边缘点拟合,得到多条初始直线段;其中,每一条初始直线段是对梯度方向相似的边缘点拟合得到的。The fitting unit is used to fit multiple edge points to obtain multiple initial straight line segments; wherein each initial straight line segment is obtained by fitting edge points with similar gradient directions.
合并单元,用于对多条初始直线段合并,得到拍摄图像中的直线线段。The merging unit is used to merge multiple initial straight line segments to obtain straight line segments in the captured image.
作为另一种可能的情况,拟合单元,还可以用于:As another possibility, the fitting unit can also be used to:
根据多个边缘点中梯度方向相似的边缘点,确定多个集合;其中,同一集合中的边缘点梯度方向相似;对每一个集合,对相应集合中的边缘点拟合,得到一条初始直线段。According to edge points with similar gradient directions among multiple edge points, multiple sets are determined; wherein the edge points in the same set have similar gradient directions; for each set, the edge points in the corresponding set are fitted to obtain an initial straight line segment.
作为另一种可能的情况,拟合单元,还可以用于:As another possibility, the fitting unit can also be used to:
从未添加到任一集合的边缘点中确定初始的参考点;Determine the initial reference point from the edge points that have not been added to either set;
查询与参考点之间梯度方向差值小于角度阈值,且与参考点相邻的边缘点;The gradient direction difference between the query and the reference point is less than the angle threshold, and the edge point is adjacent to the reference point;
将查询到的边缘点和参考点添加至同一集合中;Add the queried edge points and reference points to the same set;
若同一集合中各边缘点的梯度方向离散程度小于或等于设定离散程度,则将查询到的边缘点作为更新的参考点,以重复执行查询与参考点之间梯度方向差值小于角度阈值,且与参考点相邻的边缘点,将查询到的边缘点和参考点添加至相应集合中的步骤,直至相应集合中各边缘点的梯度角离散程度大于设定离散程度。If the degree of discreteness of the gradient direction of each edge point in the same set is less than or equal to the set discreteness, the queried edge point is used as the updated reference point to repeat the step of adding the queried edge point and the reference point to the corresponding set for the edge point whose gradient direction difference between the query and the reference point is less than the angle threshold and is adjacent to the reference point, until the degree of discreteness of the gradient angle of each edge point in the corresponding set is greater than the set discreteness.
需要说明的是,前述对图像处理方法实施例的解释说明也适用于该实施例的图像处理装置,此处不再赘述。It should be noted that the above explanation of the embodiment of the image processing method is also applicable to the image processing device of this embodiment, and will not be repeated here.
本申请实施例的图像处理装置,通过获取拍摄图像,识别拍摄图像中的主体人物,若识别出主体人物,则确定主体人物的畸变程度,根据主体人物的畸变程度,确定是否对拍摄图像中的人像区域进行去畸变处理。由此,通过仅对拍摄图像中的畸变主体人物进行去畸变处理,从而最大程度的保留拍摄图像的原始状态,降低了图像处理的运算量,有利于提高拍摄图像去畸变处理的效率。The image processing device of the embodiment of the present application obtains a captured image, identifies the subject person in the captured image, and if the subject person is identified, determines the degree of distortion of the subject person, and determines whether to perform de-distortion processing on the portrait area in the captured image according to the degree of distortion of the subject person. Thus, by performing de-distortion processing only on the distorted subject person in the captured image, the original state of the captured image is retained to the greatest extent, the amount of image processing calculation is reduced, and the efficiency of de-distortion processing of the captured image is improved.
为了实现上述实施例,本申请还提出一种电子设备,图9是根据本申请一个实施例的电子设备的结构示意图,如图9所示,电子设备110包括存储器111、处理器112及存储在存储器111上并可在处理器112上运行的计算机程序,所述处理器执行所述程序时,实现如上述实施例中所述的图像处理方法。In order to implement the above embodiments, the present application also proposes an electronic device. Figure 9 is a structural diagram of an electronic device according to an embodiment of the present application. As shown in Figure 9, the electronic device 110 includes a memory 111, a processor 112, and a computer program stored in the memory 111 and executable on the processor 112. When the processor executes the program, the image processing method described in the above embodiments is implemented.
为了实现上述实施例,本申请还提出一种非临时性计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述实施例中所述的图像处理方法。In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method described in the above embodiments is implemented.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911252815.8A CN111080542B (en) | 2019-12-09 | 2019-12-09 | Image processing method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911252815.8A CN111080542B (en) | 2019-12-09 | 2019-12-09 | Image processing method, device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111080542A CN111080542A (en) | 2020-04-28 |
| CN111080542B true CN111080542B (en) | 2024-05-28 |
Family
ID=70313416
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911252815.8A Active CN111080542B (en) | 2019-12-09 | 2019-12-09 | Image processing method, device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111080542B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112637482B (en) * | 2020-12-08 | 2022-05-17 | Oppo广东移动通信有限公司 | Image processing method, device, storage medium and electronic device |
| CN113077396B (en) * | 2021-03-29 | 2024-05-17 | Oppo广东移动通信有限公司 | Straight line segment detection method and device, computer readable medium and electronic device |
| CN115222603A (en) * | 2021-04-15 | 2022-10-21 | Oppo广东移动通信有限公司 | Image processing method and apparatus, electronic device, computer-readable storage medium |
| CN113222862B (en) * | 2021-06-04 | 2024-09-17 | 黑芝麻智能科技(上海)有限公司 | Image distortion correction method, device, electronic equipment and storage medium |
| CN113870148A (en) * | 2021-10-19 | 2021-12-31 | Oppo广东移动通信有限公司 | Facial distortion correction method, device, electronic device, chip and storage medium |
| CN114663939B (en) * | 2022-03-09 | 2025-09-23 | 深圳创维-Rgb电子有限公司 | Image playback correction method, electronic device, and computer-readable storage medium |
| CN114627014B (en) * | 2022-03-14 | 2025-04-22 | Oppo广东移动通信有限公司 | Image processing method, image processing device, storage medium and electronic device |
Citations (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007249802A (en) * | 2006-03-17 | 2007-09-27 | Noritsu Koki Co Ltd | Image processor and image processing method |
| KR20110034958A (en) * | 2009-09-29 | 2011-04-06 | 삼성전자주식회사 | Digital shooting device and shooting method |
| CN102693418A (en) * | 2012-05-17 | 2012-09-26 | 上海中原电子技术工程有限公司 | Multi-pose face identification method and system |
| JP2013153404A (en) * | 2011-12-28 | 2013-08-08 | Ricoh Co Ltd | Image processing apparatus, and image processing method |
| CN104700388A (en) * | 2013-12-09 | 2015-06-10 | 富士通株式会社 | Method and device for extracting distorted lines from images |
| CN105005972A (en) * | 2015-06-30 | 2015-10-28 | 广东欧珀移动通信有限公司 | A Distortion Correction Method and Mobile Terminal Based on Shooting Distance |
| CN105007413A (en) * | 2015-06-30 | 2015-10-28 | 广东欧珀移动通信有限公司 | Shooting control method and user terminal |
| CN105049714A (en) * | 2015-06-30 | 2015-11-11 | 广东欧珀移动通信有限公司 | Figure image preview method and device |
| JP2016058882A (en) * | 2014-09-09 | 2016-04-21 | カシオ計算機株式会社 | Image correction device, image correction method, and program |
| CN105554403A (en) * | 2016-02-29 | 2016-05-04 | 广东欧珀移动通信有限公司 | Control method, control device and electronic device |
| CN106127778A (en) * | 2016-06-27 | 2016-11-16 | 安徽慧视金瞳科技有限公司 | A kind of line detection method for projecting interactive system |
| CN107423737A (en) * | 2017-05-03 | 2017-12-01 | 武汉东智科技股份有限公司 | The video quality diagnosing method that foreign matter blocks |
| CN107680060A (en) * | 2017-09-30 | 2018-02-09 | 努比亚技术有限公司 | A kind of image distortion correction method, terminal and computer-readable recording medium |
| CN110264426A (en) * | 2019-06-24 | 2019-09-20 | Oppo广东移动通信有限公司 | Image distortion correction method and device |
| CN110276734A (en) * | 2019-06-24 | 2019-09-24 | Oppo广东移动通信有限公司 | Image distortion correction method and device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107644228B (en) * | 2017-09-21 | 2020-05-26 | 联想(北京)有限公司 | Image processing method |
-
2019
- 2019-12-09 CN CN201911252815.8A patent/CN111080542B/en active Active
Patent Citations (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007249802A (en) * | 2006-03-17 | 2007-09-27 | Noritsu Koki Co Ltd | Image processor and image processing method |
| KR20110034958A (en) * | 2009-09-29 | 2011-04-06 | 삼성전자주식회사 | Digital shooting device and shooting method |
| JP2013153404A (en) * | 2011-12-28 | 2013-08-08 | Ricoh Co Ltd | Image processing apparatus, and image processing method |
| CN102693418A (en) * | 2012-05-17 | 2012-09-26 | 上海中原电子技术工程有限公司 | Multi-pose face identification method and system |
| CN104700388A (en) * | 2013-12-09 | 2015-06-10 | 富士通株式会社 | Method and device for extracting distorted lines from images |
| JP2016058882A (en) * | 2014-09-09 | 2016-04-21 | カシオ計算機株式会社 | Image correction device, image correction method, and program |
| CN105007413A (en) * | 2015-06-30 | 2015-10-28 | 广东欧珀移动通信有限公司 | Shooting control method and user terminal |
| CN105049714A (en) * | 2015-06-30 | 2015-11-11 | 广东欧珀移动通信有限公司 | Figure image preview method and device |
| CN105005972A (en) * | 2015-06-30 | 2015-10-28 | 广东欧珀移动通信有限公司 | A Distortion Correction Method and Mobile Terminal Based on Shooting Distance |
| CN105554403A (en) * | 2016-02-29 | 2016-05-04 | 广东欧珀移动通信有限公司 | Control method, control device and electronic device |
| CN106127778A (en) * | 2016-06-27 | 2016-11-16 | 安徽慧视金瞳科技有限公司 | A kind of line detection method for projecting interactive system |
| CN107423737A (en) * | 2017-05-03 | 2017-12-01 | 武汉东智科技股份有限公司 | The video quality diagnosing method that foreign matter blocks |
| CN107680060A (en) * | 2017-09-30 | 2018-02-09 | 努比亚技术有限公司 | A kind of image distortion correction method, terminal and computer-readable recording medium |
| CN110264426A (en) * | 2019-06-24 | 2019-09-20 | Oppo广东移动通信有限公司 | Image distortion correction method and device |
| CN110276734A (en) * | 2019-06-24 | 2019-09-24 | Oppo广东移动通信有限公司 | Image distortion correction method and device |
Non-Patent Citations (4)
| Title |
|---|
| 于新瑞等.数字图像直线特征的亚像素位置检测.《光学技术》.2004,第30卷(第2期),第138-141页. * |
| 利用直线特征的定标图像非线性畸变校正;郑毅等;《仪器仪表学报》;20070630;第28卷(第6期);第1129-1133页 * |
| 田启川.《虹膜识别原理及算法》.国防工业出版社,2010,第13-16页. * |
| 郑毅等.利用直线特征的定标图像非线性畸变校正.《仪器仪表学报》.2007,第28卷(第6期),第1129-1131页. * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111080542A (en) | 2020-04-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111080542B (en) | Image processing method, device, electronic equipment and storage medium | |
| CN106909911B (en) | Image processing method, image processing apparatus, and electronic apparatus | |
| CN111008947B (en) | Image processing method and device, terminal equipment and storage medium | |
| CN111105366B (en) | Image processing method and device, terminal equipment and storage medium | |
| WO2020259271A1 (en) | Image distortion correction method and apparatus | |
| CN109479082B (en) | Image processing method and apparatus | |
| CN110971827B (en) | Portrait mode shooting method and device, terminal equipment and storage medium | |
| CN110536068A (en) | Focusing method and device, electronic equipment and computer readable storage medium | |
| CN107016348B (en) | Face detection method and device combined with depth information and electronic device | |
| CN111598065B (en) | Depth image acquisition method and living body recognition method, device, circuit and medium | |
| CN113902652B (en) | Speckle image correction method, depth calculation method, device, medium, and apparatus | |
| CN109948439B (en) | Living body detection method, living body detection system and terminal equipment | |
| CN111654685B (en) | Moving direction detection method and device, projection equipment and readable storage medium | |
| KR102807290B1 (en) | Image processing device, image processing method and image processing program | |
| CN111160233B (en) | Human face in-vivo detection method, medium and system based on three-dimensional imaging assistance | |
| CN111091507A (en) | Image processing method, image processing apparatus, electronic device, and storage medium | |
| CN109447117B (en) | Double-layer license plate recognition method and device, computer equipment and storage medium | |
| CN110770741B (en) | Lane line recognition method and device, vehicle | |
| CN107680035B (en) | Parameter calibration method and device, server and readable storage medium | |
| CN112861870A (en) | Pointer instrument image correction method, system and storage medium | |
| CN117350919A (en) | Image fusion method, device and storage medium | |
| WO2017101292A1 (en) | Autofocusing method, device and system | |
| CN113313645A (en) | Image processing method, image processing apparatus, terminal, and readable storage medium | |
| CN112800966B (en) | Sight tracking method and electronic equipment | |
| CN113822927A (en) | Face detection method, device, medium and equipment suitable for weak-quality images |
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 |