CN117593780B - Wrinkle depth index determination method and device, electronic equipment and storage medium - Google Patents

Wrinkle depth index determination method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117593780B
CN117593780B CN202410044803.0A CN202410044803A CN117593780B CN 117593780 B CN117593780 B CN 117593780B CN 202410044803 A CN202410044803 A CN 202410044803A CN 117593780 B CN117593780 B CN 117593780B
Authority
CN
China
Prior art keywords
wrinkle
pixel
pixel point
wrinkles
cross
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410044803.0A
Other languages
Chinese (zh)
Other versions
CN117593780A (en
Inventor
王念欧
郦轲
苏丁鹏
万进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Accompany Technology Co Ltd
Original Assignee
Shenzhen Accompany Technology Co Ltd
Filing date
Publication date
Application filed by Shenzhen Accompany Technology Co Ltd filed Critical Shenzhen Accompany Technology Co Ltd
Priority to CN202410044803.0A priority Critical patent/CN117593780B/en
Publication of CN117593780A publication Critical patent/CN117593780A/en
Application granted granted Critical
Publication of CN117593780B publication Critical patent/CN117593780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a wrinkle depth index determination method, a wrinkle depth index determination device, electronic equipment and a storage medium; the method comprises the following steps: acquiring an image to be processed, and performing wrinkle detection on the image to be processed to determine wrinkles; calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles; for each target wrinkle, at least one cross section of the target wrinkle is determined, for each cross section of the target wrinkle, pixel values of pixel points of the cross section are extracted, first-order derivatives of the pixel points are determined based on the pixel values, height differences of the cross section are calculated according to the first-order derivatives of the pixel points, wrinkle depth indexes corresponding to the cross sections are determined based on the height differences, wrinkle depth indexes of the target wrinkle are determined based on the wrinkle depth indexes of the cross sections, the problem that the wrinkle depth cannot be judged is solved, and the wrinkle depth indexes are accurately calculated so as to judge the wrinkle depth.

Description

Wrinkle depth index determination method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for determining a wrinkle depth index, an electronic device, and a storage medium.
Background
With the improvement of living standard, people are pursuing higher and higher skin care. In the skin care process, skin problems such as wrinkles, acnes and the like of the skin are focused, so that a proper skin care product is selected or recommended for a user, and the purpose of effectively protecting the skin is achieved. In the prior art, when identifying wrinkles, the depth of the wrinkles cannot be judged, so that the skin cannot be accurately protected, and the skin care effect is further affected.
Disclosure of Invention
The invention provides a wrinkle depth index determination method, a wrinkle depth index determination device, electronic equipment and a storage medium, which are used for solving the problem that the wrinkle depth cannot be judged.
According to an aspect of the present invention, there is provided a wrinkle depth index determination method including:
Acquiring an image to be processed, and performing wrinkle detection on the image to be processed to determine wrinkles;
Calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles;
for each target wrinkle, determining at least one cross section of the target wrinkle, for each cross section of the target wrinkle, extracting pixel values of pixel points of the cross section, determining first derivatives of the pixel points based on the pixel values, calculating height differences of the cross section according to the first derivatives of the pixel points, determining wrinkle depth indexes corresponding to the cross section based on the height differences, and determining wrinkle depth indexes of the target wrinkle based on the wrinkle depth indexes of the cross section.
According to another aspect of the present invention, there is provided a wrinkle depth index determination device comprising:
The image acquisition module is used for acquiring an image to be processed, and detecting wrinkles on the image to be processed to determine the wrinkles;
A target wrinkle determination module for calculating an area and an eccentricity of the wrinkle, filtering the wrinkle based on the area and the eccentricity of the wrinkle, and determining a target wrinkle, wherein the eccentricity is determined according to a width and a height of the wrinkle;
The wrinkle depth index determination module is used for determining at least one cross section of each target wrinkle, extracting pixel values of pixel points of the cross section for each cross section of the target wrinkle, determining first derivatives of the pixel points based on the pixel values, calculating height differences of the cross section according to the first derivatives of the pixel points, determining wrinkle depth indexes corresponding to the cross sections based on the height differences, and determining wrinkle depth indexes of the target wrinkles based on the wrinkle depth indexes of the cross sections.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor, and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the wrinkle depth index determination method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the wrinkle depth index determination method according to any one of the embodiments of the present invention when executed.
According to the technical scheme, the image to be processed is obtained, and wrinkle detection is carried out on the image to be processed to determine wrinkles; calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles; for each target wrinkle, determining at least one cross section of the target wrinkle, for each cross section of the target wrinkle, extracting pixel values of pixel points of the cross section, determining first derivatives of the pixel points based on the pixel values, calculating height differences of the cross section according to the first derivatives of the pixel points, determining wrinkle depth indexes corresponding to the cross section based on the height differences, determining the wrinkle depth indexes of the target wrinkle based on the wrinkle depth indexes of the cross section, solving the problem that the wrinkle depth cannot be judged, determining the wrinkle by performing wrinkle detection on an image to be processed, determining the eccentricity by the width and the height of the wrinkle, further determining the target wrinkle according to the eccentricity and the area, accurately screening out the target wrinkle, and filtering invalid data; extracting pixel values of pixel points in a cross section of a target wrinkle, determining a first derivative of the pixel points according to the pixel values, further calculating a height difference of the cross section according to the first derivative, determining wrinkle depth indexes of the cross section according to the height difference, and finally determining the wrinkle depth index of the target wrinkle by integrating the wrinkle depth indexes of each cross section, wherein the wrinkle depth is represented by the wrinkle depth indexes so as to judge the wrinkle depth.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a wrinkle depth index determination method according to a first embodiment of the present invention;
FIG. 2 is a schematic illustration of a cross section in a target wrinkle provided in accordance with a first embodiment of the present invention;
FIG. 3 is a diagram showing an example of distribution of pixels in a cross section according to a first embodiment of the present invention;
FIG. 4 is a flowchart of a wrinkle depth index determination method according to the second embodiment of the present invention;
Fig. 5 is a schematic structural view of a wrinkle depth index determination device according to the third embodiment of the present invention;
Fig. 6 is a schematic structural diagram of an electronic device implementing a wrinkle depth index determination method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a wrinkle depth index determination method according to an embodiment of the present invention, where the method may be performed by a wrinkle depth index determination device, and the wrinkle depth index determination device may be implemented in hardware and/or software, and the wrinkle depth index determination device may be configured in an electronic device. As shown in fig. 1, the method includes:
s101, acquiring an image to be processed, and detecting wrinkles of the image to be processed to determine the wrinkles.
In the present embodiment, an image to be processed can be specifically understood as an image having a need to identify the depth of wrinkles; the actual wrinkles may be determined by the pixel values of the pixels, consisting of different pixels.
Collecting skin images of the face, the neck and other positions as images to be processed; the image to be processed can be acquired and processed in real time in the actual application process, can be stored after acquisition, and can be acquired and processed after a certain condition is triggered. After the image to be processed is obtained, wrinkle detection is carried out on the image to be processed, wrinkles existing in the image to be processed are detected, the wrinkle detection can be achieved through a set algorithm, for example, frangi algorithm, filtering, denoising and the like can be carried out on the image to be processed before the wrinkle detection is carried out, noise in the image is removed, and recognition accuracy is improved.
The acquisition, storage, use, processing and the like of the data (such as images) in the technical scheme of the application all accord with the relevant regulations of national laws and regulations.
S102, calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles.
In this embodiment, the target wrinkles are specifically understood as final determined wrinkles, and the number of the target wrinkles may be changed in different images, and may be one or more or 0, if 0, no wrinkles are detected at this time, and no wrinkle depth index need be determined.
For each wrinkle, the width and height of the wrinkle are determined, and the width and height of the wrinkle may be determined according to the number of pixels, for example, the number of pixels is directly taken as the width or height, i.e., the number of pixels in the width direction (e.g., X-axis direction) is taken as the width, and the number of pixels in the height direction (e.g., Y-axis direction) is taken as the height. The eccentricity is calculated according to the width and the height of the wrinkles, for example, the eccentricity is equal to the height divided by the width, the eccentricity is equal to the sum of the height and the width divided by the width, and the like, and the eccentricity can be calculated by presetting a calculation formula of the eccentricity and bringing the width and the height into the calculation formula. The area of the wrinkles may be calculated by calculating the product of the height and width to determine the area. The method comprises the steps of setting filtering conditions of wrinkles according to the area and the eccentricity, judging whether the filtering conditions are met according to the area and the eccentricity of the wrinkles, filtering non-wrinkles according to the filtering conditions, and screening out the wrinkles meeting the requirements as target wrinkles. For example, a wrinkle having an area greater than a set area threshold and an eccentricity greater than a set eccentricity threshold is determined as a target wrinkle, with an area threshold of 500 and an eccentricity threshold of 0.98 being exemplary. Each wrinkle is filtered in the above manner to determine the target wrinkle.
S103, determining at least one cross section of the target wrinkle for each target wrinkle, extracting pixel values of pixel points of the cross section for each cross section of the target wrinkle, determining first derivatives of the pixel points based on the pixel values, calculating height differences of the cross section according to the first derivatives of the pixel points, determining wrinkle depth indexes corresponding to the cross sections based on the height differences, and determining wrinkle depth indexes of the target wrinkles based on the wrinkle depth indexes of the cross sections.
In the present embodiment, the height difference can be understood as specifically the pixel difference value of each pixel point in the cross section of the wrinkle; the wrinkle depth index is understood to mean in particular a parameter which is used to represent the depth of a wrinkle.
For each target wrinkle, its wrinkle depth index may be determined by: first, one or more cross sections of the target wrinkles are determined, each cross section being determined in such a way that: a point is selected on the abscissa of the target wrinkle, and a line parallel to the y-axis is made through the point, and the intersection of the line and the target wrinkle is the cross section. By way of example, fig. 2 provides a schematic illustration of a cross-section of a target wrinkle, which illustrates only one cross-section 12 of a target wrinkle 11, and in practice, different cross-sections may be determined by selecting different coordinates according to the requirements. Fig. 3 provides an exemplary diagram of the distribution of the pixels in the cross section, taking the ordinate of each pixel in the cross section in the original image as the abscissa, taking the pixel value as the ordinate, determining the corresponding position of each point in the coordinate system, and forming the curve shown in fig. 3 by fitting each point because each point is a discrete point, wherein the image coordinate in fig. 3 is the ordinate of the cross section in fig. 2, the unit may be a pixel, and the image pixel value in fig. 3 is the pixel value of the pixel point in the cross section.
And for each cross section, extracting pixel values of all pixel points of the cross section, determining the change condition of the pixel value of each pixel point by analyzing the pixel values of each pixel point, and further calculating the first derivative of each pixel point. Comparing the magnitudes of the first derivatives, determining a maximum value and a minimum value of the pixel values, and determining a height difference based on the maximum value and the minimum value; the wrinkle depth index is calculated by taking the height difference into a calculation formula of the wrinkle depth index, which may be predetermined. After determining the wrinkle depth index for each cross section, an average, a maximum, a minimum, a weighted sum, etc. of the respective wrinkle depth indices may be determined, and the resultant value may be integrated as the wrinkle depth index of the target wrinkle.
The wrinkle depth index can be determined for each target wrinkle in the manner described above, and the number of cross sections of each target wrinkle can be the same or different; for example, the number of cross sections is set in advance, or the number of suitable cross sections is determined according to the length of the target wrinkles, or the like.
The embodiment of the application provides a method for determining a wrinkle depth index, which solves the problem that the wrinkle depth cannot be judged, determines the wrinkle by performing wrinkle detection on an image to be processed, determines the eccentricity by the width and the height of the wrinkle, further determines a target wrinkle according to the eccentricity and the area, accurately screens the target wrinkle, and filters invalid data; extracting pixel values of pixel points in a cross section of a target wrinkle, determining a first derivative of the pixel points according to the pixel values, further calculating a height difference of the cross section according to the first derivative, determining wrinkle depth indexes of the cross section according to the height difference, and finally determining the wrinkle depth index of the target wrinkle by integrating the wrinkle depth indexes of each cross section, wherein the wrinkle depth is represented by the wrinkle depth indexes so as to judge the wrinkle depth.
Example two
Fig. 4 is a flowchart of a wrinkle depth index determination method according to a second embodiment of the present invention, where the wrinkle depth index determination method is refined based on the foregoing embodiment. As shown in fig. 4, the method includes:
S201, acquiring an image to be processed.
Optionally, the image to be processed is collected by an image collecting device, and a polaroid is arranged in front of a camera of the image collecting device.
In this embodiment, the image pickup device may be a camera, a video recorder, a thermal infrared imager, or the like. The image acquisition device can be arranged at a fixed position and used in cooperation with beauty equipment and the like, and also can be arranged on mobile equipment and used in cooperation with the mobile equipment. The polaroid is arranged in front of the camera of the image acquisition device, and is positioned between the camera and a user when an image is acquired, so that the phenomenon that the face reflected light is uneven and has a part of highlight area can be effectively restrained by the polaroid.
S202, extracting data of a red channel of an image to be processed to form a candidate image.
In the present embodiment, a candidate image can be specifically understood as an image for realizing wrinkle detection. The image to be processed is an RGB image, which includes three passes of red, green and blue (i.e., RGB three passes), the R pass data is separated by the channel separation, and the formed image is used as a candidate image. The wrinkle detection is carried out by extracting the data of the R channel, so that the detection result is more accurate.
S203, denoising the candidate image, and detecting wrinkles on the denoised candidate image to obtain the wrinkles.
The candidate image can be denoised by a preset denoising algorithm, for example, the median filtering is adopted for denoising, and the noise can be effectively removed. And carrying out wrinkle detection on the candidate images after denoising, wherein the wrinkle detection algorithm can be Frangi algorithm, namely Frangi filter. Wrinkles in the candidate image are detected by wrinkle detection.
The basic principle of median filtering is as follows:
1. Window selection: a neighborhood window (e.g., 3 x 3, 5 x 5 pixel blocks) is selected on the image.
2. Sequencing: all pixel values within the window are ordered by value size.
3. Taking a median value: the intermediate value after sorting is selected as the new value of the center pixel of the window.
4. Sliding window: the window is slid over the entire image and the process is repeated until the entire image is covered.
Through the mode, the median filtering can effectively remove extreme values (such as noise points) in the image, and meanwhile, the edge characteristics of the image are reserved; non-gaussian noise can be effectively handled.
Frangi algorithm, which is an algorithm for enhancing a tubular structure in image processing, is realized based on eigenvalue analysis of a Hessian matrix. The key to the Frangi algorithm is to identify the tubular structure in the image by analyzing the Hessian matrix for each pixel in the image. The Hessian matrix is a second derivative matrix that is used to describe the shape characteristics of the image part. By analyzing the eigenvalues of these matrices, tubular structures can be distinguished from other types of structures. The output of this algorithm is an enhanced image in which the tubular structure becomes more pronounced, while other types of structures are relatively suppressed. Wrinkles can be effectively identified.
S204, calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining the target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles.
As an alternative embodiment of the present embodiment, the present alternative embodiment further optimizes the calculation of the area of wrinkles as: the number of pixel points included in the wrinkle is determined, and the number of pixel points is determined as the area of the wrinkle.
Counting the number of all pixel points included in each wrinkle, and determining the number of the pixel points as the area of the wrinkle.
As an alternative to this embodiment, this alternative embodiment would further optimize the calculation of the eccentricity of the wrinkles as: calculating the square of the width of the wrinkle to obtain a first square, and calculating the square of the height of the wrinkle to obtain a second square; opening the sum of the first square and the second square to determine an arithmetic square root; the ratio of the arithmetic square root to the width of the wrinkles is determined as the eccentricity.
In this embodiment, the first square is the square of the width of the wrinkle; the second square is the square of the height of the wrinkles. Calculating the square of the width of the wrinkle to obtain a first square, and calculating the square of the height of the wrinkle to obtain a second square; summing the first square and the second square, and then squaring the sum to obtain an arithmetic square root; the ratio obtained by dividing the arithmetic square root by the width of the wrinkles is the eccentricity.
Exemplary, the embodiment of the application provides a calculation formula of eccentricity:
wherein e is the eccentricity; w is the width of the wrinkles; h is the height of the wrinkles.
S205, determining at least one cross section of the target wrinkles for each target wrinkle, and extracting pixel values of pixel points of the cross sections for each cross section of the target wrinkles.
S206, for each pixel point, if the pixel point exists in the previous pixel point and the next pixel point, calculating the difference value between the pixel value of the previous pixel point and the pixel value of the next pixel point of the pixel point, and taking half of the difference value as the first derivative of the pixel point.
In this embodiment, the previous pixel may be specifically understood as the previous pixel of the pixel; the next pixel is specifically understood as the next pixel of the pixel.
For each pixel point, its first derivative is determined in the following manner: judging whether the pixel point simultaneously exists a previous pixel point and a next pixel point, if so, determining the pixel value of the previous pixel point and the pixel value of the next pixel point of the pixel point, calculating the difference value of the pixel value of the previous pixel point and the pixel value of the next pixel point, and taking half of the difference value as the first derivative of the pixel point. It can be appreciated that the first pixel in the cross-section has no previous pixel and the last pixel in the cross-section has no next pixel, and therefore, the two pixels do not need to determine the first derivative.
S207, comparing the first derivatives of the pixel points, and selecting the pixel point with the minimum absolute value of the first derivatives as a candidate pixel point according to the preset quantity.
In this embodiment, the preset number may be set according to the requirement, and is at least 2; the candidate pixel point may be specifically understood as a pixel point selected from among the pixel points for calculating the height difference.
The method comprises the steps of presetting a preset number N, comparing all the calculated first derivatives, determining the absolute value of each first derivative, sequencing the absolute values of all the first derivatives according to the order of magnitude, and selecting N pixel points with the minimum absolute value as candidate pixel points.
S208, dividing the candidate pixel points into a first pixel point set and a second pixel point set.
In this embodiment, the first pixel point set is a set formed by pixel points, and the pixel points in the first pixel point set are used for determining the highest pixel value; the second pixel point set is also a set formed by pixel points, and the pixel points in the first pixel point set are used for determining the lowest pixel value.
Dividing each candidate pixel point into a first pixel point set and a second pixel point set according to the size of the pixel value, dividing the pixel point with a larger pixel value into the first pixel point set, and dividing the pixel point with a smaller pixel value into the second pixel point set. For example, comparing the pixel value with a certain threshold, dividing the pixel value with a pixel value larger than the threshold into a first set of pixel points, dividing the pixel value with a pixel value smaller than the threshold into a second set of pixel points, and setting the threshold according to the average value of the pixel values.
S209, calculating a first pixel value according to the pixel value of the first candidate pixel point in the first pixel point set, and calculating a second pixel value according to the pixel value of the second candidate pixel point in the second pixel point set.
In this embodiment, the first candidate pixel point may be specifically understood as a pixel point in the first pixel point set; the second candidate pixel point may be specifically understood as a pixel point in the second set of pixel points. The first pixel value is to be understood as meaning in particular the value of the pixel value in the cross section that is greater; the second pixel value is to be understood as meaning in particular the value of the pixel value which is smaller in the cross section.
Determining pixel values of first candidate pixel points in a first pixel point set, determining average values, weighting summation and the like, and obtaining first pixel values; and determining the pixel value of a second candidate pixel point in the second pixel point set, determining an average value, weighting and summing and the like, and obtaining a second pixel value.
S210, determining a difference value between the first pixel value and the second pixel value as a height difference.
A difference between the first pixel value and the second pixel value is calculated, and the difference is determined as a height difference. The candidate pixel points are selected in a mode of calculating the first derivative to calculate the height difference, so that errors can be effectively reduced, and the accuracy of results is improved.
Optionally, the preset number is three; the first pixel point set comprises a first candidate pixel point, the second pixel point set comprises two second candidate pixel points, the first candidate pixel point is larger than one second candidate pixel point, and the first candidate pixel point is smaller than the other second candidate pixel point;
As an optional embodiment of the present embodiment, the present optional embodiment further optimizes calculating the first pixel value according to the pixel value of the first candidate pixel point in the first pixel point set to: determining a pixel value of a first candidate pixel point as a first pixel value;
As an optional embodiment of the present embodiment, the present optional embodiment further optimizes calculating a second pixel value according to the pixel values of the second candidate pixel points in the first pixel point set to: and determining an average value of the pixel values of the second candidate pixel points as a second pixel value.
In the embodiment of the application, the preset number is preferably set to 3, namely, three pixel points with the smallest absolute value of the first derivative are selected as candidate pixel points, the pixel point with the largest pixel value in the 3 candidate pixel points is taken as a first candidate pixel point, and the remaining two candidate pixel points are taken as second candidate pixel points; the pixel value of the first candidate pixel point is determined to be the first pixel value directly; and calculating an average value of the pixel values of the second candidate pixel points, and determining the average value as the second pixel value.
S211, calculating the ratio of the height difference to the wrinkle depth parameter.
In the present embodiment, the wrinkle depth parameter may be specifically understood as a parameter for calculating the wrinkle depth index, and may be empirically set in advance. The wrinkle depth parameter is preset, and when the wrinkle depth index is calculated, the ratio of the height difference to the wrinkle depth parameter is calculated so as to calculate the wrinkle depth index according to the ratio.
S212, determining the product of the ratio and the set coefficient as the wrinkle depth index of the cross section.
In this embodiment, the setting coefficient is set in advance according to the actual application requirement. The product of the ratio and the set coefficient is calculated and is determined as the wrinkle depth index of the cross section.
S213, determining the wrinkle depth index of the target wrinkle based on the wrinkle depth index of each cross section.
In an embodiment of the present application, the wrinkle depth index of each target wrinkle is determined according to the steps of S205 to S213.
Exemplary, the embodiment of the application provides a calculation formula of a first derivative:
wherein F (x) represents the first derivative at pixel point x; f (x+1) represents the pixel value of the last pixel point of the pixel point x; f (x-1) represents the pixel value of the next pixel of the pixel x.
Taking 3 preset numbers as an example, sequentially finding three pixel points P1, P2 and P3 with the smallest absolute value of the first derivative, wherein the corresponding pixel values are V1, V2 and V3, and the height difference L=v2- (v1+v3)/2, wherein V2 is a first pixel value, (v1+v3)/2 (i.e. the average value of V1 and V3) is a second pixel value; the height difference L is a representation of the depth of the wrinkles.
The wrinkle depth index de=l/c×100, where C is the wrinkle depth parameter, c=90, the set coefficient is 100, DE e [0, 100].
The embodiment of the application provides a wrinkle depth index determination method, which solves the problem that the wrinkle depth cannot be judged, and the polaroid is arranged in front of a camera of an image acquisition device, so that the phenomenon that the reflected light of the face is uneven and has a part of highlight areas can be effectively inhibited by the polaroid, and the acquired image to be processed has less noise and is more beneficial to recognition; the embodiment further provides a specific calculation mode of the eccentricity ratio, and the target wrinkles are accurately screened out, and invalid data are filtered out; the method for determining the wrinkle depth index of the target wrinkle comprises the steps of extracting pixel values of pixel points in the cross section of the target wrinkle, calculating first derivatives of the pixel points according to pixel values of a previous pixel point and a next pixel point of the pixel points, calculating the height difference of the cross section according to the first derivatives, effectively reducing errors, improving accuracy of results, determining the wrinkle depth index of the cross section according to the height difference, and finally determining the wrinkle depth index of the target wrinkle by integrating the wrinkle depth indexes of the cross sections, wherein the wrinkle depth index is used for representing the wrinkle depth so as to judge the wrinkle depth.
Example III
Fig. 5 is a schematic structural diagram of a wrinkle depth index determination device according to a third embodiment of the present invention. As shown in fig. 5, the apparatus includes: an image acquisition module 31, a target wrinkle determination module 32, and a wrinkle depth index determination module 33.
The image acquisition module 31 is configured to acquire an image to be processed, and detect wrinkles on the image to be processed to determine wrinkles;
A target wrinkle determination module 32 for calculating an area and an eccentricity of the wrinkle, filtering the wrinkle based on the area and the eccentricity of the wrinkle, and determining a target wrinkle, wherein the eccentricity is determined according to a width and a height of the wrinkle;
A wrinkle depth index determination module 33, configured to determine, for each target wrinkle, at least one cross section of the target wrinkle, extract, for each cross section of the target wrinkle, a pixel value of a pixel point of the cross section, determine a first derivative of the pixel point based on each pixel value, calculate a height difference of the cross section according to the first derivative of each pixel point, determine a wrinkle depth index corresponding to the cross section based on the height difference, and determine a wrinkle depth index of the target wrinkle based on the wrinkle depth index of each cross section.
The embodiment of the application provides a wrinkle depth index determining device, which solves the problem that the wrinkle depth cannot be judged, determines wrinkles by performing wrinkle detection on an image to be processed, determines eccentricity by the width and the height of the wrinkles, further determines target wrinkles according to the eccentricity and the area, accurately screens out the target wrinkles, and filters out invalid data; extracting pixel values of pixel points in a cross section of a target wrinkle, determining a first derivative of the pixel points according to the pixel values, further calculating a height difference of the cross section according to the first derivative, determining wrinkle depth indexes of the cross section according to the height difference, and finally determining the wrinkle depth index of the target wrinkle by integrating the wrinkle depth indexes of each cross section, wherein the wrinkle depth is represented by the wrinkle depth indexes so as to judge the wrinkle depth.
Optionally, the image to be processed is collected by an image collecting device, and a polaroid is arranged in front of a camera of the image collecting device.
Optionally, the image acquisition module 31 includes:
a candidate image determining unit, configured to extract data of a red channel of the image to be processed, and form a candidate image;
and the wrinkle detection unit is used for denoising the candidate image and detecting the wrinkles of the denoised candidate image to obtain the wrinkles.
Optionally, the target wrinkle determination module 32 is specifically configured to: the number of pixel points included in the wrinkles is determined, and the number of pixel points is determined as the area of the wrinkles.
Optionally, the target wrinkle determination module 32 is specifically configured to: calculating the square of the width of the wrinkle to obtain a first square, and calculating the square of the height of the wrinkle to obtain a second square; open squaring the sum of the first square and the second square to determine an arithmetic square root; the ratio of the arithmetic square root to the width of the wrinkles is determined as the eccentricity.
Optionally, the wrinkle depth index determination module 33 comprises:
And the derivative determining unit is used for calculating the difference value between the pixel value of the last pixel point and the pixel value of the next pixel point of the pixel point if the last pixel point and the next pixel point exist in the pixel point, and taking half of the difference value as the first derivative of the pixel point.
Optionally, the wrinkle depth index determination module 33 comprises:
The height difference calculation unit is used for comparing the first derivatives of the pixel points, and selecting the pixel point with the minimum absolute value of the first derivatives as a candidate pixel point according to the preset quantity; dividing the candidate pixel points into a first pixel point set and a second pixel point set; calculating a first pixel value according to the pixel value of a first candidate pixel point in the first pixel point set, and calculating a second pixel value according to the pixel value of a second candidate pixel point in the second pixel point set; a difference between the first pixel value and the second pixel value is determined as a height difference.
Optionally, the preset number is three;
the first pixel point set comprises a first candidate pixel point, the second pixel point set comprises two second candidate pixel points, the first candidate pixel point is larger than one second candidate pixel point, and the first candidate pixel point is smaller than the other second candidate pixel point;
The calculating a first pixel value according to the pixel value of the first candidate pixel point in the first pixel point set includes:
determining the pixel value of the first candidate pixel point as a first pixel value;
The calculating a second pixel value according to the pixel value of the second candidate pixel point in the first pixel point set includes:
and determining an average value of the pixel values of the second candidate pixel points as a second pixel value.
Optionally, the wrinkle depth index determination module 33 comprises:
An index calculation unit for calculating a ratio of the height difference to the wrinkle depth parameter; the product of the ratio and the set coefficient is determined as the wrinkle depth index of the cross section.
The wrinkle depth index determination device provided by the embodiment of the invention can execute the wrinkle depth index determination method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 6 shows a schematic diagram of an electronic device 40 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., helmets, eyeglasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 40 includes at least one processor 41, and a memory communicatively connected to the at least one processor 41, such as a Read Only Memory (ROM) 42, a Random Access Memory (RAM) 43, etc., in which the memory stores a computer program executable by the at least one processor, and the processor 41 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 42 or the computer program loaded from the storage unit 48 into the Random Access Memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 may also be stored. The processor 41, the ROM 42 and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to bus 44.
Various components in electronic device 40 are connected to I/O interface 45, including: an input unit 46 such as a keyboard, a mouse, etc.; an output unit 47 such as various types of displays, speakers, and the like; a storage unit 48 such as a magnetic disk, an optical disk, or the like; and a communication unit 49 such as a network card, modem, wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 41 may be various general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, a graphics processing unit (CPU), a graphics processing unit (AI) processor, a graphics processing unit (AI processor, a Graphics Processing Unit (GPU), a graphics processing unit (AI processor, a Graphics Processing Unit (GPU), various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processors, controllers, microcontrollers, etc. The processor 41 performs the respective methods and processes described above, such as the wrinkle depth index determination method.
In some embodiments, the wrinkle depth index determination method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 40 via the ROM 42 and/or the communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the wrinkle depth index determination method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the wrinkle depth index determination method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A wrinkle depth index determination method, comprising:
Acquiring an image to be processed, and performing wrinkle detection on the image to be processed to determine wrinkles;
Calculating the area and the eccentricity of the wrinkles, filtering the wrinkles based on the area and the eccentricity of the wrinkles, and determining target wrinkles, wherein the eccentricity is determined according to the width and the height of the wrinkles;
Determining at least one cross section of each target wrinkle, for each cross section of the target wrinkle, extracting pixel values of pixel points of the cross section, determining first-order derivatives of the pixel points based on the pixel values, calculating height differences of the cross section according to the first-order derivatives of the pixel points, determining wrinkle depth indexes corresponding to the cross section based on the height differences, and determining wrinkle depth indexes of the target wrinkles based on the wrinkle depth indexes of the cross section;
calculating the eccentricity of the wrinkles, comprising:
calculating the square of the width of the wrinkle to obtain a first square, and calculating the square of the height of the wrinkle to obtain a second square;
open squaring the sum of the first square and the second square to determine an arithmetic square root;
Determining the ratio of the arithmetic square root to the width of the wrinkles as eccentricity;
the calculating the height difference of the cross section according to the first derivative of each pixel point comprises the following steps:
comparing the first derivatives of the pixel points, and selecting the pixel point with the minimum absolute value of the first derivatives as a candidate pixel point according to the preset quantity;
Dividing the candidate pixel points into a first pixel point set and a second pixel point set;
Calculating a first pixel value according to the pixel value of a first candidate pixel point in the first pixel point set, and calculating a second pixel value according to the pixel value of a second candidate pixel point in the second pixel point set;
determining a difference between the first pixel value and the second pixel value as a height difference;
the determining the wrinkle depth index corresponding to the cross section based on the height difference comprises the following steps:
Calculating the ratio of the height difference to the wrinkle depth parameter;
the product of the ratio and the set coefficient is determined as the wrinkle depth index of the cross section.
2. The method according to claim 1, wherein the image to be processed is acquired by an image acquisition device, and a polarizer is arranged in front of a camera of the image acquisition device.
3. The method according to claim 1, wherein said performing wrinkle detection on the image to be processed to determine wrinkles comprises:
Extracting data of a red channel of the image to be processed to form a candidate image;
denoising the candidate image, and detecting wrinkles on the denoised candidate image to obtain the wrinkles.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
Calculating the area of the wrinkles, comprising:
The number of pixel points included in the wrinkles is determined, and the number of pixel points is determined as the area of the wrinkles.
5. The method of claim 1, wherein said determining a first derivative of said pixel point based on each of said pixel values comprises:
For each pixel point, if the pixel point has the previous pixel point and the next pixel point, calculating the difference value of the pixel value of the previous pixel point and the pixel value of the next pixel point of the pixel point, and taking half of the difference value as the first derivative of the pixel point.
6. The method of claim 1, wherein the preset number is three;
the first pixel point set comprises a first candidate pixel point, the second pixel point set comprises two second candidate pixel points, the first candidate pixel point is larger than one second candidate pixel point, and the first candidate pixel point is smaller than the other second candidate pixel point;
The calculating a first pixel value according to the pixel value of the first candidate pixel point in the first pixel point set includes:
determining the pixel value of the first candidate pixel point as a first pixel value;
The calculating a second pixel value according to the pixel value of the second candidate pixel point in the first pixel point set includes:
and determining an average value of the pixel values of the second candidate pixel points as a second pixel value.
7. A wrinkle depth index determination device, comprising:
The image acquisition module is used for acquiring an image to be processed, and detecting wrinkles on the image to be processed to determine the wrinkles;
A target wrinkle determination module for calculating an area and an eccentricity of the wrinkle, filtering the wrinkle based on the area and the eccentricity of the wrinkle, and determining a target wrinkle, wherein the eccentricity is determined according to a width and a height of the wrinkle;
A wrinkle depth index determination module, configured to determine, for each target wrinkle, at least one cross section of the target wrinkle, extract, for each cross section of the target wrinkle, pixel values of pixels of the cross section, determine first derivatives of the pixels based on the pixel values, calculate a height difference of the cross section according to the first derivatives of the pixels, determine a wrinkle depth index corresponding to the cross section based on the height difference, and determine a wrinkle depth index of the target wrinkle based on the wrinkle depth index of the cross section;
The target wrinkle determination module is specifically configured to: calculating the square of the width of the wrinkle to obtain a first square, and calculating the square of the height of the wrinkle to obtain a second square; open squaring the sum of the first square and the second square to determine an arithmetic square root; determining the ratio of the arithmetic square root to the width of the wrinkles as eccentricity;
the wrinkle depth index determination module comprises:
The height difference calculation unit is used for comparing the first derivatives of the pixel points, and selecting the pixel point with the minimum absolute value of the first derivatives as a candidate pixel point according to the preset quantity; dividing the candidate pixel points into a first pixel point set and a second pixel point set; calculating a first pixel value according to the pixel value of a first candidate pixel point in the first pixel point set, and calculating a second pixel value according to the pixel value of a second candidate pixel point in the second pixel point set; determining a difference between the first pixel value and the second pixel value as a height difference;
the wrinkle depth index determination module comprises:
An index calculation unit for calculating a ratio of the height difference to the wrinkle depth parameter; the product of the ratio and the set coefficient is determined as the wrinkle depth index of the cross section.
8. An electronic device, the electronic device comprising:
at least one processor, and a memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the wrinkle depth index determination method according to any one of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the wrinkle depth index determination method according to any one of claims 1-6 when executed.
CN202410044803.0A 2024-01-12 Wrinkle depth index determination method and device, electronic equipment and storage medium Active CN117593780B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410044803.0A CN117593780B (en) 2024-01-12 Wrinkle depth index determination method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410044803.0A CN117593780B (en) 2024-01-12 Wrinkle depth index determination method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117593780A CN117593780A (en) 2024-02-23
CN117593780B true CN117593780B (en) 2024-05-17

Family

ID=

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2962553A1 (en) * 2016-04-14 2017-10-14 The Boeing Company Ultrasonic inspection of wrinkles in composite objects
CN114187347A (en) * 2021-12-03 2022-03-15 林丹柯 Skin wrinkle non-contact measurement method, storage medium and processor
CN116778559A (en) * 2023-07-03 2023-09-19 云南贝泰妮生物科技集团股份有限公司 Face wrinkle three-dimensional evaluation method and system based on Gaussian process and random transformation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2962553A1 (en) * 2016-04-14 2017-10-14 The Boeing Company Ultrasonic inspection of wrinkles in composite objects
CN114187347A (en) * 2021-12-03 2022-03-15 林丹柯 Skin wrinkle non-contact measurement method, storage medium and processor
CN116778559A (en) * 2023-07-03 2023-09-19 云南贝泰妮生物科技集团股份有限公司 Face wrinkle three-dimensional evaluation method and system based on Gaussian process and random transformation

Similar Documents

Publication Publication Date Title
Juneja et al. Performance evaluation of edge detection techniques for images in spatial domain
JP6336117B2 (en) Building height calculation method, apparatus and storage medium
WO2020232910A1 (en) Target counting method and apparatus based on image processing, device, and storage medium
CN113392681A (en) Human body falling detection method and device and terminal equipment
CN111444555B (en) Temperature measurement information display method and device and terminal equipment
CN114119466A (en) Method, device and equipment for detecting surface defects of aluminum foil and computer storage medium
CN114298985B (en) Defect detection method, device, equipment and storage medium
CN117392733B (en) Acne grading detection method and device, electronic equipment and storage medium
CN116559177A (en) Defect detection method, device, equipment and storage medium
CN113569708A (en) Living body recognition method, living body recognition device, electronic apparatus, and storage medium
CN116703925B (en) Bearing defect detection method and device, electronic equipment and storage medium
CN117593780B (en) Wrinkle depth index determination method and device, electronic equipment and storage medium
CN117593780A (en) Wrinkle depth index determination method and device, electronic equipment and storage medium
CN115205163A (en) Method, device and equipment for processing identification image and storage medium
CN112991308A (en) Image quality determination method and device, electronic equipment and medium
CN113674180A (en) Frosted plane low-contrast defect detection method, device, equipment and storage medium
CN112329572B (en) Rapid static living body detection method and device based on frame and flash point
CN114092739B (en) Image processing method, apparatus, device, storage medium, and program product
CN115187918B (en) Method and system for identifying moving object in monitoring video stream
CN114581890B (en) Method and device for determining lane line, electronic equipment and storage medium
CN114037865B (en) Image processing method, apparatus, device, storage medium, and program product
KR20130036511A (en) Method for validation of object boundaries and system of thereof, method for detection of object
CN112926676B (en) False target identification method and device and computer equipment
CN114994671B (en) Target detection method, device, equipment and medium based on radar image
CN116580296A (en) Road ponding area detection method, device, equipment and storage medium

Legal Events

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