An image processing method and related apparatus

By constructing an asymmetric depth value range for pixel mapping, the problem of missing depth information due to limitations in depth map acquisition technology is solved, thereby improving face recognition efficiency and image quality.

CN115937941BActive Publication Date: 2025-11-21AIBEE (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211573062.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2025-11-21
Estimated Expiration
2042-12-08

Smart Images

  • Figure CN115937941B_ABST
    Figure CN115937941B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method and related device, obtaining an original depth image corresponding to a to-be-recognized object, determining a target depth value corresponding to a target position based on depth value information of the original depth image, and determining a minimum depth value and a maximum depth value corresponding to the original depth image according to the target depth value, and determining an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image. Since the absolute value of the difference between the target depth value and the minimum depth value is smaller than the absolute value of the difference between the target depth value and the maximum depth value, the minimum depth value and the maximum depth value are asymmetric when the target depth value is used as a reference, and therefore the depth value interval can comprehensively cover an effective face region and reduce interval waste. When pixel mapping processing is performed according to the depth value interval, the pixel interval can be more completely utilized, the distinguishability of each position of a face in a target pixel image is improved, and the efficiency of face recognition using the target pixel image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to an image processing method and related device. BACKGROUND

[0002] With the rapid development of social technology, face recognition technology has become a widely used intelligent biometric technology, such as in security, transportation, and facial payment.

[0003] Face recognition is a biometric technology that identifies identity based on facial feature information of a face. It collects image or video data containing a face, processes it according to a corresponding algorithm program, and identifies the detected face. Currently, face recognition mainly includes two methods based on two-dimensional images such as color images and three-dimensional images such as depth maps. Since depth maps have more stable imaging effects and contain spatial stereoscopic information of a face, face recognition based on depth maps has better recognition effects.

[0004] However, due to the limitations of depth map acquisition technology, the original depth image collected has a problem of missing depth information, resulting in low efficiency of face recognition using the original depth image. SUMMARY

[0005] To solve the above technical problems, the present application provides an image processing method and related device, which can improve the efficiency of face recognition.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In one aspect, the present application provides an image processing method, which comprises:

[0008] obtaining an original depth image corresponding to a to-be-identified object;

[0009] determining a target depth value corresponding to a target position of the to-be-identified object according to depth value information of the original depth image;

[0010] determining a minimum depth value corresponding to the original depth image according to the target depth value, and determining a maximum depth value corresponding to the original depth image according to the target depth value; the absolute value of the difference between the target depth value and the minimum depth value is less than the absolute value of the difference between the target depth value and the maximum depth value;

[0011] determining an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image;

[0012] According to the depth value interval, the original depth image is subjected to pixel mapping processing to obtain a target pixel image.

[0013] In another aspect, the embodiments of the present application provide an image processing device, the device comprising an acquisition unit, a determination unit and a processing unit:

[0014] The acquisition unit acquires an original depth image corresponding to a to-be-identified object;

[0015] The determination unit is configured to determine a target depth value corresponding to a target position of the to-be-identified object according to depth value information of the original depth image;

[0016] The determination unit is further configured to determine a minimum depth value corresponding to the original depth image according to the target depth value, and determine a maximum depth value corresponding to the original depth image according to the target depth value; an absolute value of a difference between the target depth value and the minimum depth value is less than an absolute value of a difference between the target depth value and the maximum depth value;

[0017] The determination unit is further configured to determine an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image;

[0018] The processing unit is configured to perform pixel mapping processing on the original depth image according to the depth value interval to obtain a target pixel image.

[0019] In yet another aspect, the embodiments of the present application provide a computer readable storage medium for storing a computer program, the computer program being configured to execute the image processing method of the above aspect.

[0020] It can be seen from the technical solution that, for the to-be-recognized object, the original depth image corresponding to the to-be-recognized object can be acquired first, the target depth value corresponding to the target position of the to-be-recognized object is determined based on the depth value information of the original depth image, and the minimum depth value and the maximum depth value corresponding to the original depth image are determined according to the target depth value, and then the interval identified by the minimum depth value and the maximum depth value is determined as the depth value interval corresponding to the original depth image. The target position is used to represent the reference position of the effective face region of the to-be-recognized object, the minimum depth value is used to represent the depth value of the position closest to the camera in the effective face region, and the maximum depth value is used to represent the depth value of the boundary position of the effective face region. Since the absolute value of the difference between the target depth value and the minimum depth value is less than the absolute value of the difference between the target depth value and the maximum depth value, it can be considered that the minimum depth value and the maximum depth value are asymmetric when the target depth value is taken as a reference. Correspondingly, the depth value interval can be considered as an asymmetric interval. Compared with the method of identifying the effective face region based on constructing a symmetric interval in the related art, constructing an asymmetric interval can comprehensively cover the effective face region and reduce the waste of the interval. Therefore, the pixel mapping processing according to the depth value interval can more completely utilize the pixel interval, thereby improving the distinguishability of each position of the face in the target pixel image, and improving the efficiency of face recognition when the target pixel image is used for face recognition. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 A flowchart of an image processing method provided by an embodiment of the present application;

[0023] Figure 2 A schematic diagram of a target pixel image provided by an embodiment of the present application;

[0024] Figure 3a A schematic diagram of a diamond kernel provided by an embodiment of the present application;

[0025] Figure 3b A schematic diagram of a full one kernel provided by an embodiment of the present application;

[0026] Figure 4 A flowchart of an image processing process provided by an embodiment of the present application;

[0027] Figure 5 A structural diagram of an image processing device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make persons skilled in the art better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0029] Since the depth map has more stable imaging effect and contains spatial stereoscopic information of the face, the face recognition method based on the depth map has better recognition effect. However, due to the limitation of the depth map acquisition technology level, the original depth image collected has the problem of missing depth information, which leads to low efficiency of face recognition using the original depth image. Therefore, in actual application, the original depth image needs to be preprocessed to improve the face recognition efficiency.

[0030] In the related art, the preprocessing method of the original depth image mainly includes the following two kinds:

[0031] The first kind is a statistical method, which uses a large amount of face depth map data to count the depth value range of the face region, and then maps the original depth image to the pixel space of [0, 255] according to the depth value range, to obtain a pixel image. However, in actual statistics, it is impossible to avoid the statistics of the depth values of the non-face region, which leads to the overflow of the depth values of this part of the non-face region to the pixel space, thus leading to low efficiency of subsequent face recognition using the pixel image.

[0032] The second kind is to take the key point position of the face region as the center of a sphere, and take a certain set depth value as the radius to construct a sphere, and consider all points within the sphere as the face region, wherein the key point position is, for example, the nose tip position in the face region. Assuming that the depth value at the center of the sphere is d and the radius is r, the depth range of the face region is [d-r, d+r], and then the original depth image is mapped to the pixel space of [0, 255] based on [d-r, d+r] to obtain a pixel image. Since the face region is not a symmetrical space, the use of a sphere to construct the face region results in a large amount of wasted space, and the real face region is only part of the sphere region, so that when mapped to the pixel space, the pixel space of [0, 255] cannot be fully utilized. For example, the real face region is only distributed in the pixel space of [100, 200]. This makes the distinction between different positions of the face in the pixel image not obvious, leading to low efficiency of subsequent face recognition using the pixel image.

[0033] To this end, the present application provides an image processing method and related device, the depth value interval comprehensively covers the effective face region, so that the pixel interval can be more completely utilized according to the pixel mapping processing based on the depth value interval, thereby improving the distinguishability of each position of the face in the target pixel image, so that the efficiency of face recognition can be improved when the target pixel image is used for face recognition.

[0034] The image processing method provided by the embodiments of the present application can be implemented by a computer device, which can be a terminal device or a server. The server can be a physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server providing cloud computing services. The terminal device includes but is not limited to a mobile phone, a computer, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and the present application does not make any limitation in this regard.

[0035] The embodiments are specifically described as follows:

[0036] Figure 1 The flowchart of the image processing method provided by the embodiments of the present application is described by taking a server as the aforementioned computer device. The method includes S101-S105.

[0037] S101: Obtain an original depth image corresponding to a to-be-identified object.

[0038] When the depth image is used for face recognition of the to-be-identified object, the original depth image corresponding to the to-be-identified object can be obtained first. The to-be-identified object can be a user who needs to be authenticated through face recognition. The original depth image can be collected by a depth camera such as a structured light sensor or a time-of-flight sensor when the to-be-identified object is subjected to face recognition.

[0039] S102: Determine a target depth value corresponding to a target position of the to-be-identified object according to depth value information of the original depth image.

[0040] The depth value information of the original depth image can reflect the depth value conditions of each position in the face region of the to-be-identified object collected, and the position closer to the depth camera has a smaller depth value. It can be understood that when the original depth image of the to-be-identified object is collected, the region other than the face region, such as the hair position, will also be collected. In face recognition, the to-be-identified object is mainly identified based on the information in the face region, so the region that can be truly used for face recognition is defined as an effective face region. Accordingly, in actual application, related processing can be performed only on the effective face region.

[0041] To determine the effective face region, a target depth value of a target position of the to-be-identified object can be first determined according to the depth value information of the original depth image. The target position can be a specific position in the pre-determined effective face region, and can be used as a reference position for determining the effective face region. It should be noted that the application does not make any limitation on the setting of the target position. For example, in a possible implementation, considering that in face recognition, the depth camera is generally directed at the face for collection, the tip of the nose in the face can be considered to be closest to the depth camera. When there is a certain collection angle change in the collection process, the tip of the nose is relatively close to the depth camera compared with other positions. Therefore, in actual application, the tip of the nose in the face can be used as the target position.

[0042] S103: Determine a minimum depth value corresponding to the original depth image according to the target depth value, and determine a maximum depth value corresponding to the original depth image according to the target depth value.

[0043] After obtaining the target depth value of the target position, the target position can be used as a reference position for determining the effective face region. The minimum depth value corresponding to the original depth image and the maximum depth value corresponding to the original depth image can be determined according to the target depth value. The target position is used to represent the reference position of the effective face region of the to-be-identified object, the minimum depth value is used to represent the depth value of the position closest to the collection camera in the effective face region of the to-be-identified object, the maximum depth value is used to represent the depth value of the boundary position of the effective face region of the to-be-identified object, and the absolute value of the difference between the target depth value and the minimum depth value is less than the absolute value of the difference between the target depth value and the maximum depth value. Based on this, it can be considered that the minimum depth value and the maximum depth value are asymmetric when the target depth value is used as a reference. Compared with the minimum depth value and the maximum depth value constructed symmetrically with the target depth value as a reference in the related art, the minimum depth value and the maximum depth value provided by the application can more accurately represent the effective face region.

[0044] In practical applications, considering the influence of the face collection angle change on the minimum depth value and the maximum depth value, in a possible implementation, the specific implementation of S102 can include: first, the collection angle of the original depth image can be acquired, and the first preset depth value corresponding to the original depth image can be acquired, wherein the collection angle is used to represent the relative angle between the to-be-identified object and the collection camera when the original depth image is collected by using the collection camera, and the first preset depth value can be set according to the effective face region information and is used to identify the depth value difference between the target position and the boundary position of the effective face region, for example, the boundary position can be the earlobe position. Further, the minimum depth value can be determined according to the collection angle and the target depth value, and the maximum depth value can be determined according to the collection angle, the target depth value and the first preset depth value. Based on this, the accuracy of the minimum depth value and the maximum depth value can be improved while taking the target position as a reference and combining the collection angle of the original depth image.

[0045] In practical applications, if the collection angle meets the first preset condition, it can be considered that the to-be-identified object is collected by facing the collection camera when the original depth image is collected, that is, at this time, it can be considered that the target position is the position closest to the collection camera, at this time, the target depth value can be directly taken as the minimum depth value, and the sum of the target depth value and the first preset depth value can be taken as the maximum depth value. It can be seen that for the case that the collection angle meets the first preset condition, that is, the to-be-identified object faces the collection camera, the minimum depth value and the maximum depth value can be quickly determined to facilitate subsequent steps. For example, taking the nose tip position as the target position, the target depth value corresponding to the nose tip position is d, when the face is collected by facing the collection camera, the position with the minimum actual depth value is the nose tip position, at this time, the minimum depth value is d, and if the first preset depth value is denoted as n, the maximum depth value is d+n. For example, according to a large amount of face depth image data, it can be determined that the depth value range between the nose tip position and the earlobe position is [5, 7] cm, and the first preset depth value n can be set as 6 cm.

[0046] In actual application, if the collection angle satisfies the second preset condition, it can be considered that the to-be-recognized object is not directly facing the collection camera when the original depth image is collected, but there is a certain relative angle between the to-be-recognized object and the collection camera. In this case, the target position is not the position closest to the collection camera, that is, the target depth value is not the real minimum depth value. At this time, the target depth value can be corrected according to the collection angle to obtain the minimum depth value. Meanwhile, considering that the depth value difference between the target position and the boundary position of the effective face region will also be affected to a certain extent when the collection angle exists, at this time, the first preset depth value can be corrected according to the collection angle to obtain the second preset depth value, and then the sum of the target depth value and the second preset depth value is taken as the maximum depth value. Based on this, for the case that the to-be-recognized object is not directly facing the collection camera, the target depth value and the first preset depth value can be corrected in combination with the collection angle while taking the target position as the reference position, and the minimum depth value and the maximum depth value are determined based on the corrected results, so as to accurately determine the position with the minimum depth value and the position with the maximum depth value in the effective face region of the to-be-recognized object.

[0047] The present application does not make any limitation on the manner of correcting the target depth value according to the collection angle and the manner of correcting the first preset depth value according to the collection angle. In order to facilitate understanding, the present application embodiment provides the following examples:

[0048] In a possible implementation, the correction depth value can be determined according to the collection angle. Since the position with the real minimum depth value is closer to the collection camera than the target position, and the position with the real maximum depth value is farther away from the collection camera than the target position, in specific implementation, the difference between the target depth value and the correction depth value can be taken as the minimum depth value, and the sum of the first preset depth value and the correction depth value can be taken as the second preset depth value, based on which the correction of the target depth value and the first preset depth value is completed. The correction depth value can represent the difference between the actual minimum depth value and the target depth value caused by the collection angle. For example, taking the nose tip position as the target position, the target depth value corresponding to the nose tip position is d, when the face profile is collected, the position with the actual minimum depth value can be the cheekbone position, and the collection angle can reflect the degree of the face profile, so the correction depth value m can be determined based on the collection angle, and then d-m is taken as the depth value of the cheekbone position, that is, the minimum depth value, and d+n+m is taken as the maximum depth value. For example, m=3cm can be determined according to the collection angle.

[0049] S104: Determine the interval indicated by the minimum depth value and the maximum depth value as the depth value interval corresponding to the original depth image.

[0050] When the minimum depth value corresponding to the position with the minimum depth value in the effective face region and the maximum depth value corresponding to the position with the maximum depth value in the effective face region are determined, an interval identified by the minimum depth value and the maximum depth value can be determined as a depth value interval corresponding to the original depth image, and the depth value interval is a depth value distribution interval corresponding to the effective face region, so that the depth value interval can comprehensively cover the effective face region of the to-be-identified object, so as to perform subsequent face recognition and the like.

[0051] In actual applications, after the depth value interval corresponding to the effective face region is determined, the effective face space corresponding to the to-be-identified object can also be constructed according to the depth value interval.

[0052] It should be noted that there can be various ways to construct the effective face space according to the depth value interval, which are not limited in the present application. In order to facilitate understanding, the following construction methods are provided as examples by the embodiments of the present application.

[0053] In a possible implementation, the absolute value of the difference between the target depth value and the minimum depth value can be determined as a first radius, the absolute value of the difference between the target depth value and the maximum depth value can be determined as a second radius, and then an ellipsoid can be constructed as the effective face space according to the first radius and the second radius with the target position as the center of the sphere. Since the absolute value of the difference between the target depth value and the minimum depth value is less than the absolute value of the difference between the target depth value and the maximum depth value, it can be considered that the minimum depth value and the maximum depth value are asymmetric when the target depth value is taken as a reference, that is, the depth value interval is an asymmetric interval, and accordingly, the first radius is less than the second radius, so that the ellipsoid can be constructed with the first radius and the second radius when the target position is taken as the center of the sphere. At this time, the shape of the effective face space corresponding to the effective face region is an ellipsoid.

[0054] In specific implementation, for the case that the to-be-identified object faces the collection camera, the first radius is equal to 0 and the second radius is equal to n, so that the shape of the effective face space can be a hemisphere at this time. For the case that the to-be-identified object does not face the collection camera, the first radius is equal to m and the second radius is equal to n+m, so that the shape of the effective face space can be an ellipsoid formed by two hemispheres.

[0055] In another possible implementation, the first plane where the minimum depth value is located and the second plane where the maximum depth value is located can also be constructed parallel to the face direction with the positions corresponding to the minimum depth value and the maximum depth value as references, and then a cuboid can be constructed as the effective face space based on the first plane, the second plane, and the forehead position and chin position of the to-be-identified object.

[0056] Compared with the way of constructing a sphere as an effective face space in the related art, the effective face space constructed based on the asymmetric interval provided in the embodiments of the present application is also an asymmetric space, is closer to the real face space, reduces space waste, and is beneficial to subsequent pixel mapping processing.

[0057] S105: Perform pixel mapping processing on the original depth image according to the depth value interval to obtain a target pixel image.

[0058] In actual application, the pixel mapping processing can be performed on the original depth image according to the depth value interval to obtain a target pixel image. Based on this, the original depth image is mapped into a two-dimensional pixel space. Since the depth value interval can comprehensively cover the effective face region of the object to be recognized, when the pixel mapping processing is performed according to the depth value interval, the pixel interval can be more completely utilized, thereby improving the distinguishability of each position of the face in the target pixel image, so that the efficiency of face recognition can be improved when the face recognition is performed using the target pixel image subsequently.

[0059] For ease of understanding, taking the position of the tip of the nose as the target position, the target depth value as d, the corrected depth value as m, and the first preset depth value as n as examples, the depth value interval [d-m, d+n+m] can be determined accordingly, and the depth value interval [d-m, d+n+m] is mapped to the pixel interval [0, 255]. Specifically, assuming that the depth value of a position in the effective face region is x (x is a value on the depth value interval), the pixel value corresponding to the position can be determined by the following formula, denoted as p:

[0060]

[0061] Based on this, the effective face region can be mapped onto a two-dimensional pixel space. It should be noted that for the part of the non-face region in the original depth image, the corresponding depth value is not on the depth value interval, and accordingly when the pixel mapping processing is performed, the corresponding pixel value of that part can be directly set to 0.

[0062] After the pixel mapping processing is completed to obtain the target pixel image, the object to be recognized can be recognized based on the target pixel image. In actual application, the target pixel image of the object to be recognized and the color image of the object to be recognized can be merged, and the face recognition of the object to be recognized is completed based on the merging result.

[0063] It can be seen from the technical solution that, for the to-be-recognized object, the original depth image corresponding to the to-be-recognized object can be acquired first, the target depth value corresponding to the target position of the to-be-recognized object can be determined based on the depth value information of the original depth image, and the minimum depth value and the maximum depth value corresponding to the original depth image can be determined according to the target depth value, and then the interval identified by the minimum depth value and the maximum depth value is determined as the depth value interval corresponding to the original depth image. The target position is used to represent the reference position of the effective face region of the to-be-recognized object, the minimum depth value is used to represent the depth value of the position closest to the camera in the effective face region, and the maximum depth value is used to represent the depth value of the boundary position of the effective face region. Since the absolute value of the difference between the target depth value and the minimum depth value is less than the absolute value of the difference between the target depth value and the maximum depth value, it can be considered that the minimum depth value and the maximum depth value are asymmetric when the target depth value is used as a reference. Correspondingly, the depth value interval can be considered as an asymmetric interval. Compared with the method of identifying the effective face region based on constructing a symmetric interval in the related art, constructing an asymmetric interval can comprehensively cover the effective face region and reduce the waste of the interval. Therefore, the pixel mapping processing according to the depth value interval can more completely utilize the pixel interval, thereby improving the distinguishability of each position of the face in the target pixel image, and the efficiency of face recognition using the target pixel image can be improved.

[0064] In actual applications, due to the limitation of the depth map acquisition technology level, the original depth image acquired has a problem of missing depth information, and accordingly the target pixel image obtained after the pixel mapping processing has part of holes. For example, as shown in FIG. 1, which is a schematic diagram of a target pixel image provided by an embodiment of the present application, it should be noted that, Figure 2 only part of the holes are shown as an example in FIG. 1. Figure 2

[0065] The holes in the target pixel image can reduce the image quality and cannot accurately reflect the face information of the to-be-recognized object, thereby affecting the subsequent face recognition. Therefore, in a possible implementation manner, the target pixel image can also be subjected to hole filling processing to obtain a repaired pixel image, and then the to-be-recognized object is identified according to the repaired pixel image. The principle of the hole filling processing is to use the pixel values near the holes for completion to achieve the purpose of repairing the holes. Based on this, the holes in the target pixel image are repaired through the hole filling processing, so that the repaired pixel image has higher image quality than the target pixel image and can better reflect the face information of the to-be-recognized object, which is beneficial to improving the efficiency of face recognition.

[0066] ​In one possible implementation, the target pixel image can first undergo pixel value inversion processing to obtain an inverted pixel image. In practical applications, pixel value inversion processing can specifically involve subtracting the pixel value corresponding to each position in the target pixel image from the maximum value of 255 in the pixel space, thus obtaining the inverted pixel image. This facilitates the repair of holes using hole-filling techniques such as dilation. Then, the areas to be filled in the inverted pixel image are determined based on the inverted pixel values. These areas are the regions in the target pixel image where holes exist. Hole-filling processing is then performed on these areas using a hole-filling kernel to obtain a filled pixel image. Finally, the filled pixel image undergoes pixel value inversion processing to obtain the repaired pixel image. It can be understood that the specific process of pixel value inversion processing on the filled pixel image also involves subtracting the pixel value corresponding to each position in the filled pixel image from the maximum value of 255 in the pixel space, restoring the pixel value at each position to its actual state, ultimately resulting in the repaired pixel image.

[0067] This application does not impose any limitations on the selection of the cavity filling core. For example, the cavity filling core can be a rhomboid core, a rectangular core, or a combination of rhomboid and rectangular cores. Understandably, the size of the cavity filling core can also be selected according to the size of the area to be filled, such as selecting a 5*5 rectangular core or a 7*7 rectangular core.

[0068] It is understandable that there may be multiple holes in the target pixel image (such as...). Figure 2 As shown in the diagram, the area to be filled in the inverted pixel image can include multiple areas. In practical applications, the size of the holes varies. Therefore, in practice, the areas to be filled can be sorted from smallest to largest to obtain a sequence. Then, according to the hole filling kernel, the multiple areas in the sequence are sequentially filled to obtain the filled pixel image. Based on this, starting with the smallest hole and successively stacking multiple hole filling processes can improve the repair effect of larger holes.

[0069] To better understand, the void-filling cores used in the embodiments of this application include rhomboid cores and monolithic cores; for details, please refer to... Figure 3a As shown, a 5x5 rhomboid core is illustrated; see [reference needed]. Figure 3bAs shown, a 5*5 all-one kernel is shown. In practical applications, a 5*5 diamond kernel can be first used to perform dilation processing on the to-be-filled region, and then a 5*5 all-one kernel is used to perform erosion operation, so as to connect the pixel values of the adjacent pixels around the to-be-filled region, and achieve the purpose of repairing small-area holes. Further, a 7*7 all-one kernel can be used to perform dilation processing and erosion operation, and this step can be repeated to achieve the purpose of repairing larger-area holes. It should be noted that the number of repeated dilation operation and erosion operation can be set according to the distribution of the actual to-be-filled region, and the present application does not make any limitation.

[0070] In order to further improve the quality of the repaired pixel image, so as to improve the efficiency of face recognition, in a possible implementation manner, the filled pixel image obtained by completing the hole filling processing can also be subjected to denoising and smoothing processing. Specifically, the filled pixel image can be subjected to filtering processing to obtain a filtered pixel image, and finally the filtered pixel image is subjected to pixel value inversion processing to obtain a repaired pixel image. Based on this, the filled pixel image is subjected to denoising and smoothing by filtering processing, which can improve the quality of the repaired pixel image, thereby improving the efficiency of face recognition.

[0071] In the specific implementation process, the filter can be used to complete the above-mentioned filtering processing. Specifically, the median filter can be used for median filtering processing to remove noise points, and the Gaussian filter can be used for Gaussian filtering to perform smoothing processing on the local surface. The selection of the median filter and the Gaussian filter is not limited in the present application. For example, the median filter can be a 5*5 kernel median filter, and the Gaussian filter can also be a 5*5 kernel Gaussian filter.

[0072] Figure 4 An image processing flowchart provided by the embodiments of the present application is provided. Specifically, in the face recognition process, for the original depth image corresponding to the to-be-identified object, the original depth image can be first subjected to pixel mapping processing to obtain a target pixel image, and then the target pixel image is subjected to pixel value inversion processing to obtain an inverted pixel image. Then, the inverted pixel image can be subjected to hole filling processing to repair the hole region and obtain a filled pixel image, and then the filled pixel image is subjected to median filtering and Gaussian filtering to achieve the purpose of denoising and smoothing, and obtain a filtered pixel image. Finally, the filtered pixel image is subjected to pixel value inversion processing, so that the pixel value at each position is restored to the actual state pixel value, and finally a repaired pixel image is obtained. Finally, the repaired pixel image can be used for face recognition, for example, the repaired pixel image of the to-be-identified object can be combined with the color image of the to-be-identified object, and the face recognition of the to-be-identified object is completed based on the combination result. Based on this, a series of preprocessing is performed on the original depth image, which can improve the image quality and is beneficial to improving the efficiency of subsequent face recognition.

[0073] It can be understood that it basically corresponds to the method embodiment, so the relevant part can be referred to the part of the method embodiment.

[0074] Figure 5 A structure diagram of an image processing device provided by the embodiment of the application is provided, and the device includes an acquisition unit 501, a determination unit 502, and a processing unit 503.

[0075] The acquisition unit 501 acquires an original depth image corresponding to a to-be-identified object.

[0076] The determination unit 502 is configured to determine a target depth value corresponding to a target position of the to-be-identified object according to depth value information of the original depth image.

[0077] The determination unit 502 is further configured to determine a minimum depth value corresponding to the original depth image according to the target depth value, and determine a maximum depth value corresponding to the original depth image according to the target depth value; an absolute value of a difference between the target depth value and the minimum depth value is less than an absolute value of a difference between the target depth value and the maximum depth value.

[0078] The determination unit 502 is further configured to determine an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image.

[0079] The processing unit 503 is configured to perform pixel mapping processing on the original depth image according to the depth value interval, to obtain a target pixel image.

[0080] In a possible implementation, the determination unit is further configured to:

[0081] acquire a collection angle of the original depth image, and acquire a first preset depth value corresponding to the original depth image;

[0082] determine the minimum depth value according to the collection angle and the target depth value, and determine the maximum depth value according to the collection angle, the target depth value, and the first preset depth value.

[0083] In a possible implementation, if the collection angle satisfies a first preset condition, the determination unit is further configured to:

[0084] take the target depth value as the minimum depth value;

[0085] take a sum of the target depth value and the first preset depth value as the maximum depth value.

[0086] In a possible implementation, if the collection angle satisfies a second preset condition, the determination unit is further configured to:

[0087] determining a correction depth value according to the collection angle;

[0088] correcting the first preset depth value according to the collection angle to obtain a second preset depth value;

[0089] taking a sum of the target depth value and the second preset depth value as the maximum depth value.

[0090] In a possible implementation, the determining unit is further configured to:

[0091] determine a correction depth value according to the collection angle;

[0092] taking a difference between the target depth value and the correction depth value as the minimum depth value;

[0093] taking a sum of the first preset depth value and the correction depth value as the second preset depth value.

[0094] In a possible implementation, the apparatus further includes a constructing unit.

[0095] The constructing unit is configured to construct an effective face space corresponding to the to-be-identified object according to the depth value interval.

[0096] In a possible implementation, the constructing unit is further configured to:

[0097] determine a first radius as an absolute value of a difference between the target depth value and the minimum depth value, and determine a second radius as an absolute value of a difference between the target depth value and the maximum depth value;

[0098] construct an ellipsoid as the effective face space according to the first radius and the second radius, with the target position as a center of the ellipsoid.

[0099] In a possible implementation, the apparatus further includes an identifying unit.

[0100] The identifying unit is configured to identify the to-be-identified object based on the target pixel image.

[0101] According to the technical solution, for the to-be-recognized object, the original depth image corresponding to the to-be-recognized object can be acquired first, the target depth value corresponding to the target position of the to-be-recognized object can be determined based on the depth value information of the original depth image, and the minimum depth value and the maximum depth value corresponding to the original depth image can be determined according to the target depth value, and then the interval identified by the minimum depth value and the maximum depth value is determined as the depth value interval corresponding to the original depth image. The target position is used to represent the reference position of the effective face region of the to-be-recognized object, the minimum depth value is used to represent the depth value of the position closest to the camera in the effective face region, and the maximum depth value is used to represent the depth value of the boundary position of the effective face region. Since the absolute value of the difference between the target depth value and the minimum depth value is smaller than the absolute value of the difference between the target depth value and the maximum depth value, it can be considered that the minimum depth value and the maximum depth value are asymmetric when the target depth value is used as a reference. Correspondingly, the depth value interval can be considered as an asymmetric interval. Compared with the manner of identifying the effective face region based on constructing a symmetric interval in the related art, constructing an asymmetric interval can comprehensively cover the effective face region and reduce the waste of the interval. Therefore, the pixel mapping processing according to the depth value interval can more completely utilize the pixel interval, thereby improving the distinguishability of each position of the face in the target pixel image, and the efficiency of face recognition can be improved when the target pixel image is used for face recognition.

[0102] In another aspect, the embodiments of the present application also provide a storage medium for storing a computer program, which is used to execute the image processing method provided by the above embodiments.

[0103] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by a program instruction related to hardware, and the foregoing program can be stored in a computer readable storage medium, and the program is executed to perform the steps of the above method embodiments; and the foregoing storage medium can be at least one of the following media: a read-only memory (English: Read-only Memory, abbreviated as ROM), a RAM, a magnetic disk or an optical disk, and various media that can store program codes.

[0104] For the device embodiments, since they basically correspond to the method embodiments, the related parts are described in the part of the method embodiments. The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0105] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0106] The above provides a detailed description of the image processing method and related apparatus provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples in the present document. The above description of the embodiments is only used to help understand the method of the present application. For those skilled in the art, the specific implementation manners and application scope of the method of the present application can be changed.

[0107] In conclusion, the content of the present specification should not be understood as a limitation of the present application. Any skilled person in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Moreover, the implementation manners provided by the present application in the above aspects can be further combined to provide more implementation manners.

Claims

1. An image processing method, characterized by, The method comprises: acquiring an original depth image corresponding to a to-be-identified object; determining a target depth value corresponding to a target position of the to-be-identified object according to depth value information of the original depth image; determining a minimum depth value corresponding to the original depth image according to the target depth value, and determining a maximum depth value corresponding to the original depth image according to the target depth value; an absolute value of a difference between the target depth value and the minimum depth value is less than an absolute value of a difference between the target depth value and the maximum depth value; determining an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image; performing pixel mapping processing on the original depth image according to the depth value interval to obtain a target pixel image; wherein the determining the minimum depth value corresponding to the original depth image according to the target depth value and the determining the maximum depth value corresponding to the original depth image according to the target depth value comprise: acquiring an acquisition angle of the original depth image, and acquiring a first preset depth value corresponding to the original depth image; the first preset depth value is used to identify a depth value difference from the target position to a boundary position of a valid face region corresponding to the to-be-identified object; if the acquisition angle satisfies a first preset condition, taking the target depth value as the minimum depth value, and taking a sum of the target depth value and the first preset depth value as the maximum depth value; if the acquisition angle satisfies a second preset condition, determining a correction to the target depth value according to the acquisition angle to obtain the minimum depth value, and correcting the first preset depth value according to the acquisition angle to obtain a second preset depth value, and taking a sum of the target depth value and the second preset depth value as the maximum depth value.

2. The method of claim 1, wherein, The method further comprises: determining a correction depth value according to the acquisition angle; the determining the correction to the target depth value according to the acquisition angle to obtain the minimum depth value comprises: taking a difference between the target depth value and the correction depth value as the minimum depth value; the correcting the first preset depth value according to the acquisition angle to obtain the second preset depth value comprises: taking a sum of the first preset depth value and the correction depth value as the second preset depth value.

3. The method of claim 1, wherein, The method further comprises: constructing a valid face space corresponding to the to-be-identified object according to the depth value interval.

4. The method of claim 3, wherein, The constructing the valid face space corresponding to the to-be-identified object according to the depth value interval comprises: determining an absolute value of a difference between the target depth value and the minimum depth value as a first radius, and determining an absolute value of a difference between the target depth value and the maximum depth value as a second radius; constructing an ellipsoid as the valid face space according to the first radius and the second radius with the target position as a spherical center.

5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: identifying the to-be-identified object based on the target pixel image.

6. An image processing apparatus characterized by comprising: The apparatus comprises an acquisition unit, a determination unit and a processing unit: the acquisition unit acquires an original depth image corresponding to a to-be-identified object; The determining unit is configured to determine a target depth value corresponding to the target position of the to-be-identified object according to the depth value information of the original depth image. The determining unit is further configured to determine a minimum depth value corresponding to the original depth image according to the target depth value, and determine a maximum depth value corresponding to the original depth image according to the target depth value; an absolute value of a difference between the target depth value and the minimum depth value is less than an absolute value of a difference between the target depth value and the maximum depth value. The determining unit is further configured to determine an interval identified by the minimum depth value and the maximum depth value as a depth value interval corresponding to the original depth image. The processing unit is configured to perform pixel mapping processing on the original depth image according to the depth value interval, to obtain a target pixel image. The determining unit is further configured to: obtain an acquisition angle of the original depth image, and obtain a first preset depth value corresponding to the original depth image; the first preset depth value is used to identify a depth value difference from the target position to a boundary position of an effective face region corresponding to the to-be-identified object. If the acquisition angle satisfies a first preset condition, the target depth value is taken as the minimum depth value, and a sum of the target depth value and the first preset depth value is taken as the maximum depth value. If the acquisition angle satisfies a second preset condition, the target depth value is corrected according to the acquisition angle to obtain the minimum depth value, and the first preset depth value is corrected according to the acquisition angle to obtain a second preset depth value, and a sum of the target depth value and the second preset depth value is taken as the maximum depth value.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, and the computer program is configured to execute the method in any one of claims 1-5. The computer readable storage medium is configured to store a computer program, and the computer program is configured to execute the method in any one of claims 1-5.

Citation Information

Patent Citations

  • Face depth image generation method and device, electronic equipment and storage medium

    CN111738988A