Abnormal image detection method, device, computer equipment and storage medium
By acquiring equipment information and identifying personnel attributes, and judging abnormal images with shooting distance and position information, the problem of poor processing of abnormal face capture data in the prior art is solved, the accuracy and efficiency of abnormal image detection are improved, and the Invalid data redundancy.
Patent Information
- Application Number
- CN202111676573.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing technology is difficult to effectively identify and screen abnormal face capture data in different scenarios in the security industry, resulting in a large amount of invalid data redundancy and increasing storage pressure.
By acquiring the device information and face-shooting images of the acquisition device, the personnel attribute feature recognition is performed, the shooting distance between the shooting object and the device is calculated, and the position information is used to determine whether the image is abnormally photographed, which improves the accuracy of abnormal image detection.
It improves the detection efficiency and accuracy of abnormal images, effectively screens out invalid data, and reduces storage pressure.
Smart Images

Figure CN114387648B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an abnormal image detection method, device, computer equipment and storage medium. Background Art
[0002] In the security industry, capturing faces and intelligently analyzing the captured data can help stabilize public security. By installing camera equipment to collect face images, some of the capture equipment will capture face images on surrounding electronic advertising screens. These non-real face images are invalid data for security management operations, resulting in a large amount of redundant junk data and increased storage pressure.
[0003] In the prior art, whether the face capture data is abnormal is determined by calculating the ratio of the number of captured data of the same person to a preset threshold, thereby filtering out the abnormal face capture data.
[0004] However, this method has low applicability to different scenarios, cannot perform targeted recognition and filter out abnormal face capture data according to the shooting scene, and has poor processing effect on abnormal face capture data. Summary of the invention
[0005] The present invention provides an abnormal image detection method, device, computer equipment and storage medium to improve the accuracy of detecting abnormal photographed images.
[0006] An abnormal image detection method, comprising:
[0007] Acquire a face image captured by a capture device and device information of the capture device, wherein the device information includes location information and camera parameters;
[0008] Performing personnel attribute feature recognition on the photographed object contained in the photographed face image to obtain the personnel attributes of the photographed object;
[0009] Calculating the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object;
[0010] Whether the face image captured by the acquisition device is an abnormal image is determined based on the position information and the shooting distance.
[0011] An abnormal image detection device, comprising:
[0012] A captured image acquisition module, used to acquire a face captured image captured by a capture device and device information of the capture device, wherein the device information includes location information and camera parameters;
[0013] A feature recognition module is used to perform personal attribute feature recognition on the photographed object contained in the face photographed image to obtain the personal attributes of the photographed object;
[0014] A distance calculation module, used to calculate the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object;
[0015] The abnormality detection module is used to determine whether the face image taken by the acquisition device is an abnormal image through the position information and the shooting distance.
[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the abnormal image detection method when executing the computer program.
[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the abnormal image detection method are implemented.
[0018] The abnormal image detection method, device, computer equipment and storage medium provided by the present invention obtain the face shot image taken by the acquisition device and the equipment information of the acquisition device, the equipment information includes the camera parameters and position information of the acquisition device, and perform personal attribute feature recognition on the shooting object in the face shot image to obtain the personal attributes of the shooting object, and calculate the shooting distance between the shooting object and the acquisition device based on the personal attributes and the camera parameters in the equipment information of the acquisition device, and confirm whether the face shot image is an abnormal shot image according to the position information and the shooting distance of the acquisition device, thereby improving the efficiency and accuracy of detecting abnormal shot images and improving the effect of screening out invalid data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 is a schematic diagram of an application environment of an abnormal image detection method according to an embodiment of the present invention;
[0021] Figure 2 is a flow chart of an abnormal image detection method in one embodiment of the present invention;
[0022] Figure 3is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0023] Figure 4 is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0024] Figure 5 is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0025] Figure 6 is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0026] Figure 7 is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0027] Figure 8 is a flow chart of an abnormal image detection method in another embodiment of the present invention;
[0028] Fig. 9 is a schematic structural diagram of an abnormal image detection device in another embodiment of the present invention;
[0029] Fig.10 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The abnormal image detection method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In an application environment, a terminal device communicates with a server through a network. The terminal device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers.
[0032] The system framework 100 may include a terminal device, a network and a server. The network is used to provide a medium for a communication link between the terminal device and the server. The network may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0033] Users can use terminal devices to interact with the server through the network to receive or send messages, etc.
[0034] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Eperts Group Audio Layer III), MP4 (Moving Picture Eperts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0035] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0036] It should be noted that the abnormal image detection method provided in the embodiment of the present invention is executed by a server, and accordingly, the abnormal image detection device is arranged in the server.
[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only illustrative. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices in the embodiment of the present invention may specifically correspond to application systems in actual production.
[0038] In one embodiment, if Figure 2 As shown, a method for detecting abnormal images is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:
[0039] S10, obtaining a face image captured by a capture device and device information of the capture device, wherein the device information includes location information and camera parameters.
[0040] Among them, the acquisition device failed to effectively filter out invalid data in electronic advertisements and videos during shooting, resulting in a large amount of redundant junk data and increased memory pressure. Therefore, it is necessary to regularly process the images taken by the acquisition device.
[0041] For example, some acquisition devices installed in specific installation scenarios will capture advertisements on electronic advertising screens. There are usually actors in the advertisements, and the actors' faces will be used as facial images. These facial images of actors are abnormal data for application scenarios such as security management, causing storage pressure. The acquisition devices that capture electronic advertising screens can be cleared. Common scenes for electronic advertising screens include but are not limited to: elevator cars, shopping malls, supermarkets, office buildings, and public transportation. It is necessary to identify abnormal facial images and remove them to reduce storage pressure.
[0042] As an optional method, when the server receives an abnormal shot image detection request, it performs abnormality detection processing on the face shot image taken by the acquisition device.
[0043] Furthermore, the identification of the acquisition device that needs to perform abnormal image detection is obtained in advance, and the acquisition device identification is used to uniquely identify the corresponding acquisition device.
[0044] Among them, the acquisition equipment that needs to perform abnormal image detection can be selected according to a preset selection method. As an optional implementation method, it is selected according to the installation scenario of the acquisition equipment, or the acquisition equipment that needs to clear data according to reasonable server resource rules can be cleared in batches.
[0045] Furthermore, the acquisition device identification is obtained from the detection request of the abnormal captured image, wherein the acquisition device identification refers to a unique identification used to distinguish the acquisition device, specifically distinguishing the installation location, model, etc. of the acquisition device, and its composition can be a symbol formed by one or more combinations of letters, numbers, and words.
[0046] Determine the corresponding acquisition device according to the acquisition device identifier, and obtain the facial image taken by the acquisition device and the corresponding device information. The device information refers to the location information and camera parameters of the acquisition device. The location information refers to the installation location of the acquisition device, such as the installation location on a certain street, etc. The camera parameters refer to the imaging characteristics of the acquisition device, including focal length, size, resolution, target surface size, etc.
[0047] In this embodiment, the acquisition device captures a plurality of face images including a plurality of photographed objects.
[0048] S20, performing personal attribute feature recognition on the photographed object included in the facial image to obtain the personal attributes of the photographed object.
[0049] Specifically, the person attribute feature recognition refers to face recognition technology, which is used to identify the subject in the face image, identify the same subject, and obtain the subject information in the face image. The subject information includes the ID of each subject and the number of face images of each subject.
[0050] It can be understood that the personal attribute recognition is performed on the single facial image of each photographed object to obtain the personal attribute of the photographed object. Specifically, the acquisition device takes multiple facial images for each photographed object, firstly performs object recognition on the photographed object, determines the facial image set belonging to the photographed object, selects the facial image that can capture the full face of the photographed object from the facial image set, and performs personal attribute feature recognition on the facial image to obtain the personal attribute of the photographed object.
[0051] Furthermore, when the acquisition device photographs the subject, multiple facial images are captured.
[0052] Furthermore, the ID of the photographed object refers to a symbol used to distinguish the photographed object in the face photographed image, which may specifically be a digital number, etc., and is not specifically limited here.
[0053] Furthermore, personal attribute feature recognition is performed on the same photographed subject to obtain the personal attributes of the photographed subject, wherein the personal attributes are used to characterize the personal characteristics of each photographed subject, and the gender characteristics and age characteristics of each photographed subject are obtained.
[0054] Furthermore, face recognition technology (FaceRecognition) refers to a technology that can identify or verify the subject in the initial face shot image. Among them, face recognition algorithms include principal component analysis, deep learning methods based on convolutional neural networks, etc.
[0055] The deep learning method is specifically to build a neural network and train it with a large amount of face data to learn the face representation of the training data.
[0056] Among them, according to the shooting object identification in the shooting object information, the facial image of the same shooting object is subjected to personal attribute feature recognition to obtain the age feature and gender feature of the shooting object, and the age feature and gender feature are used as the personal attributes of the captured object.
[0057] Specifically, personnel attribute feature recognition refers to performing face recognition on a face to obtain a face feature value, and then outputting the age feature and age feature of the captured object through a gender classifier and an age classifier.
[0058] As a way to implement it, a convolutional neural network is used to learn from massive amounts of face images and abstract the facial features of the face as a basis for judging age and gender.
[0059] Gender classification is a complex large-scale quadratic pattern classification problem. The classifier divides males and females by input facial features. Existing gender recognition methods mainly include gender recognition algorithms based on feature quantities, gender recognition methods based on the Fisher criterion, and face gender classification algorithms based on Adaboost+SVM (iterative algorithm + support vector machine).
[0060] Human age characteristics are usually reflected in skin texture, skin color, brightness and wrinkle texture. Estimating the age of a face requires analyzing a large number of face samples. Identifying the age characteristics of captured objects is generally divided into several parts, such as face detection pre-positioning, age feature extraction, age estimation, and system performance evaluation. According to the different feature extraction methods, it can be divided into traditional methods and deep learning methods.
[0061] S30, calculating the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object.
[0062] Specifically, based on the camera parameters of each acquisition device and the personal attributes of the captured object, the distance between the captured object and the acquisition device in the face capture data set to be processed can be calculated to obtain distance data. The distance data is used to reflect the spatial distance between the captured object and the acquisition device, and the calculated spatial distance is compared with the actual spatial conditions of the installation location of the acquisition device.
[0063] Specifically, target surface width: distance = width pixels: actual width. Based on this proportional relationship, the distance between the captured object and the acquisition device can be calculated.
[0064] Among them, target surface width: target surface size = width pixels: captured image size, target surface size is the size of the CCD (Charge-coupled Device) in the camera, also known as the size of the image sensor, that is, the size of the photosensitive part of the image sensor. Personnel attributes are used as the basis for calculating the size of the captured image.
[0065] The shooting distance refers to the distance between the subject and the acquisition device when the acquisition device is shooting the subject and obtaining a facial image. The shooting distance will vary depending on the installation location of the acquisition device and the action and position of the subject during the shooting action.
[0066] S40, determining whether the face image captured by the acquisition device is an abnormal image based on the position information and the shooting distance.
[0067] Specifically, the installation location of the acquisition device is determined through the location information in the device information, thereby determining the size of the scene space of the surrounding environment of the acquisition device. After the shooting distance is obtained, the scene space is used to determine whether the shooting distance of the photographed object is consistent with the scene. For example, the calculated shooting distance is 3.8m, and the corresponding installation location of the acquisition device is a street, then the shooting distance is consistent with the scene. If the installation location of the acquisition device is an elevator, then the shooting distance is inconsistent with the scene, and it is determined that the facial image of the photographed object is an abnormal image.
[0068] It can be understood that the maximum value of the shooting distance should not exceed the limitation of the space where the acquisition device is located. That is, if the acquisition device is installed in a relatively small space, the shooting distance data obtained should correspond to the small space. According to the relationship between the shooting distance and the shooting scene, it can be confirmed whether the face shooting data is abnormal shooting data.
[0069] As an optional implementation method, by judging the change of the shooting distance of the same shooting object, it is judged whether the movement trajectory of the shooting object conforms to the shooting scene of the acquisition device.
[0070] Specifically, the time axis of each face image is used to calculate the shooting distance of the subject in each face image, and whether the face image is an abnormal image is determined based on the change of the shooting distance and the movement trajectory of the subject.
[0071] The abnormal image detection method provided by the embodiment of the present invention obtains the face shot image taken by the acquisition device and the device information of the acquisition device, thereby determining the camera parameters and position information of the acquisition device, and obtains the person attributes of the shot object by performing personal attribute feature recognition on the shot object in the face shot image, and calculates the shooting distance between the shot object and the acquisition device based on the camera parameters of the acquisition device and the person attributes of the shot object, and detects abnormal shooting data of the face shot image according to the corresponding relationship between the position information of the acquisition device and the shooting distance, and performs detection according to the shooting distance, and has good abnormal judgment results for acquisition devices installed in different locations, and further improves the accuracy of detecting abnormal shooting data.
[0072] In this embodiment, as an optional implementation, Figure 3 As shown, in step S10, the face image captured by the acquisition device and the device information of the acquisition device are obtained, wherein the device information includes location information and camera parameters, including:
[0073] S101, obtaining a collection device identification, and determining a collection device having a corresponding relationship with the collection device according to the collection device identification.
[0074] S102, obtaining a facial image captured by a collection device that has a corresponding relationship with the collection device and device information of the collection device.
[0075] Among them, the collection equipment identification refers to the symbol used to distinguish the collection equipment, that is, to distinguish the model, brand and installation location of the collection equipment, etc., and is specifically a symbol formed by one or more combinations of numbers, letters, words, etc.
[0076] There is a one-to-one correspondence between the acquisition device identifier and the acquisition device. The corresponding acquisition device is determined according to the acquisition device identifier, and the facial image captured by the acquisition device is obtained.
[0077] As an optional implementation manner, each acquisition device takes the facial images of TOPN photographed subjects to form an initial facial image.
[0078] First, after obtaining the initial face image taken by the acquisition device, determine the installation location of the acquisition device according to its location information, and set different screening thresholds according to the installation location to filter the initial face image to obtain the face image. The screening threshold can be set according to actual needs.
[0079] Furthermore, each acquisition device takes the facial images of the TOPN subjects to form an initial facial image.
[0080] In this embodiment, face recognition is performed on the initial face images to determine the number of face images of the same subject, which are sorted in descending order, and face images of the subject with a TOPN number are selected as face images.
[0081] Among them, N can be set according to the flow of people at the installation location of the collection equipment. For example, it can be set to 50 in a shopping mall or a large office building, and it can be set to 20 in a small office building or a community.
[0082] Furthermore, when obtaining the initial facial capture image of each acquisition device, all human capture images of the acquisition device within a preset time interval can be obtained as the initial facial capture image. When the acquisition device has performed a processing operation to clear the capture data, it is considered that the abnormal capture images in the facial capture images of the acquisition device before this processing period have been cleared, and it is meaningless to obtain the facial capture images before that, and it occupies the processing process of the server, resulting in a waste of resources.
[0083] In this embodiment, through the correspondence between the acquisition device identifier and the acquisition device, the acquisition device that needs to perform abnormal image detection is quickly determined, and the number of facial images that need to be obtained subsequently is reduced, which is beneficial to improving the processing efficiency of the server. In addition, by performing targeted preliminary screening of facial images, under normal circumstances, if the acquisition device will capture the screen of the electronic advertising screen to form facial images, according to the frequency of advertising, the number of faces collected by the acquisition device on the electronic advertising screen will be very large. Preliminary screening is performed based on the number of facial images, which effectively reduces the number of facial images and improves the processing efficiency of the server. At the same time, abnormal images can be more effectively located to ensure the accuracy of screening out abnormal images.
[0084] In this embodiment, as an optional implementation, Figure 4 As shown, in step S20, if the number of facial images captured by the acquisition device is multiple, and the facial images contain multiple photographed subjects, personal attribute feature recognition is performed on the photographed subjects contained in the facial images to obtain personal attributes of the photographed subjects, including:
[0085] S201, performing object recognition on a plurality of facial images to determine a plurality of photographed objects included in the plurality of facial images.
[0086] S202: for each photographed object, determine the number of photographed images containing the face of the photographed object.
[0087] Specifically, object recognition refers to detecting the same subject in a face shot image.
[0088] Furthermore, the number of identical photographed subjects in the facial photographed images is identified, each photographed subject is distinguished according to the photographed subject identifier, and the number of facial photographed images of each photographed subject is determined respectively.
[0089] S203, sorting the number of face images containing the photographed object in descending order of the number of face images to obtain a sorting result.
[0090] S204, comparing the difference in the number of two adjacent human face images in the sorting results, and if the difference is greater than a preset threshold, selecting the subject with the larger number of human face images as the target subject.
[0091] Specifically, in S203-S204, the images are sorted according to the number of face images of the same subject according to the subject identification, and secondary screening is performed according to the difference in the number of face images of two subjects.
[0092] For example, the sorting result is A, B, C, D, E, where A, B, C, D, and E are different photographed objects. The difference in the number of face images of two adjacent photographed objects is compared. If the difference exceeds a preset threshold, the face images of the photographed object with a smaller number are cleared, and the photographed object with a larger number of face images is selected as the target object. For example, if the difference in the number of images of D and E exceeds the threshold, the face image of E is cleared, and D is selected as the target object.
[0093] Specifically, the preset threshold may be set to 100. If the difference in the number of face images of D and E exceeds 100, the face image of E is removed, and the remaining A, B, C, and D are taken as target objects.
[0094] Specifically, after object recognition is performed on the photographed object in the face photographed image to obtain the photographed object information, the photographed object identification and the number of face photographed images are sorted to form a number set of face photographed images, for example, A = {A1, A2,,,A n}, where A1={P1,P m} is the face image of the first subject, then there are m face images in A1.
[0095] Taking the same photographed object as a unit, the number of face photographed images is sorted from high to low to obtain a sorting result.
[0096] As a preferred implementation method, in the sorting results, the number of facial images of two adjacent subjects is subtracted. If the difference exceeds a preset threshold, the facial images of all subjects after the subject with the larger number are excluded to obtain the facial image of the target object.
[0097] S205, performing personal attribute feature recognition on the facial image containing the target object to obtain the personal attributes of the target object.
[0098] Specifically, personnel attribute feature recognition refers to performing facial recognition on a captured face image of a target object through face recognition technology to obtain the personnel attributes of the target object.
[0099] As a preferred implementation method, the database interface with the relevant department is used to obtain the personnel information of the target object, thereby obtaining more accurate personnel attributes.
[0100] In this embodiment, by comparing the difference in the number of facial images of each photographed object, the facial images are screened twice, the range of abnormal images is accurately narrowed and locked, the efficiency of identifying abnormal images is improved, and the effect of screening abnormal images can be guaranteed.
[0101] In this embodiment, as a preferred implementation, Figure 5 As shown, in step S205, the face image containing the target object is subjected to personal attribute feature recognition to obtain the personal attributes of the target object, including:
[0102] S21, performing image quality assessment on the face images containing the target object to obtain an image clarity score for each face image containing the target object.
[0103] S22, selecting the facial image with the highest image clarity score to perform personnel attribute feature recognition to obtain the personnel attributes of the target object.
[0104] Specifically, image quality assessment refers to image quality evaluation (IQA) of face images. IQA is one of the basic technologies in image processing. It mainly analyzes the characteristics of the image, evaluates the quality of the image, and obtains the image clarity score (degree of image distortion).
[0105] Among them, the image scoring rules can be set according to actual needs, and the image quality of the face-captured image can be evaluated according to the image scoring rules to obtain the image clarity score. The image scoring rules can include multiple scoring dimensions, including but not limited to: image clarity dimension, resolution dimension, etc. The face-captured image is scored from each scoring dimension to obtain the image clarity score of the face-captured image.
[0106] The image clarity score is used as an indicator to evaluate the quality of the face-captured image, that is, the higher the image clarity score, the better the quality of the face-captured image.
[0107] Furthermore, when the same photographed subject has multiple facial images, image quality evaluation is performed on the multiple facial images of the photographed subject, and a facial image with the highest image quality is selected.
[0108] Specifically, a facial image with the highest image clarity score is selected, and personal attribute feature recognition is performed on the facial image to obtain personal attributes of the photographed subject. Specifically, the personal attributes refer to the age attribute and gender attribute of the photographed subject.
[0109] In this embodiment, by evaluating image quality, the face image with the best image quality is selected for facial features, which can effectively improve the accuracy of identifying the personal attributes of the photographed object, and further improve the accuracy of the shooting distance subsequently calculated based on the personal attributes.
[0110] In this embodiment, as an optional implementation, Figure 6As shown, in step S30, based on the camera parameters and the personal attributes of the photographed object, the shooting distance between the photographed object and the acquisition device is calculated, including:
[0111] S301, calculating biparietal diameter data of the photographed object according to age attribute and gender attribute.
[0112] S302, obtaining the target surface width in the imaging parameters, and calculating the shooting distance between the shooting object and the acquisition device according to the target surface width and the biparietal diameter data.
[0113] The biparietal diameter data is a measure of the length of the widest part between the left and right sides of the fetal head. In this embodiment, the biparietal diameter data refers to the length of the widest part between the left and right sides of the photographed object. The biparietal diameter data varies according to the age characteristics and gender characteristics of the photographed object.
[0114] The shooting distance refers to the straight-line distance between the acquisition device and the subject when the acquisition device takes a picture of the subject and obtains the face image of the subject. The shooting distance varies depending on the installation location of the acquisition device and the location of the subject when shooting.
[0115] According to statistics, the head circumference of infants (0-3 years old) is about 34cm-46cm, the head circumference of minors (3-16 years old) is about 46cm-55cm, the head circumference of adult males (16 years old+) is about 55cm-62cm, and the head circumference of adult females (16 years old+) is about 55cm-60cm. The medians are: 40cm for infants, 50cm for minors, 58cm for adult males, and 57cm for adult females. The biparietal diameter data can be calculated as: 12.74cm for infants, 15.92cm for minors, 18.47cm for adult males, and 18.15cm for adult females.
[0116] From the above content, it can be seen that the head circumference of the subject can be determined based on the age and gender characteristics of the subject, and then the biparietal diameter data can be calculated based on the mapping relationship between the head circumference and the biparietal diameter data.
[0117] Specifically, the mapping relationship between the target width and the shooting distance can be expressed by formula (1):
[0118]
[0119] Where X is the target width, Y is the shooting distance, M is the width in pixels, N is the actual width, H is the target height, and L is the actual height. In this embodiment, the acquisition device only collects data on the face, so the height is not used temporarily. The mapping relationship between the target width and the shooting distance can be expressed by formula (2):
[0120]
[0121] The mapping formula between target surface width and target surface size is expressed according to formula (3):
[0122] X:B=Q:S (3)
[0123] Among them, B is the target surface size, Q is the pixel width, and S is the face capture image size, that is, target surface width: target surface size = pixel width: face capture image size.
[0124] Specifically, the width (height) size of the face shot image = pixel width (height) / resolution, the face shot image size = portrait shot image width size * face shot image height size, because the pixel point is a square, the pixel width is equal to the pixel height.
[0125] For example, the subject is an adult male, the pixel width of the face image is 86px, the resolution is 96dpi, the target surface size is 1 inch (16mm), the actual width of the subject's face is 18.47cm, and the face image size is 2560*1440 pixels. It can be obtained that the actual width of the face image is 2560 / 96≈26.67 inches, and the actual height of the face image is 1440 / 96≈15 inches. The face image size = width*height=26.67*15=400.05 inches=2580.96 square centimeters, the number of pixels = 2560*1440=3686400px, then the size of one pixel = face image size / number of pixels≈0.07 square millimeters, and the pixel width is approximately 0.26mm after taking the square root.
[0126] According to the width and height of the face image size, the diagonal of the face image is calculated to be 30.6 inches, which is approximately equal to 777.24 mm. According to formula (3), the target surface width is calculated to be 0.46 mm.
[0127] Substituting the above data into formula (1), the calculated distance is 3.8m, and the distance data is 3.8m.
[0128] In this embodiment, the biparietal diameter data of the photographed object is calculated through the gender attribute and the age attribute in the personnel attributes. The shooting distance between the photographed object and the acquisition device is solved according to the functional relationship between the biparietal diameter data and the width of the face shot image, the camera parameters and the shooting distance. The result is not much different from the actual distance. The shooting distance, as a decisive factor in detecting abnormal shot images, can improve the accuracy of detecting abnormal shot images.
[0129] In this embodiment, as an optional implementation, Figure 7As shown, in step S40, determining whether the face image captured by the acquisition device is an abnormal image through the position information and the shooting distance includes:
[0130] S401, based on the position information of the acquisition device, determine the spatial information of the shooting scene of the acquisition device, and based on the spatial information, judge the shooting distance to obtain a judgment result.
[0131] S402: Based on the judgment result, determine whether the face image captured by the acquisition device is an abnormal image.
[0132] Specifically, based on the location information of the collection device, the installation location of the collection device is obtained, and the size of the space around the collection device is obtained. The size of the space corresponding to the collection device installed on a street is different from that of the collection device installed on an elevator car. It is determined whether the shooting distance between the subject and the collection device is consistent with the space where the collection device is located, so as to determine whether the facial image of the subject is abnormal.
[0133] Specifically, for example, if the distance between a certain photographed object and the acquisition device is 3.8m, if the installation location of the acquisition device is a certain street, and the size of the photographed object and the installation location are consistent, then the photographed object is not an abnormal photographed object, and the face image of the photographed object is not an abnormal photographed image. If the installation location of the acquisition device is an elevator car, and the size of the photographed object and the installation location are inconsistent, then it is determined that the photographed object is an abnormal photographed object, and the face image of the photographed object is an abnormal photographed image.
[0134] In this embodiment, the abnormal shooting object refers to a person who cannot move freely, such as an actor in an electronic advertisement.
[0135] In this embodiment, by judging whether the space of the photographed object is consistent with the real scene, it is concluded whether the photographed object and its facial image are abnormal, which has good recognition results for acquisition devices installed on different devices, thereby improving the accuracy of identifying abnormal photographed images, and further improving the accuracy of detecting abnormal photographed images.
[0136] Further, as an optional implementation, in step S402, based on the judgment result, determining whether the face image captured by the acquisition device is an abnormal image includes:
[0137] S41, obtaining other facial images taken by the acquisition device as verification images.
[0138] S42, calculating the distance between the verification captured image and the acquisition device as the verification distance.
[0139] S43, based on the verification distance and the shooting distance, determining whether the face image shot by the acquisition device is an abnormal image.
[0140] In this embodiment, when identifying a certain acquisition device, after obtaining the photographed object of a certain photographed object, facial images of other photographed objects acquired by the same acquisition device are obtained, and the facial images of other photographed objects are used as verification photographed images. The distance of the other photographed objects is calculated as the verification distance, and it is determined whether the difference between the shooting distance and the verification distance meets the preset difference range, and the abnormal photographed images are determined according to the difference.
[0141] The corresponding error can be set according to different scenarios. For example, in a 5-meter space, the error is ±0.2 meters; in a 10-meter space, the error is 0.5 meters.
[0142] Specifically, the preset difference range is determined according to the space size of the installation location of the collection device. If the collection device is installed on a certain street, the preset difference range can be set to the installation distance of the collection device on the street, etc.
[0143] In this embodiment, based on the control variable method, by comparing the photographed objects of different photographing objects of the same acquisition device, the abnormal photographed objects and abnormal photographed images in the acquisition device are judged, thereby further ensuring the accuracy of identifying abnormal photographed images and improving the accuracy of detecting abnormal photographed images.
[0144] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0145] In one embodiment, an abnormal image detection device is provided, and the abnormal image detection device corresponds one-to-one to the abnormal image detection method in the above embodiment. Fig. 9 As shown, the abnormal image detection device includes a captured image acquisition module 91, a feature recognition module 92, a distance calculation module 93, and an abnormality detection module 94. The functional modules are described in detail as follows:
[0146] The captured image acquisition module 91 is used to acquire the face captured image captured by the acquisition device and the device information of the acquisition device, wherein the device information includes location information and camera parameters.
[0147] The feature recognition module 92 is used to perform personal attribute feature recognition on the photographed object contained in the facial image to obtain the personal attributes of the photographed object.
[0148] The distance calculation module 93 is used to calculate the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object.
[0149] The abnormality detection module 94 is used to determine whether the face image captured by the acquisition device is an abnormal image through the position information and the shooting distance.
[0150] Furthermore, the captured image acquisition module 91 includes:
[0151] Obtain a collection device identification, and determine a collection device that has a corresponding relationship with the collection device according to the collection device identification.
[0152] Acquire a facial image captured by a collection device that has a corresponding relationship with the collection device and device information of the collection device.
[0153] Furthermore, the feature recognition module 92 includes:
[0154] The object recognition unit is used to perform object recognition on a plurality of facial images and determine a plurality of photographed objects contained in the plurality of facial images.
[0155] The quantity determination unit is used to determine the number of facial images containing each photographed object.
[0156] The sorting unit is used to sort the number of face images containing the photographed object in descending order of the number of face images to obtain a sorting result.
[0157] The target object determination unit is used to compare the difference in the number of two adjacent human face images in the sorting results, and if the difference is greater than a preset threshold, select the object with the larger number of human face images as the target object.
[0158] The feature recognition unit is used to perform personal attribute feature recognition on the face image containing the target object to obtain the personal attributes of the target object.
[0159] Furthermore, the feature recognition unit includes:
[0160] The quality assessment subunit is used to perform image quality assessment on the face images containing the target object, and obtain an image clarity score for each face image containing the target object.
[0161] The personnel attribute recognition subunit is used to select the face shot image with the highest image clarity score to perform personnel attribute feature recognition to obtain the personnel attributes of the target object.
[0162] Furthermore, the distance calculation module 93 includes:
[0163] The biparietal diameter calculation unit is used to calculate the biparietal diameter data of the photographed object according to the age attribute and the gender attribute.
[0164] The distance calculation unit is used to obtain the target surface width in the imaging parameters, and calculate the shooting distance between the shooting object and the acquisition device according to the target surface width and the biparietal diameter data.
[0165] Furthermore, the anomaly detection module 94 includes:
[0166] The judgment unit is used to determine the spatial information of the shooting scene of the acquisition device based on the position information of the acquisition device, and to judge the shooting distance based on the spatial information to obtain a judgment result.
[0167] The abnormality detection unit is used to determine whether the face image taken by the acquisition device is an abnormal image based on the judgment result.
[0168] Furthermore, the anomaly detection unit includes:
[0169] The verification image acquisition subunit is used to acquire other face images taken by the acquisition device as verification images.
[0170] The verification distance calculation subunit is used to calculate the distance between the verification captured image and the acquisition device as the verification distance.
[0171] The abnormality detection subunit is used to determine whether the face image taken by the acquisition device is an abnormal image based on the verification distance and the shooting distance.
[0172] The meaning of "first" and "second" in the above modules / units is only to distinguish different modules / units, and is not used to define which module / unit has a higher priority or other limiting meanings. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The division of modules in this application is only a logical division, and there may be other division methods when implemented in actual applications.
[0173] For the specific definition of the abnormal image detection device, please refer to the definition of the abnormal image detection method above, which will not be repeated here. Each module in the above abnormal image detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0174] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 . The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the abnormal image detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an abnormal image detection method is implemented.
[0175] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the abnormal image detection method in the above embodiment are implemented, such as Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the abnormal image detection device in the above embodiment are realized, for example, Fig. 9 The functions of module 91 and module 94 are described in detail herein to avoid duplication.
[0176] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and various interfaces and lines are used to connect various parts of the entire computer device.
[0177] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, video data, etc.), etc.
[0178] The memory may be integrated into the processor or may be arranged separately from the processor.
[0179] In one embodiment, a computer-readable storage medium is provided on which a computer program is stored. When the computer program is executed by a processor, the steps of the abnormal image detection method in the above embodiment are implemented, such as Figure 2 Alternatively, when the computer program is executed by a processor, the functions of each module / unit of the abnormal image detection device in the above embodiment are realized, for example, Fig. 9 The functions of modules 91 and 94 are shown in FIG. 91 and 94 are not described here in detail to avoid repetition.
[0180] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0181] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0182] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for detecting abnormal images, characterized in that: include: Acquire a face image captured by a capture device and device information of the capture device, wherein the device information includes location information and camera parameters; Performing personnel attribute feature recognition on the photographed object contained in the photographed face image to obtain the personnel attributes of the photographed object; Calculating the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object; Determining whether the face image captured by the acquisition device is an abnormal image based on the position information and the shooting distance; The personnel attributes include an age attribute and a gender attribute; and the step of calculating the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personnel attributes of the shooting object includes: Calculating biparietal diameter data of the photographed subject according to the age attribute and the gender attribute, the biparietal diameter data including the length of the widest part between the left and right sides of the head of the photographed subject; The target surface width in the imaging parameters is obtained, and the shooting distance between the photographed object and the acquisition device is calculated according to the target surface width and the biparietal diameter data.
2. The abnormal image detection method according to claim 1, characterized in that: The acquiring of the face image captured by the acquisition device and the device information of the acquisition device, wherein the device information includes location information and camera parameters, comprises: Acquire a collection device identification, and determine a collection device having a corresponding relationship with the collection device according to the collection device identification; Acquire a facial image captured by a capture device that has a corresponding relationship with the capture device and device information of the capture device.
3. The abnormal image detection method according to claim 1, characterized in that: If there are multiple facial images captured by the acquisition device, and there are multiple photographed subjects contained in the facial images, the person attribute feature recognition of the photographed subjects contained in the facial images to obtain the person attributes of the photographed subjects includes: Performing object recognition on the plurality of facial images to determine a plurality of photographed objects contained in the plurality of facial images; For each of the photographed objects, respectively determine the number of facial images containing the photographed object; Sorting the number of face images containing the photographed object in descending order of the number of face images to obtain a sorting result; Comparing the difference in the number of two adjacent human face images in the sorting results, if the difference is greater than a preset threshold, selecting the subject with the larger number of human face images as the target subject; Person attribute feature recognition is performed on the face image containing the target object to obtain the person attributes of the target object.
4. The abnormal image detection method according to claim 3, characterized in that: The step of performing personnel attribute feature recognition on the face image containing the target object to obtain the personnel attributes of the target object includes: Performing image quality assessment on the face images containing the target object to obtain an image clarity score for each face image containing the target object; The facial image with the highest image clarity score is selected for personnel attribute feature recognition to obtain the personnel attributes of the target object.
5. The abnormal image detection method according to claim 1, characterized in that: The determining whether the face image captured by the acquisition device is an abnormal image by using the position information and the shooting distance includes: Based on the position information of the acquisition device, determine the spatial information of the shooting scene of the acquisition device, and based on the spatial information, judge the shooting distance to obtain a judgment result; Based on the judgment result, it is determined whether the face image captured by the acquisition device is an abnormal image.
6. The abnormal image detection method according to claim 5, characterized in that: The determining, based on the judgment result, whether the face image captured by the acquisition device is an abnormal image comprises: Acquire other facial images taken by the acquisition device as verification images; Calculating the distance between the verification shot image and the acquisition device as the verification distance; Based on the verification distance and the shooting distance, it is determined whether the face shot image shot by the acquisition device is an abnormal shot image.
7. An abnormal image detection device, characterized in that: include: A captured image acquisition module, used to acquire a face captured image captured by a capture device and device information of the capture device, wherein the device information includes location information and camera parameters; A feature recognition module is used to perform personal attribute feature recognition on the photographed object contained in the face photographed image to obtain the personal attributes of the photographed object; A distance calculation module, used to calculate the shooting distance between the shooting object and the acquisition device based on the shooting parameters and the personal attributes of the shooting object; an abnormality detection module, used to determine whether the face image captured by the acquisition device is an abnormal image based on the position information and the shooting distance; Wherein, the personnel attributes include age attribute and gender attribute; the distance calculation module is used for: Calculating biparietal diameter data of the photographed subject according to the age attribute and the gender attribute, the biparietal diameter data including the length of the widest part between the left and right sides of the head of the photographed subject; The target surface width in the imaging parameters is obtained, and the shooting distance between the photographed object and the acquisition device is calculated according to the target surface width and the biparietal diameter data.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the abnormal image detection method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the abnormal image detection method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and device for obtaining of face depth information
CN108960097A
Large-scene face snapshot method
CN110059634A
