Image processing method and related device
By extracting unobstructed human feature data and processing the occlusion part, the image matching accuracy in pedestrian re-identification is improved, the problem that occlusion affects matching accuracy is solved, and the accuracy of the recognition results is improved.
Patent Information
- Application Number
- CN202011642494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In the prior art, the image matching accuracy caused by the occlusion during pedestrian re-identification is low, especially in urban security, where the occlusion interferes with the neural network features and affects the accuracy of image matching.
By extracting the detected image, feature data of the unobstructed human image is obtained, corresponding images are matched from the database, and the target image is obtained through processing, and the occlusion part is replaced to improve the accuracy of the matching image.
Improve the accuracy of image matching, ensure the accuracy of matching image acquisition and efficient identification results, especially in occluded image processing.
Smart Images

Figure CN113158732B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, and in particular to an image processing method and related devices. Background Art
[0002] As people's demand for safety increases, urban security is very important. Pedestrian re-identification aims to accurately find other pictures of a pedestrian from the image database given a picture of the pedestrian, so as to achieve the purpose of identifying the pedestrian. With the rise of deep learning and convolutional neural networks in recent years, the field of pedestrian re-identification has been booming, and has achieved remarkable results in conventional pedestrian retrieval. However, there are still some problems. One of them is that pedestrians in real scenes are easily blocked by obstacles. The presence of obstacles will interfere with the features finally proposed by the neural network, resulting in low accuracy when performing image matching. Summary of the invention
[0003] The embodiments of the present application provide an image processing method and related devices, which can improve the accuracy of image matching.
[0004] A first aspect of an embodiment of the present application provides an image processing method, the method comprising:
[0005] Perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image;
[0006] According to the a first sub-feature data, determining t first images from a first database, wherein the first images include feature data matching the a first sub-feature data;
[0007] Processing at least the t first images to obtain a target image corresponding to the image to be detected;
[0008] Matching is performed in a second database according to the target image to obtain a matching image corresponding to the target image.
[0009] In this example, by performing feature extraction on the image to be detected, a first sub-feature data are obtained, and the first sub-feature data are feature data of an unobstructed human body image. According to the a first sub-feature data, t first images are determined from a first database, and the first images include feature data matching the a first sub-feature data. At least the t first images are processed to obtain a target image corresponding to the image to be detected, and matching is performed in a second database according to the target image to obtain a matching image corresponding to the target image. Therefore, compared with the existing scheme, the accuracy of matching the obstructed image to be detected is not high. It is possible to obtain t first images through the feature data of the unobstructed human body image in the image to be detected, and obtain the target image corresponding to the image to be detected through the tth first image. The target image carries information of the unobstructed human body image in the image to be detected. Matching is performed according to the target image to obtain a matching image, which can improve the accuracy of obtaining the matching image.
[0010] In combination with the first aspect, in a possible implementation manner, determining t first images from a first database according to the a first sub-feature data includes:
[0011] Acquire K images corresponding to each of the a first feature data in the first database to obtain a first image sets;
[0012] Acquire t first images, where the first images are images existing in the a first image sets.
[0013] In this example, a first image sets corresponding to a first feature data are obtained from the first database, and t first images are obtained from the a first image sets. The first image is an image that exists in the a first image sets. Therefore, the accuracy of obtaining the t first images can be improved.
[0014] In combination with the first aspect, in a possible implementation manner, the processing at least according to the t first images to obtain a target image corresponding to the image to be detected includes:
[0015] Performing feature extraction on the t first images to obtain t reference feature data;
[0016] Determining target feature data according to the t reference feature data;
[0017] Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image;
[0018] Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data;
[0019] The image to be detected is processed according to the b third sub-feature data to obtain the target image.
[0020] In this example, the target image is obtained by processing the image to be detected with b third sub-feature data corresponding to the b second sub-feature data in the image to be detected. The b third sub-feature data are determined from the target feature data determined by t reference feature data, and can carry the information of t reference feature data, thereby improving the accuracy of determining the target image.
[0021] In combination with the first aspect, in a possible implementation manner, the processing the image to be detected according to the b third sub-feature data to obtain the target image includes:
[0022] Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected;
[0023] The image corresponding to the replaced feature data is determined as the target image.
[0024] In this example, the b second sub-feature data in the image to be detected are replaced with b third feature data, so that the feature data of the occluded human body image in the image to be detected can be replaced, so that the target image contains all unobstructed human body images, thereby improving the accuracy of subsequent image matching.
[0025] In combination with the first aspect, in a possible implementation manner, determining the target feature data according to the t reference feature data includes:
[0026] The mean value of the t reference feature data is determined as the target feature data.
[0027] In combination with the first aspect, in a possible implementation manner, the processing at least according to the t first images to obtain a target image corresponding to the image to be detected includes:
[0028] Performing feature extraction on the t first images to obtain t reference feature data;
[0029] Determining target feature data according to the t reference feature data;
[0030] The image corresponding to the target feature data is determined as the target image.
[0031] In this example, the image corresponding to the target feature data determined by t reference feature data is determined as the target image. Since the t first images are unobstructed images, the target image is also an unobstructed image, thereby improving the accuracy of subsequent image matching.
[0032] In combination with the first aspect, in a possible implementation, extracting features from the image to be detected to obtain a first sub-feature data includes:
[0033] Extracting features from the image to be detected to obtain n local feature data;
[0034] Determine the human body region information in the image to be detected according to the human body semantic segmentation method;
[0035] Determine, according to the human body region information, sub-human body region information corresponding to each local feature data;
[0036] According to the sub-human body region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data.
[0037] In this example, by performing feature extraction on the image to be detected, n local feature data are obtained, and a first sub-feature data are determined according to the sub-human region information, thereby improving the accuracy of obtaining the first sub-feature data.
[0038] In combination with the first aspect, in a possible implementation manner, determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data includes:
[0039] Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain an n human body area ratio value;
[0040] Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values;
[0041] The local feature data corresponding to the a human body area ratio values are determined as the a first sub-feature data.
[0042] In this example, the local feature data corresponding to the human body area ratio value higher than the preset area ratio value is determined as a first sub-feature data. The human body area ratio value higher than the preset area ratio value can reflect the unobstructed features of the human body, thereby improving the accuracy of determining the first sub-feature data.
[0043] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0044] According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
[0045] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0046] Target recognition is performed according to the matching image to obtain a target recognition result.
[0047] In this example, target recognition is performed based on the matching image to obtain a target recognition result. Since the accuracy of the matching image is improved, the accuracy of the target recognition result is higher.
[0048] A second aspect of an embodiment of the present application provides an image processing device, the device comprising:
[0049] An extraction unit, used for performing feature extraction on the image to be detected to obtain a first sub-feature data, wherein the first sub-feature data is feature data of an unobstructed human body image;
[0050] a determining unit, configured to determine, from a first database, t first images according to the a first sub-feature data, wherein the first images include feature data matching the a first sub-feature data;
[0051] a processing unit, configured to process at least the t first images to obtain a target image corresponding to the image to be detected;
[0052] The matching unit is used to perform matching in a second database according to the target image to obtain a matching image corresponding to the target image.
[0053] In conjunction with the second aspect, in a possible implementation manner, the determining unit is used to:
[0054] Acquire K images corresponding to each of the a first feature data in the first database to obtain a first image sets;
[0055] Acquire t first images, where the first images are images existing in the a first image sets.
[0056] In conjunction with the second aspect, in a possible implementation manner, the processing unit is used to:
[0057] Performing feature extraction on the t first images to obtain t reference feature data;
[0058] Determining target feature data according to the t reference feature data;
[0059] Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image;
[0060] Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data;
[0061] The image to be detected is processed according to the b third sub-feature data to obtain the target image.
[0062] In conjunction with the second aspect, in a possible implementation manner, in the aspect of processing the image to be detected according to the b third sub-feature data to obtain the target image, the processing unit is used to:
[0063] Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected;
[0064] The image corresponding to the replaced feature data is determined as the target image.
[0065] In conjunction with the second aspect, in a possible implementation manner, in determining the target feature data according to the t reference feature data, the processing unit is configured to:
[0066] The mean value of the t reference feature data is determined as the target feature data.
[0067] In conjunction with the second aspect, in a possible implementation manner, in the aspect of performing processing at least according to the t first images to obtain a target image corresponding to the image to be detected, the processing unit is used to:
[0068] Performing feature extraction on the t first images to obtain t reference feature data;
[0069] Determining target feature data according to the t reference feature data;
[0070] The image corresponding to the target feature data is determined as the target image.
[0071] In conjunction with the second aspect, in a possible implementation manner, the extracting unit is used to:
[0072] Extracting features from the image to be detected to obtain n local feature data;
[0073] Determine the human body region information in the image to be detected according to the human body semantic segmentation method;
[0074] Determine, according to the human body region information, sub-human body region information corresponding to each local feature data;
[0075] According to the sub-human body region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data.
[0076] In conjunction with the second aspect, in a possible implementation manner, in determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data, the extraction unit is used to:
[0077] Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain an n human body area ratio value;
[0078] Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values;
[0079] The local feature data corresponding to the a human body area ratio values are determined as the a first sub-feature data.
[0080] In conjunction with the second aspect, in a possible implementation manner, the device is further used for:
[0081] According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
[0082] In conjunction with the second aspect, in a possible implementation manner, the device is further used for:
[0083] Target recognition is performed according to the matching image to obtain a target recognition result.
[0084] A third aspect of an embodiment of the present application provides a terminal, comprising a processor, an input device, an output device and a memory, wherein the processor, input device, output device and memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the step instructions in the first aspect of the embodiment of the present application.
[0085] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiments of the present application.
[0086] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0088] Figure 1A A flowchart of an image processing method is provided for an embodiment of the present application;
[0089] Figure 1B A schematic diagram of image segmentation is provided for an embodiment of the present application;
[0090] Figure 1C An effect diagram of an image replacement process is provided for an embodiment of the present application;
[0091] Figure 2 A flowchart of another image processing method is provided for an embodiment of the present application;
[0092] Figure 3 A schematic diagram of the structure of a terminal is provided for an embodiment of the present application;
[0093] Figure 4 A structural schematic diagram of an image processing device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0094] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0095] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0096] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0097] In order to better understand an image processing method provided by an embodiment of the present application, the following first briefly introduces the scenario in which the image processing method is applied. The image processing method is applied to the scenario of target re-identification. For example, in community security, a camera captures a picture of a pedestrian, and matches the picture in the database to obtain other pictures corresponding to the pedestrian, such as pictures of the pedestrian's activities in the area captured by other cameras in the community, so as to achieve the effect of identifying the pedestrian. However, since the camera may be blocked by some other objects when taking pictures of pedestrians, the pictures taken are only partial human images of the pedestrian, for example, blocked by leaves, blocked by trash cans, blocked by vehicle gears, etc. If the picture of the human body is blocked for matching, the matching effect is poor, and the more serious situation is that the corresponding image cannot be matched, resulting in a sharp drop in the accuracy of matching. The present application aims to solve the above-mentioned low matching accuracy by performing occlusion completion processing on the picture of the human body, that is, replacing the occluded human body with a similar unobstructed human body image, thereby improving the accuracy of matching.
[0098] Please refer to Figure 1, which is a flow chart of an image processing method provided in an embodiment of the present application. The image processing method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The image processing method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the image processing method can be executed by a server. As shown in Figure 1, the image processing method may include:
[0099] 101. Perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image.
[0100] The image to be detected is an image used to re-identify the target user, for example, it can be an image of a user walking in a community. The target user can be any user captured, for example, a resident in the community, a visitor in the community, or other persons.
[0101] The method of performing feature extraction on the image to be detected to obtain a first sub-feature data may be: performing feature extraction on the image to be detected to obtain a plurality of local feature data, and determining a first sub-feature data from the local feature data.
[0102] The local feature data can be understood as the feature data corresponding to the sub-image obtained after the image to be detected is segmented. The method for segmenting the image to be detected can be to adopt a uniform segmentation method, for example, to divide the image to be detected into 2 sub-images, 4 sub-images, 8 sub-images, etc. A possible segmentation diagram is shown in FIG. Figure 1B As shown, Figure 1B , which shows that the image to be detected is divided into 2 sub-images and 4 sub-images.
[0103] 102. Determine t first images from a first database according to the a first sub-feature data, wherein the first images include feature data matching the a first sub-feature data.
[0104] Multiple images can be matched from the first database according to each first sub-feature data, and t first images can be obtained according to the multiple images. The first sub-feature data can be matched from the first database to multiple images by taking images with fixed values of similarity with the first sub-feature data from high to low, thereby obtaining the multiple images. For example, the first 10 images with similarity with the first sub-feature data from high to low in the first database are taken to obtain the multiple images. Of course, images with other values can also be used, which is only for illustration and not specifically limited here.
[0105] 103. Perform processing at least according to the t first images to obtain a target image corresponding to the image to be detected.
[0106] The blocked human body image in the image to be detected can be replaced by t first images to obtain the target image, or the image corresponding to the mean value of the feature data corresponding to the t first images can be determined as the target image.
[0107] For example, five images matching the image of a user walking in a community are matched in the first database, and the five images are associated with the image of the user walking in the community. The five images are complete images, which can be specifically understood as the portrait in each of the five images is a complete portrait without being blocked. The specific replacement can be: if the legs in the image of the user walking in the community are blocked by the poster bar, then only the upper body image of the user can be displayed in the image, and the five matching images are used to perform occlusion replacement on the image of the user walking in the community, replacing the blocked legs, and obtaining the replaced target image. The replaced target image can be regarded as an unblocked image and can be used for subsequent image retrieval matching, etc.
[0108] 104. Perform matching in a second database according to the target image to obtain a matching image corresponding to the target image.
[0109] According to the target image, the image with the highest matching degree with the target image is matched in the second database, and is determined as the matching image corresponding to the target image. The matching degree here can be matched by similarity. The higher the similarity, the higher the matching degree, and the lower the similarity, the lower the matching degree.
[0110] The first database and the second database may be the same database or different databases. If the first database and the second database are different databases, the capacity of the first database may be smaller than that of the second database, so as to achieve fast retrieval to complete and replace the obstructed image to be detected. After the completion and replacement, the second database with a larger capacity is searched to obtain the corresponding matching image.
[0111] In this example, by performing feature extraction on the image to be detected, a first sub-feature data are obtained, and the first sub-feature data are feature data of an unobstructed human body image. According to the a first sub-feature data, t first images are determined from a first database, and the first images include feature data matching the a first sub-feature data. At least the t first images are processed to obtain a target image corresponding to the image to be detected, and matching is performed in a second database according to the target image to obtain a matching image corresponding to the target image. Therefore, compared with the existing scheme, the accuracy of matching the obstructed image to be detected is not high. It is possible to obtain t first images through the feature data of the unobstructed human body image in the image to be detected, and obtain the target image corresponding to the image to be detected through the tth first image. The target image carries information of the unobstructed human body image in the image to be detected, and the matching image is obtained by matching the target image, which can improve the accuracy of obtaining the matching image.
[0112] In a possible implementation, a possible method for extracting features from an image to be detected and obtaining a first sub-feature data includes:
[0113] A1. Extract features from the image to be detected to obtain n local feature data;
[0114] A2, according to the human body semantic segmentation method, determining the human body area information in the image to be detected;
[0115] A3. Determine sub-human region information corresponding to each local feature data according to the human region information;
[0116] A4. Determine the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data.
[0117] The feature extraction network can be used to extract features from the image to be detected to obtain n local feature data. The feature network can be a pre-trained network for feature extraction. The feature extraction network can segment the image to be detected to obtain multiple segmented sub-images, and feature extraction can be performed on each sub-image to obtain local feature data corresponding to each sub-image.
[0118] The human body semantic segmentation method can determine the human body region information in the image to be detected. After segmentation, the human body semantic segmentation method obtains a binary image, in which the grayscale value of the human body part is 255, and the grayscale value of the non-human body part is 0. For example, if the user's head is blocked in the image to be detected, the grayscale value of the user's head is 0, and the grayscale value of the rest of the body is 255. For another example, if the user's legs are blocked, the grayscale value of the user's legs is 0, and the grayscale value of the rest of the body is 255.
[0119] The intersection of the human body region and the region corresponding to the local feature data is determined as the sub-human body region corresponding to the local feature data, thereby obtaining the sub-human body region information corresponding to the local feature data.
[0120] According to the sub-human region information corresponding to the local feature data, a method for determining a first sub-feature data may be to determine the first sub-feature data according to an area ratio of a human region corresponding to the human region information to an area corresponding to the sub-feature data.
[0121] In this example, by performing feature extraction on the image to be detected, n local feature data are obtained, and a first sub-feature data are determined according to the sub-human region information, thereby improving the accuracy of obtaining the first sub-feature data.
[0122] In a possible implementation, a possible method for determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data includes:
[0123] B1, obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain a human body area ratio value;
[0124] B2, obtaining a human body area ratio value that is higher than a preset area ratio value among the n human body area ratio values;
[0125] B3. Determine the local feature data corresponding to the a human body area ratio values as the a first sub-feature data.
[0126] Among them, the preset area ratio value can be set by an empirical value or historical data, and specifically, for example, it can be 0.3. For example, the image to be detected is divided into 4 sub-images, and the sub-images can be recorded as the first sub-image, the second sub-image, the third sub-image and the fourth sub-image, in order from the head down, for example, the user's head is in the first sub-image, and the legs are in the fourth sub-image. The legs of the user in the image to be detected are blocked, and the leg data is in the local feature data corresponding to the fourth sub-image. Then, according to the area ratio value of the leg image in the fourth sub-image, it can be judged whether the local feature data corresponding to the fourth sub-image is the first sub-feature data. For example, when the preset area ratio value is 0.3, and the area ratio value is less than 0.3, the local feature data corresponding to the fourth sub-image is the first sub-feature data.
[0127] The area of the region corresponding to the sub-human region information corresponds to the area of the region corresponding to the local feature data. Specifically, it can be understood that the ratio of the area of the region corresponding to the sub-human region information in the region corresponding to the local feature data to the area of the region corresponding to the local feature data is determined as the human body area ratio value. The human body area ratio value is the ratio of the human body area to the total area corresponding to the local feature data.
[0128] In this example, the local feature data corresponding to the human body area ratio value higher than the preset area ratio value is determined as a first sub-feature data. The human body area ratio value higher than the preset area ratio value can reflect the unobstructed features of the human body, thereby improving the accuracy of determining the first sub-feature data.
[0129] In a possible implementation, a possible method for determining the second sub-feature data includes:
[0130] According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
[0131] The local feature data whose ratio of the area corresponding to the sub-human region information to the area corresponding to the local feature data is smaller than a preset area ratio value is determined as the second sub-feature data.
[0132] Of course, the local feature data other than the first sub-feature data among the n local feature data may also be determined as the second sub-feature data.
[0133] In a possible implementation, a possible method for determining t first images from a first database according to the a first sub-feature data includes:
[0134] C1. Acquire K images corresponding to each of the a first feature data in the first database to obtain a first image sets;
[0135] C2. Acquire t first images, where the first images are images existing in the a first image sets.
[0136] The method for acquiring the first image set corresponding to the first feature data in the first database may be:
[0137] The image in the first database may be segmented to obtain a segmented image corresponding to the first feature data. For example, the first feature data is feature data of the first image of the image to be detected that is segmented into two parts, and the segmented image corresponding to the first feature data is the image of the first image of the image in the database that is segmented into two parts. The method for segmenting the image in the first database is exactly the same as the method for segmenting the image to be detected, for example, both are segmented by a segmentation network.
[0138] The image corresponding to the first feature data is used to perform a similarity comparison with the segmented image to obtain a corresponding similarity. The complete images corresponding to the K segmented images with similarities from high to low are determined as the K images to obtain a first image set.
[0139] The images in the intersection of a first image sets may be determined as the t first images. Of course, the images in the subset of the intersection of a first image sets may also be determined as the t first images.
[0140] In this example, a first image sets corresponding to a first feature data are obtained from the first database, and t first images are obtained from the a first image sets. The first image is an image that exists in the a first image sets. Therefore, the accuracy of obtaining the t first images can be improved.
[0141] In a possible implementation, a possible method for obtaining a target image corresponding to the image to be detected by processing at least the t first images includes:
[0142] D1, extracting features from the t first images to obtain t reference feature data;
[0143] D2. Determine target feature data according to the t reference feature data;
[0144] D3, extracting features from the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the obscured human body image;
[0145] D4, acquiring feature data corresponding to the b second sub-feature data in the target feature data, to obtain b third sub-feature data;
[0146] D5. Process the image to be detected according to the b third sub-feature data to obtain the target image.
[0147] The method for extracting features from the t first images may be to use a general feature extraction algorithm to extract features and obtain t reference feature data. Alternatively, the method may be to use the feature extraction network in the aforementioned embodiment to extract features and obtain t reference feature data. The feature extraction network may extract local feature data or global feature data, and the global feature data may be understood as feature data of the entire image.
[0148] The mean of t reference feature data may be determined as the target feature data.
[0149] The method for extracting features from the image to be detected to obtain b second sub-feature data may refer to the method shown in the aforementioned embodiment, which will not be described in detail here.
[0150] The third sub-feature data corresponds to the second sub-feature data one by one, and the corresponding relationship is based on position. The specific corresponding method can refer to the corresponding method between the first sub-feature data and the segmented image in the above embodiment.
[0151] The feature data corresponding to the third sub-feature data in the image to be processed may be replaced to obtain a target image.
[0152] In this example, the target image is obtained by processing the image to be detected with b third sub-feature data corresponding to the b second sub-feature data in the image to be detected. The b third sub-feature data are determined from the target feature data determined by t reference feature data, and can carry the information of t reference feature data, thereby improving the accuracy of determining the target image.
[0153] In a possible implementation, a possible method of processing the image to be detected according to the b third sub-feature data to obtain the target image includes:
[0154] E1. Replace the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected;
[0155] E2. Determine the image corresponding to the replaced feature data as the target image.
[0156] For details, please refer to Figure 1C As shown, Figure 1C A diagram showing the effect of an image replacement process is shown. Figure 1C In the figure, the lower leg part of the image to be detected is blocked, the blocked part is replaced, the leg features are completed in the replaced image, and a complete human body image is obtained.
[0157] When replacing the feature data, the feature data is completely replaced according to the format of the original feature data. Since the third sub-feature data are all feature data obtained from the unobstructed human body image, there will be no obstructed human body image in the target image obtained after the replacement.
[0158] In a possible implementation, a possible method of determining target feature data according to the t reference feature data includes:
[0159] The mean value of the t reference feature data is determined as the target feature data.
[0160] Determining the mean of the reference feature data as the target feature data can improve the accuracy of determining the target feature data.
[0161] In a possible implementation manner, another possible method of processing at least the t first images to obtain a target image corresponding to the image to be detected includes:
[0162] F1, extracting features from the t first images to obtain t reference feature data;
[0163] F2. Determine target feature data based on the t reference feature data;
[0164] F3. Determine the image corresponding to the target feature data as the target image.
[0165] The above steps F1 and F2 may refer to the implementation methods of steps D1 and D2 in the above embodiments, which will not be described in detail here.
[0166] In this example, the image corresponding to the target feature data is determined as the target image, which can improve the continuity of the target image and thus improve the reliability of matching.
[0167] In a possible implementation, the embodiment of the present application may also perform target recognition by matching images, specifically including:
[0168] Target recognition is performed according to the matching image to obtain a target recognition result.
[0169] Target recognition based on the matching image may be performed by obtaining attribute information corresponding to the matching image and determining the attribute information as the target recognition result. The attribute information may include identity information, job category, home address information, etc. of the user in the matching image.
[0170] See also Figure 2 , Figure 2 A flowchart of another image processing method is provided for the embodiment of the present application. Figure 2 As shown, the method includes:
[0171] 201. Perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image;
[0172] 202. Determine t first images from a first database according to the a first sub-feature data, wherein the first images include feature data matching the a first sub-feature data;
[0173] 203. Perform feature extraction on the t first images to obtain t reference feature data;
[0174] 204. Determine target feature data according to the t reference feature data;
[0175] 205. Perform feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image;
[0176] 206. Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data;
[0177] 207. Process the image to be detected according to the b third sub-feature data to obtain the target image;
[0178] 208. Perform matching in a second database according to the target image to obtain a matching image corresponding to the target image.
[0179] In this example, the image corresponding to the target feature data determined by t reference feature data is determined as the target image. Since the t first images are unobstructed images, the target image is also an unobstructed image, thereby improving the accuracy of subsequent image matching.
[0180] For the above embodiments, please refer to Figure 3 , Figure 3A schematic diagram of the structure of a terminal provided in an embodiment of the present application, as shown in the figure, includes a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, the processor is configured to call the program instructions, and the program includes instructions for executing the following steps;
[0181] Perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image;
[0182] According to the a first sub-feature data, determining t first images from a first database, wherein the first images include feature data matching the a first sub-feature data;
[0183] Processing at least the t first images to obtain a target image corresponding to the image to be detected;
[0184] Matching is performed in a second database according to the target image to obtain a matching image corresponding to the target image.
[0185] In a possible implementation, determining t first images from a first database according to the a first sub-feature data includes:
[0186] Acquire K images corresponding to each of the a first feature data in the first database to obtain a first image sets;
[0187] Acquire t first images, where the first images are images existing in the a first image sets.
[0188] In a possible implementation, the step of processing at least the t first images to obtain a target image corresponding to the image to be detected includes:
[0189] Performing feature extraction on the t first images to obtain t reference feature data;
[0190] Determining target feature data according to the t reference feature data;
[0191] Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image;
[0192] Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data;
[0193] The image to be detected is processed according to the b third sub-feature data to obtain the target image.
[0194] In a possible implementation, the processing the image to be detected according to the b third sub-feature data to obtain the target image includes:
[0195] Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected;
[0196] The image corresponding to the replaced feature data is determined as the target image.
[0197] In a possible implementation, determining the target feature data according to the t reference feature data includes:
[0198] The mean value of the t reference feature data is determined as the target feature data.
[0199] In a possible implementation, the step of processing at least the t first images to obtain a target image corresponding to the image to be detected includes:
[0200] Performing feature extraction on the t first images to obtain t reference feature data;
[0201] Determining target feature data according to the t reference feature data;
[0202] The image corresponding to the target feature data is determined as the target image.
[0203] In a possible implementation, extracting features from the image to be detected to obtain a first sub-feature data includes:
[0204] Extracting features from the image to be detected to obtain n local feature data;
[0205] Determine the human body region information in the image to be detected according to the human body semantic segmentation method;
[0206] Determine, according to the human body region information, sub-human body region information corresponding to each local feature data;
[0207] According to the sub-human body region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data.
[0208] In a possible implementation, determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data includes:
[0209] Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain an n human body area ratio value;
[0210] Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values;
[0211] The local feature data corresponding to the a human body area ratio values are determined as the a first sub-feature data.
[0212] In a possible implementation, the method further includes:
[0213] According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
[0214] In a possible implementation, the method further includes:
[0215] Target recognition is performed according to the matching image to obtain a target recognition result.
[0216] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that in order to realize the above functions, the terminal includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0217] The embodiment of the present application can divide the terminal into functional units according to the above method example. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0218] In line with the above, see Figure 4 , Figure 4 The present invention provides a schematic diagram of the structure of an image processing device. Figure 4 As shown, the device comprises:
[0219] An extraction unit 401 is used to perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image;
[0220] A determining unit 402 is configured to determine, from a first database, t first images according to the a first sub-feature data, wherein the first images include feature data matching the a first sub-feature data;
[0221] A processing unit 403 is used to process at least the t first images to obtain a target image corresponding to the image to be detected;
[0222] The matching unit 404 is configured to perform matching in a second database according to the target image to obtain a matching image corresponding to the target image.
[0223] In a possible implementation, the determining unit 502 is configured to:
[0224] Acquire K images corresponding to each of the a first feature data in the first database to obtain a first image sets;
[0225] Acquire t first images, where the first images are images existing in the a first image sets.
[0226] In a possible implementation, the processing unit 403 is used to:
[0227] Performing feature extraction on the t first images to obtain t reference feature data;
[0228] Determining target feature data according to the t reference feature data;
[0229] Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image;
[0230] Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data;
[0231] The image to be detected is processed according to the b third sub-feature data to obtain the target image.
[0232] In a possible implementation, in the aspect of processing the image to be detected according to the b third sub-feature data to obtain the target image, the processing unit 403 is used to:
[0233] Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected;
[0234] The image corresponding to the replaced feature data is determined as the target image.
[0235] In a possible implementation, in determining the target feature data according to the t reference feature data, the processing unit 403 is configured to:
[0236] The mean value of the t reference feature data is determined as the target feature data.
[0237] In a possible implementation, in the aspect of performing processing at least according to the t first images to obtain a target image corresponding to the image to be detected, the processing unit 403 is configured to:
[0238] Performing feature extraction on the t first images to obtain t reference feature data;
[0239] Determining target feature data according to the t reference feature data;
[0240] The image corresponding to the target feature data is determined as the target image.
[0241] In a possible implementation, the extraction unit 401 is used to:
[0242] Extracting features from the image to be detected to obtain n local feature data;
[0243] Determine the human body region information in the image to be detected according to the human body semantic segmentation method;
[0244] Determine, according to the human body region information, sub-human body region information corresponding to each local feature data;
[0245] According to the sub-human body region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data.
[0246] In a possible implementation, in determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data, the extraction unit 401 is used to:
[0247] Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain an n human body area ratio value;
[0248] Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values;
[0249] The local feature data corresponding to the a human body area ratio values are determined as the a first sub-feature data.
[0250] In a possible implementation, the device is further used for:
[0251] According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
[0252] In a possible implementation, the device is further used for:
[0253] Target recognition is performed according to the matching image to obtain a target recognition result.
[0254] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any image processing method recorded in the above method embodiments.
[0255] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute part or all of the steps of any image processing method recorded in the above method embodiments.
[0256] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0257] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0258] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0259] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0260] In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software program modules.
[0261] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0262] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.
[0263] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Perform feature extraction on the image to be detected to obtain a first sub-feature data, where the first sub-feature data is feature data of an unobstructed human body image; According to the a first sub-feature data, t first images are determined from a first database, wherein the first images include feature data matching the a first sub-feature data; the images in the first database are unobstructed human body images; Processing at least the t first images to obtain a target image corresponding to the image to be detected; Perform matching in a second database according to the target image to obtain a matching image corresponding to the target image; The feature extraction of the image to be detected is performed to obtain a first sub-feature data, including: Extracting features from the image to be detected to obtain n local feature data; Determine the human body region information in the image to be detected according to the human body semantic segmentation method; Determine, according to the human body region information, sub-human body region information corresponding to each local feature data; According to the sub-human region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data; the sub-human region information corresponding to each local feature data is the intersection of the region corresponding to each local feature data and the human region information; The step of processing at least the t first images to obtain a target image corresponding to the image to be detected includes: Performing feature extraction on the t first images to obtain t reference feature data; Determining target feature data according to the t reference feature data; Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image; Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data; Processing the image to be detected according to the b third sub-feature data to obtain the target image; The step of processing the image to be detected according to the b third sub-feature data to obtain the target image includes: Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected; Determine the image corresponding to the replaced feature data as the target image; The step of determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data comprises: Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain n human body area ratio values; Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values; Determine the local feature data corresponding to the a human body area ratio values as the a first sub-feature data; The method further comprises: According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
2. The method according to claim 1, characterized in that The step of determining t first images from a first database according to the a first sub-feature data comprises: Acquire K images corresponding to each of the a first sub-feature data in the first database to obtain a first image sets; Acquire t first images, where the first images are images existing in the a first image sets.
3. The method according to claim 1, characterized in that The step of determining target feature data according to the t reference feature data comprises: The mean value of the t reference feature data is determined as the target feature data.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Target recognition is performed according to the matching image to obtain a target recognition result.
5. An image processing device, characterized in that: The device comprises: An extraction unit, used for performing feature extraction on the image to be detected to obtain a first sub-feature data, wherein the first sub-feature data is feature data of an unobstructed human body image; a determining unit, configured to determine, from a first database, t first images according to the a first sub-feature data, the first images including feature data matching the a first sub-feature data; the images in the first database are unobstructed human body images; a processing unit, configured to process at least the t first images to obtain a target image corresponding to the image to be detected; A matching unit, configured to perform matching in a second database according to the target image to obtain a matching image corresponding to the target image; In terms of extracting features from the image to be detected to obtain a first sub-feature data, the extraction unit is specifically used for: Extracting features from the image to be detected to obtain n local feature data; Determine the human body region information in the image to be detected according to the human body semantic segmentation method; Determine, according to the human body region information, sub-human body region information corresponding to each local feature data; According to the sub-human region information corresponding to each local feature data, the a first sub-feature data are determined from the n local feature data; the sub-human region information corresponding to each local feature data is the intersection of the region corresponding to each local feature data and the human region information; The processing unit is used for: Performing feature extraction on the t first images to obtain t reference feature data; Determining target feature data according to the t reference feature data; Performing feature extraction on the image to be detected to obtain b second sub-feature data, where the second sub-feature data is feature data of the blocked human body image; Acquire feature data corresponding to the b second sub-feature data in the target feature data to obtain b third sub-feature data; Processing the image to be detected according to the b third sub-feature data to obtain the target image; In the aspect of processing the image to be detected according to the b third sub-feature data to obtain the target image, the processing unit is used to: Replacing the b second sub-feature data in the feature data of the image to be detected with the corresponding b third sub-feature data to obtain the replaced feature data of the image to be detected; Determine the image corresponding to the replaced feature data as the target image; In the aspect of determining the a first sub-feature data from the n local feature data according to the sub-human body region information corresponding to each local feature data, the extraction unit is used to: Obtaining a ratio value of the area corresponding to the sub-human body area information to the area corresponding to the corresponding local feature data, so as to obtain n human body area ratio values; Obtaining a human body area ratio values that are higher than a preset area ratio value among the n human body area ratio values; Determine the local feature data corresponding to the a human body area ratio values as the a first sub-feature data; The device is also used for: According to the sub-human body region information corresponding to each local feature data, the b second sub-feature data are determined from the n local feature data, wherein the sum of a and b is n.
6. A terminal, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 4.
