Image base generation method, device, equipment and storage medium

By grouping images similarity and building multiple image base libraries, the problem of cumbersome and inefficient image base library generation in the prior art is solved, and the accuracy and efficiency of image recognition are improved.

CN118521841BActive Publication Date: 2024-12-20ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410996949.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-20
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

The existing image base library generation methods are cumbersome and inefficient, resulting in low quality of the base library image, affecting the image recognition effect, especially for target scenes or objects whose types are uncertain or are difficult to be recognized by AI training.

Method used

By acquiring multiple images to be classified in the target area, grouping and processing according to the similarity between images, the target image group is constructed. If the number of groups is equal to the preset number, the first image base library is constructed, and the remaining images are constructed to build the second image base library. , use the similarity mean and variance to determine the image group to improve the generation efficiency of the image base library.

Benefits of technology

It improves the efficiency and quality of image base library generation, ensures image grouping with similar image features, enhances the accuracy of image recognition, and reduces the burden of manual settings by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521841B_ABST
    Figure CN118521841B_ABST
Patent Text Reader

Abstract

The present application discloses an image base library generation method, device, equipment and storage medium, the image base library generation method comprises: obtaining multiple images to be classified of a target area; grouping the multiple images to be classified according to the similarity between each image to be classified to obtain a target image group, the target image group includes a target image, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, then constructing a first image base library based on the target images in the target image group, and constructing a second image base library based on the remaining images in the multiple images to be classified except the target images. The above scheme can improve the generation efficiency of the image base library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to an image base generation method, device, equipment and storage medium. Background Art

[0002] The base database is also called the control database or the registration database. The image base database stores images that can be used for feature comparison and is often used in application scenarios such as image recognition and image detection.

[0003] Especially for the state detection of target scenes or target objects, the types of such targets are usually uncertain or difficult to be recognized and classified by AI training, so they rely on the classification of the base library. Usually, the base library images in the image base library are compared with the image to be recognized to obtain information such as the state represented by the image to be recognized.

[0004] However, the current method of generating image base libraries is rather cumbersome and inefficient. Not only does it require users to perform manual settings, but the inaccuracy of manual settings will also result in low quality of base library images, which in turn affects the image recognition effect. Summary of the invention

[0005] The present application at least provides an image base generation method, device, equipment and computer-readable storage medium.

[0006] The first aspect of the present application provides a method for generating an image base library, comprising: acquiring multiple images to be classified of a target area; grouping the multiple images to be classified according to the similarity between each image to be classified to obtain a target image group, wherein the target image group includes target images, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of the target image groups is equal to a preset number, constructing a first image base library based on the target images in the target image group, and constructing a second image base library based on the remaining images in the multiple images to be classified except the target images.

[0007] In one embodiment, after selecting a target image from the multiple images to be classified according to the similarity between the images to be classified to obtain a target image group, the method further includes: if the number of the target image groups is greater than the preset number, determining whether the number of the remaining images is zero; if so, respectively calculating the mean similarity between the target images in each target image group; constructing the first image base library based on the target image group with the largest mean similarity in each target image group, and constructing the second image base library based on the other target image groups in each target image group except the target image group with the largest mean similarity.

[0008] In one embodiment, after determining whether the number of remaining images is zero if the number of target image groups is greater than the preset number, the method further includes: if the number of remaining images is not zero, respectively constructing image sets corresponding to each target image group with the target images in each target image group and the remaining images; respectively calculating the similarity variance of each image set based on the similarity between each image in each image set; constructing the first image base library based on the target image group corresponding to the image set having the largest similarity variance, and constructing the second image base library based on the remaining images.

[0009] In one embodiment, the multiple images to be classified are grouped according to the similarities between the images to be classified to obtain a target image group, including: grouping the images to be classified based on the similarities between the images to be classified to obtain a grouping result; if the grouping result indicates a grouping failure, deleting the images to be classified.

[0010] In one embodiment, if the grouping result indicates a grouping failure, after deleting each image to be classified, the method further includes: obtaining multiple current images to be classified of the target area; comparing each current image to be classified pairwise to obtain the similarity between each current image to be classified; determining a current target image among each current image to be classified whose similarity is greater than or equal to the first similarity threshold; and grouping the current target images based on the similarity between each current target image to obtain a current grouping result.

[0011] In one embodiment, determining the current target image whose similarity among each current image to be classified is greater than or equal to the first similarity threshold includes: judging whether the current target image exists based on the similarity between each current image to be classified and the first similarity threshold; if not, deleting each current image to be classified.

[0012] In one embodiment, the multiple images to be classified include a first image to be classified and a second image to be classified, and the multiple images to be classified of the target area are obtained, including: performing target detection processing on the acquired current picture, the current picture including the target area; if there is no target object in the current picture, photographing the current picture to obtain the first image to be classified; using the first image to be classified as a base image and performing image change detection with the current picture to obtain a change detection result of the current picture; if the change detection result indicates the existence of a change, photographing the current picture to obtain the second image to be classified.

[0013] In one embodiment, the photographing and processing the current picture to obtain the first image to be classified includes: photographing and processing the current picture to obtain a first initial image; and performing image cropping on the first initial image based on a preset target area to obtain the first image to be classified.

[0014] The second aspect of the present application provides an image base library generation device, including: an acquisition module, used to acquire multiple images to be classified of a target area; a grouping module, used to group the multiple images to be classified according to the similarity between each image to be classified to obtain a target image group, wherein the target image group includes target images, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; a base library construction module, used to construct a first image base library based on the target images in the target image group if the number of the target image groups is equal to a preset number, and to construct a second image base library based on the remaining images of the multiple images to be classified except the target images.

[0015] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned image base library generation method.

[0016] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which implement the above-mentioned image base library generation method when the program instructions are executed by a processor.

[0017] The above scheme obtains multiple images to be classified in the target area and calculates the similarity between each image to be classified; performs grouping processing according to the similarity between each image to be classified, so that the images to be classified with similar image features are grouped together to obtain a target image group, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, it indicates that the grouping is successful, so a first image base is constructed based on the target images in the target image group, and a second image base is constructed based on the remaining images in the multiple images to be classified except the target images. In this way, different image bases can be generated based on the similarity between each image, thereby improving the generation efficiency of the image base.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0020] Figure 1It is a flowchart of an exemplary embodiment of the image base database generation method of the present application;

[0021] Figure 2 is an exemplary image grouping schematic diagram in the image base database generation method of the present application;

[0022] Figure 3 is a block diagram of an image base database generating device shown in an exemplary embodiment of the present application;

[0023] Figure 4 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0024] Figure 5 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0025] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0026] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0027] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0028] For ease of understanding, the common image base library generation method in this field is now exemplified. Image base libraries are usually used in the field of image recognition technology. By performing feature comparison between the acquired image to be identified and the base library images in one or more image base libraries (whose type and / or status and other features have been clarified), the type and / or status of the image to be identified can be obtained. Based on the usage scenarios of the image base library, it can be known that the user needs to try to ensure that the specifications and image content of the base library image and the image to be identified are consistent in order to improve the accuracy of the image recognition process; and because the user needs to provide the base library image, it may be difficult for each base library image to meet the standard (angle, position, fill light, image parameters, etc. are different), resulting in low quality of the image base library, which will also affect the accuracy of image recognition; in addition, there may be some image processing processes that further increase the user's usage burden.

[0029] See also Figure 1 , Figure 1 This is a flowchart of an exemplary embodiment of the image base database generation method of the present application. Specifically, it may include the following steps:

[0030] Step S110, obtaining a plurality of images to be classified in the target area.

[0031] The target area refers to the area that needs to be used for applications such as image detection and image recognition. Multiple images to be classified should be collected based on the same target area, thereby avoiding invalid detection and recognition of images in other areas. That is, the image content of multiple images to be classified can at least include the same target area.

[0032] For example, the target area may be determined in response to an area designation operation of a user or may be determined by performing area detection in an image based on a preset area template, which is not limited here.

[0033] In addition, there may be a preset quantity threshold value for limiting the number of images to be classified. For example, the quantity threshold value may be N (N is a positive integer). When the number of images to be classified does not reach N, it is necessary to continue to acquire images to be classified until the number reaches N. When the number of images to be classified reaches N, subsequent steps may be performed.

[0034] Step S120, grouping the multiple images to be classified according to the similarity between each image to be classified to obtain a target image group, the target image group includes target images, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold.

[0035] The target image group refers to two or more similar images to be classified that are grouped and clustered together. The similarity between any two target images in the target image group needs to be greater than or equal to a preset first similarity threshold, thereby representing that all target images in the same target image group represent the same type and / or the same state. In addition, by grouping multiple images to be classified according to the similarity between each image to be classified, one or more target image groups can be obtained, or no target image group can be obtained, which is not limited here.

[0036] Exemplarily, the process of grouping multiple images to be classified according to the similarity between each image to be classified can be to extract the image features of N images to be classified respectively; compare the image features of each image to be classified in pairs to obtain the feature similarity between each image to be classified; select M images to be classified whose feature similarity is greater than or equal to a first similarity threshold as target images, and group the target images whose similarity between any two target images is greater than or equal to the first similarity threshold into one group, to obtain one or more target image groups, or no target image group can be obtained. In addition, the remaining (NM) images to be classified except the M target images in the N images to be classified can be used as a combination of remaining images .

[0037] Step S130: if the number of target image groups is equal to the preset number, a first image base is constructed based on the target images in the target image groups, and a second image base is constructed based on the remaining images except the target images in the plurality of images to be classified.

[0038] The number of target image groups represents, to a certain extent, the number of types and / or states reflected by the features of the target images. For example, when judging the state of a hinged door or window, the door or window can usually exist in multiple states, such as closed state, 10-degree open state, 30-degree open state, fully open state, etc., and multiple target image groups may be obtained by classifying and combining according to the similarity between the images.

[0039] Therefore, the preset number can be set according to the specific application scenario (the type and / or state to be judged). For example, the preset number can be set to 1 in a binary classification judgment scenario, such as judging the switch state of doors and windows or the normal state and abnormal state of a target object. In this way, the binary classification of the images to be classified can be achieved through the similarity between the images to be classified to construct an image base library corresponding to the two states. That is, if the number of target image groups and the preset number are the same as 1, it means that the target images can be divided into one category to construct a first image base library, and the remaining images can be divided into one category to construct a second image base library.

[0040] Exemplarily, taking the switch state of the fire safety door as an example, the safety door in the closed state is regarded as a normal state, and the first image base is defined to represent the closed state. Since the door in the closed state can be considered as a steady state (a state that is not easy to change), the base images in the first image base can be set to have a high similarity, which is equivalent to the image greater than or equal to the first similarity threshold in the aforementioned embodiment; similarly, the safety door in the open state is regarded as an abnormal state, and the second image base is defined to represent the open state, and the remaining images are used as base images in the second image base that characterize the opening of the safety door. In this way, two image bases are obtained that can distinguish whether the safety door is in a closed state or an open state. In addition, it can also be extended to the method of constructing image bases corresponding to the normal and abnormal states of other target objects (such as the idle and occupied state of the socket, whether the fire hydrant is compliant, etc.), which will not be elaborated here.

[0041] Furthermore, from the above examples, it can be seen that the target image with higher similarity is used as the base image in the first image base library to represent the normal state of the target area, and the remaining images to be classified with lower similarity are used as the base images in the second image base library to represent the abnormal state of the target area. Therefore, when the image to be identified is subsequently compared with the base images in the image base library, the base images similar to the image to be identified can be determined and the state corresponding to the image to be identified can be further determined.

[0042] It can be seen that the present application obtains multiple images to be classified in the target area and calculates the similarity between each image to be classified; performs grouping processing according to the similarity between each image to be classified, so that the images to be classified with similar image features are grouped together to obtain a target image group, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, it indicates that the grouping is successful, so a first image base is constructed based on the target images in the target image group, and a second image base is constructed based on the remaining images in the multiple images to be classified except the target images. In this way, different image bases can be generated based on the similarity between each image, thereby improving the generation efficiency of the image base.

[0043] Based on the above embodiment, the embodiment of the present application describes the steps after selecting a target image from multiple images to be classified according to the similarity between the images to be classified to obtain a target image group. Specifically, the method of this embodiment includes the following steps:

[0044] If the number of target image groups is greater than a preset number, determine whether the number of remaining images is zero; if so, calculate the mean similarity between each target image in each target image group respectively; construct a first image base library based on the target image group with the largest mean similarity among each target image group, and construct a second image base library based on the other target image groups except the target image group with the largest mean similarity among each target image group.

[0045] In combination with the above-mentioned embodiment, if the number of target image groups k is the same as the preset number 1 (k=1) after the image to be classified is grouped, it means that the image to be classified is grouped successfully. If the number of target image groups is greater than the preset number (k>1), it indicates that the current image to be classified may have multiple states, so further judgment is required. At this time, it is also necessary to judge whether the number of remaining images (NM) is 0 (that is, is empty); if there are remaining images, it means there are dissimilar images, that is, the remaining images can be used to construct the second image base library, or the remaining images and images of other target image groups can be used to construct the second image base library; if there are no remaining images, it is necessary to select target image groups with lower similarity from each target image group to construct the second image base library.

[0046] Exemplarily, if there are no remaining images (the number of remaining images is zero), it is necessary to select images from the target image group to construct the second image base library. It is understandable that there should be at least two target images in each target image group, so the similarity mean of each target image group is determined based on the similarity between each target image in each target image group, which is equivalent to performing mean calculation based on the similarity between each target image in each target image group to obtain the similarity mean of each target image group. It should be noted that the mean calculation process may include but is not limited to arithmetic mean, weighted mean, geometric mean, etc., which are not limited here. Among them, the target image group with the largest similarity mean can be characterized to a certain extent as being composed of several target images with the highest degree of similarity, so the first image base library is constructed based on the target image group with the largest similarity mean; in addition, the remaining other target image groups are relatively low in similarity, so the other target image groups in each target image group except those selected as the first image base library can be used to construct the second image base library. Among them, all the remaining target image groups can be used to construct the second image base library, or the ones with the lowest similarity mean value can be selected from the remaining target image groups to construct the second image base library, etc., which is not limited here. It should also be noted that in this embodiment, in addition to using the similarity mean value of each target image group to determine the target image group for constructing the first image base library, other types of statistical values ​​can also be used to determine the target image group for constructing the first image base library. For example, based on the similarity between each target image in each target image group, the median, mode or quartile of each target image group is determined, and then the target image group for constructing the first image base library is determined by referring to the above-mentioned judgment process based on the similarity mean value.

[0047] It should be noted that in the process of constructing the image base library, not only the screened images need to be stored in the corresponding base library, but the feature values ​​of each image can also be stored accordingly, so that the features of the image to be identified can be compared with the features in the image base library later, without the need to extract the features of the base library images again, thereby further improving the image recognition efficiency.

[0048] Based on the above embodiment, the embodiment of the present application describes the steps after determining whether the number of remaining images is zero if the number of target image groups is greater than the preset number. Specifically, the method of this embodiment includes the following steps:

[0049] If the number of remaining images is not zero, the target images and remaining images in each target image group are respectively used to construct image sets corresponding to each target image group; the similarity variance of each image set is calculated based on the similarity between each image in each image set; the first image base library is constructed based on the target image group corresponding to the image set with the largest similarity variance, and the second image base library is constructed based on the remaining images.

[0050] In combination with the above-mentioned embodiment, if the number of remaining images is not zero, since the similarity between the remaining images is low, it also indicates that the degree of change between the remaining images is large (in a non-steady state), so a second image base library can be constructed based on the remaining images to represent the abnormal state.

[0051] Furthermore, since there are multiple target image groups representing multiple states, it is necessary to select the target image group that best matches the normal state from the multiple target image groups for constructing the first image base library. Among them, the features of the target image that best matches the normal state should be significantly different from the features of the target image in the abnormal state, so the target image group used to construct the first image base library can be determined based on the degree of feature discreteness between the target image in each target image group and the remaining images used to construct the second image base library.

[0052] For example, reference may be made to Figure 2 , Figure 2 This is an exemplary image grouping diagram in the image base generation method of the present application, which shows the similarity matrix S between N=8 images to be classified (P1-P8), and the preset first similarity threshold S1=90. Therefore, the target images with similarity greater than or equal to the first similarity threshold are {P1, P3, P5, P7, P8}; these target images are then grouped so that the similarity between any two target images is greater than or equal to the first similarity threshold, that is, two target image groups are obtained. ={P1, P8}, ={P3, P5, P7} and the similarity matrix corresponding to the two image groups and , and accordingly, the remaining images used to construct the second image base can also be obtained ={P2, P4, P6}. It should be noted that Figure 2 The similarity between the same to-be-classified images, i.e., 100, is shown in FIG. 1 for the convenience of calculation. In the actual implementation of the method, it is not necessary to compare the same to-be-classified image, but only two different to-be-classified images can be compared.

[0053] Then, the target images in each target image group and the remaining images used to construct the second image base are combined to obtain the image set and similarity matrix corresponding to each target image group; variance calculation is performed based on the similarity matrix of each image set (removing the similarities of duplicate items and identical images) to obtain the similarity variance of each image set ( The variance of the set =134, The variance of the set =153.67647, ), which represents the degree of discreteness between each image in each image set, and also represents the difference between each target image group and the second image base. It can be seen that The images in the target image group have the largest degree of discreteness from the remaining images, so based on The target image group {P3, P5, P7} constructs the first image base library.

[0054] Based on the above embodiment, the embodiment of the present application describes the steps of grouping multiple images to be classified according to the similarity between the images to be classified to obtain a target image group. Specifically, the method of this embodiment includes the following steps:

[0055] The images to be classified are grouped based on the similarities between them to obtain a grouping result; if the grouping result indicates a grouping failure, the images to be classified are deleted.

[0056] In conjunction with the above embodiment, if the image cannot be grouped during the grouping process, resulting in grouping failure, that is, the number of target image groups k=0, it is necessary to delete all current images to be classified, or delete part of the current images to be classified (for example, randomly delete half of the current images to be classified or delete half of the images to be classified with lower similarity, etc.), or delete the M target images that have been screened. Then, reacquire the images to be classified in the target area, and repeat the process of the above embodiment until the number of target image groups k>0.

[0057] In addition, there may be other reasons for grouping failure. In the process of grouping the images to be classified based on the similarity between them, it is necessary to select images with similarity greater than or equal to the first similarity threshold from the images to be classified as target images, and then group the target images; so if there is no image with similarity greater than or equal to the first similarity threshold, the grouping process will fail, that is, the current images to be classified do not meet the grouping requirements, so it is necessary to delete all the current images to be classified, or delete part of the current images to be classified (for example, randomly delete half of the current images to be classified or delete half of the images to be classified with lower similarity, etc.). Then reacquire the images to be classified in the target area, and repeat the process of the above-mentioned embodiment until the number M of images with similarity greater than or equal to the first similarity threshold is greater than 0.

[0058] Based on the above embodiment, the embodiment of the present application describes the steps after deleting each image to be classified if the grouping result indicates grouping failure. Specifically, the method of this embodiment includes the following steps:

[0059] Acquire multiple current images to be classified of the target area; compare the current images to be classified in pairs to obtain the similarity between the current images to be classified; determine the current target images whose similarity is greater than or equal to the first similarity threshold among the current images to be classified; group the current target images based on the similarity between the current target images to obtain the current grouping result.

[0060] In combination with the above-mentioned embodiment, when the target image cannot be selected from the acquired images to be classified, all or part of the images to be classified are deleted (if partially deleted, the remaining images to be classified are used as the current images to be classified in the target area); then the current images to be classified in the target area are continuously acquired until the number of current images to be classified reaches N, and then the steps of the above-mentioned embodiment are repeated to compare the current images to be classified in pairs to obtain the similarity between the current images to be classified; an image with a similarity greater than or equal to a first similarity threshold is selected from the current images to be classified as the current target image; and then the current target images are grouped to obtain the current grouping result.

[0061] If the current grouping result indicates that the grouping is successful, one or more current target image groups can be obtained. Similarly, according to the above embodiment, the method of constructing the image base library is determined based on the number of current target image groups. If the current grouping result indicates that the grouping fails (such as there is no image with a similarity greater than or equal to the first similarity threshold, resulting in the number of current target image groups k=0), the current target image group cannot be obtained. Similarly, according to the above embodiment, the iteration is repeated, the current image to be classified is deleted, and the image to be classified in the target area is obtained to perform image comparison and grouping processing, etc., which will not be repeated here.

[0062] Based on the above embodiment, the embodiment of the present application describes the steps of determining the current target image whose similarity among the current images to be classified is greater than or equal to the first similarity threshold. Specifically, the method of this embodiment includes the following steps:

[0063] Based on the similarity between the current images to be classified and the first similarity threshold, it is determined whether the current target image exists; if not, the current images to be classified are deleted.

[0064] In combination with the above-mentioned embodiment, after the current images to be classified are compared pairwise and the similarities between the current images to be classified are obtained, it is necessary to determine whether there is a current target image in the current images to be classified whose similarity is greater than or equal to the first similarity threshold; if so, the target images can continue to be grouped; if not, all or part of the current images to be classified need to be deleted, and the images to be classified in the target area need to be re-acquired for judgment again. The execution process of the above-mentioned embodiment can be referred to here for the same reason, and will not be repeated here.

[0065] On the basis of the above embodiment, the embodiment of the present application describes the steps of obtaining multiple images to be classified of the target area. The multiple images to be classified include a first image to be classified and a second image to be classified. Specifically, the method of this embodiment includes the following steps:

[0066] The acquired current picture is subjected to target detection processing, and the current picture includes a target area; if there is no target object in the current picture, the current picture is photographed to obtain a first image to be classified; the first image to be classified is used as a base image and image change detection is performed between the first image to be classified and the current picture to obtain a change detection result of the current picture; if the change detection result indicates that there is a change, the current picture is photographed to obtain a second image to be classified.

[0067] It should be noted that the image to be classified obtained in the present application may be an image that has not been processed or an image that has been processed, which is not limited here.

[0068] In order to avoid interference from other objects in the acquired image to be classified, thereby affecting the quality of the base image and the subsequent image recognition effect, during the image acquisition process, the current picture can be subjected to target detection processing to determine whether there is a target object in the current picture. The current picture can be a picture of the target area, or a picture of a larger range including the target area, which is not limited here. If there is a target object in the current picture, the current picture will not be photographed; if there is no target object in the current picture, the current picture will be photographed to obtain the first image to be classified.

[0069] The first image to be classified is one of the images to be classified that need to be acquired. If you want to continue to acquire images to be classified, you need to use the first image to be classified as a base map and run the preset target detection algorithm and image change algorithm. When there is no target object in the current picture and there is an image change between the current picture and the base map, take a second photo of the current picture to obtain the second image to be classified. Similarly, use the second image to be classified as the latest base map to iteratively acquire the next image to be classified (such as the third image to be classified, the fourth image to be classified, etc.) until N images to be classified are acquired.

[0070] On the basis of the above embodiment, the embodiment of the present application will illustrate the steps of photographing the current image to obtain the first image to be classified. Specifically, the method of this embodiment includes the following steps:

[0071] The current picture is photographed to obtain a first initial image; the first initial image is cropped based on a preset target area to obtain a first image to be classified.

[0072] In conjunction with the above embodiments, the image to be classified may be image processed or not. In order to improve the quality of the base image and enhance the image recognition effect, the present application may add an image processing process during the process of obtaining the image to be classified.

[0073] Exemplarily, the image content displayed on the current screen may be larger than the image content corresponding to the target area; therefore, after the current screen is photographed and processed to obtain the first initial image, the first initial image needs to be cropped, and the image portion corresponding to the target area in the first initial image is retained as the first image to be classified, and this portion is used as the base library for subsequent image change detection. After the current screen is photographed and processed again to obtain the second initial image, the second initial image is similarly cropped, and the image portion corresponding to the target area in the second initial image is retained as the second image to be classified, and so on until N images to be classified are obtained, then the capture is paused or stopped. This ensures that the image specifications of the base library images are the same, and also saves the user's image processing time.

[0074] In addition, during the image capturing process, the image capturing device may be fixed at the same capturing position and / or the same capturing angle for capturing.

[0075] Optionally, an image processing process may be added during the image comparison process or the base library construction process of the present application. For example, to determine whether the image parameters between images are the same or similar, the image parameters may include but are not limited to brightness, saturation, exposure, contrast, etc. For example, for a high-brightness image and a low-brightness image of the same target area, the brightness parameters of the two images can be modified to make the two images close in brightness, thereby reducing the image recognition effect caused by the brightness factor, etc. The specific method may include but is not limited to adjusting the brightness parameter of the high-brightness image to the same as the brightness parameter of the low-brightness image, or adjusting the brightness parameter of the low-brightness image to the same as the brightness parameter of the high-brightness image, or calculating the average brightness parameter between the high-brightness image and the low-brightness image and adjusting the brightness parameters of the high-brightness image and the low-brightness image to the average brightness parameter at the same time, etc. Similarly, the image processing methods for other image parameters are also the same. For example, for saturation, in some scenes, the image acquisition device is supplemented by infrared light under dark light conditions, so the acquired image is a black and white image (low saturation), but under sufficient light conditions, the acquired image is a color image (high saturation). Therefore, the color image can be adjusted to a black and white image, or the image parameters of the two images can be adjusted to the average saturation, etc., which will not be elaborated here.

[0076] In one embodiment, after the image base library is generated, it can also respond to the user's operating instructions to perform editing operations on the image base library, such as manual import, deletion, migration of base maps, etc., thereby achieving the effects of supplementing materials, deleting incorrect classifications, and migrating incorrectly classified images to the correct status base library.

[0077] It should also be noted that after the image base is generated, the current image base can be used to perform state detection and other applications on the target area. For example, the pre-set target detection algorithm, feature extraction algorithm, feature comparison algorithm, etc. are run. When there is no target object in the current picture, the current picture is photographed, or the target area is photographed, or the target area is cropped after the current picture is photographed, to obtain a target area image containing the target area; extract the image features of the target area image; then compare the image features of the target area image with the image features of each base image in the image base, to obtain the similarity between the target area image and each base image; determine the target base image whose similarity is greater than the preset second similarity threshold, and use the state corresponding to the image base where the target base image is located as the state of the target area, thereby realizing the state detection of the target area. Among them, the size relationship between the second similarity threshold and the first similarity threshold is not limited.

[0078] Furthermore, the user can also check the base library images to know whether the automatic grouping is in line with expectations, determine whether the status of the target area images is in line with expectations, and decide whether to adjust the image base library.

[0079] It should be further explained that the execution subject of the image base database generation method may be an image base database generation device, for example, the image base database generation method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the image base database generation method may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0080] Figure 3 FIG. 1 is a block diagram of an image base database generation device shown in an exemplary embodiment of the present application. Figure 3 As shown, the exemplary image base database generation device 300 includes: an acquisition module 310, a grouping module 320 and a base database construction module 330. Specifically:

[0081] The acquisition module 310 is used to acquire a plurality of images to be classified in the target area.

[0082] The grouping module 320 is used to group multiple images to be classified according to the similarity between each image to be classified to obtain a target image group, where the target image group includes target images, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold.

[0083] The base library construction module 330 is used to construct a first image base library based on the target images in the target image group if the number of target image groups is equal to a preset number, and to construct a second image base library based on the remaining images except the target images in the multiple images to be classified.

[0084] In this exemplary image base library generation device, multiple images to be classified in the target area are obtained and the similarity between each image to be classified is calculated; grouping is performed according to the similarity between each image to be classified, so that the images to be classified with similar image features are grouped together to obtain a target image group, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, it indicates that the grouping is successful, so a first image base library is constructed based on the target images in the target image group, and a second image base library is constructed based on the remaining images in the multiple images to be classified except the target images. In this way, different image base libraries can be generated based on the similarity between each image, thereby improving the generation efficiency of the image base library.

[0085] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0086] The functions of each module can be found in the embodiment of the image base library generation method, which will not be described in detail here.

[0087] See also Figure 4 , Figure 4 4 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 400 includes a memory 401 and a processor 402, and the processor 402 is used to execute the program instructions stored in the memory 401 to implement the steps in any of the above-mentioned image base library generation method embodiments. In a specific implementation scenario, the electronic device 400 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 400 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0088] Specifically, the processor 402 is used to control itself and the memory 401 to implement the steps in any of the above-mentioned image base library generation method embodiments. The processor 402 can also be called a CPU (Central Processing Unit). The processor 402 may be an integrated circuit chip with signal processing capabilities. The processor 402 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 402 can be implemented by an integrated circuit chip.

[0089] In this exemplary electronic device, multiple images to be classified of the target area are obtained and the similarity between each image to be classified is calculated; grouping is performed according to the similarity between each image to be classified, so that the images to be classified with similar image features are grouped together to obtain a target image group, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, it indicates that the grouping is successful, so a first image base is constructed based on the target images in the target image group, and a second image base is constructed based on the remaining images in the multiple images to be classified except the target images. In this way, different image bases can be generated based on the similarity between each image, thereby improving the generation efficiency of the image base.

[0090] See also Figure 5 , Figure 5 The computer-readable storage medium 510 stores program instructions 511 that can be executed by a processor, and the program instructions 511 are used to implement the steps in any of the above-mentioned image base generation method embodiments.

[0091] In this exemplary storage medium, multiple images to be classified of the target area are obtained by running the program instructions in the storage medium and the similarity between each image to be classified is calculated; grouping is performed according to the similarity between each image to be classified, so that the images to be classified with similar image features are grouped together to obtain a target image group, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; if the number of target image groups is equal to the preset number, it indicates that the grouping is successful, so a first image base is constructed based on the target images in the target image group, and a second image base is constructed based on the remaining images in the multiple images to be classified except the target images. In this way, different image bases can be generated based on the similarity between each image, thereby improving the generation efficiency of the image base.

[0092] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0093] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0094] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 devices or units can be electrical, mechanical or other forms.

[0095] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution 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 storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A method for generating an image base library, characterized in that: The method comprises: Obtain multiple images to be classified in the target area; Grouping the plurality of images to be classified according to the similarity between each of the images to be classified to obtain a target image group, wherein the target image group includes target images, and the similarity between any two target images in the target image group is greater than or equal to a preset first similarity threshold; If the number of the target image groups is equal to the preset number, constructing a first image base library based on the target images in the target image groups, and constructing a second image base library based on the remaining images in the plurality of images to be classified except the target images; If the number of the target image groups is greater than the preset number, constructing the second image base library based on the remaining images and / or the images in the target image group; The step of constructing the second image base based on the remaining images and / or the images in the target image group includes: determining whether the number of the remaining images is zero; if so, respectively calculating the mean similarity between each target image in each target image group; The first image base is constructed based on the target image group with the largest mean similarity among the target image groups, and the second image base is constructed based on the other target image groups except the target image group with the largest mean similarity among the target image groups.

2. The method according to claim 1, characterized in that After determining whether the number of the remaining images is zero if the number of the target image groups is greater than the preset number, the method further includes: If the number of the remaining images is not zero, the target images in each target image group and the remaining images are respectively used to construct image sets corresponding to each target image group; Calculate the similarity variance of each image set based on the similarity between each image in each image set; The first image base is constructed based on the target image group corresponding to the image set with the largest similarity variance, and the second image base is constructed based on the remaining images.

3. The method according to claim 1, characterized in that The step of grouping the plurality of images to be classified according to the similarities between the images to be classified to obtain a target image group includes: The images to be classified are grouped based on the similarities between the images to be classified to obtain a grouping result; If the grouping result indicates that the grouping fails, each image to be classified is deleted.

4. The method according to claim 3, characterized in that If the grouping result indicates that the grouping fails, after deleting each image to be classified, the method further includes: Acquire multiple current images to be classified of the target area; Compare the current images to be classified in pairs to obtain the similarity between the current images to be classified; Determine a current target image whose similarity is greater than or equal to the first similarity threshold among the current images to be classified; The current target images are grouped based on the similarities between the current target images to obtain a current grouping result.

5. The method according to claim 4, characterized in that The determining of the current target image whose similarity among the current images to be classified is greater than or equal to the first similarity threshold comprises: Based on the similarity between the current images to be classified and the first similarity threshold, determining whether the current target image exists; If it does not exist, then delete the current images to be classified.

6. The method according to claim 1, characterized in that The plurality of images to be classified include a first image to be classified and a second image to be classified, and the step of acquiring the plurality of images to be classified in the target area includes: Performing target detection processing on the acquired current picture, wherein the current picture includes the target area; If the target object does not exist in the current picture, the current picture is photographed to obtain the first image to be classified; Using the first image to be classified as a base image and performing image change detection on the current image to obtain a change detection result of the current image; If the change detection result indicates that a change exists, the current picture is photographed to obtain the second image to be classified.

7. The method according to claim 6, characterized in that The step of photographing the current picture to obtain the first image to be classified includes: Performing a photographing process on the current picture to obtain a first initial image; The first initial image is cropped based on a preset target area to obtain the first image to be classified.

8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.