Target area identification method and device, computer equipment and storage medium
By using a preset mask matrix to detect and reverse mask processing on the target area, the problem of difficult to take into account both the calculation cost and accuracy in the prior art is solved, and efficient and accurate target area recognition is achieved.
Patent Information
- Application Number
- CN202411489561.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to take into account both computational cost and accuracy in target area detection, resulting in a decrease in detection accuracy or wasted computing resources.
By obtaining a plurality of initially recognized images and preset masking matrices of the target object, detection and inverse masking processing are performed to determine the actual range of the target area.
It improves the accuracy and computing efficiency of target area identification, reduces computing costs, and is suitable for applications in static environments.
Smart Images

Figure CN119445105A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition and application technology, and in particular to a target area recognition method, device, computer equipment and storage medium. Background Art
[0002] With the development of science and technology, the application of detecting the area where the target object is located in the image is becoming more and more widespread. For example, in the field of thermal imaging temperature measurement, it is necessary to accurately measure the temperature of the target area corresponding to the target object; or such as the setting and identification of privacy shielding or any other irregular rectangular area, etc. It is understandable that in the detection of the target area of the image, the accuracy of the target area detection is very important.
[0003] In the related art, common detection methods for the target area of an image include: taking an outer frame for the target area and taking the outer rectangular frame as the target area; or detecting the target area with higher accuracy through deep learning methods. As for the above-mentioned existing technologies, the former has the problem of low accuracy in delineating the target area, which will lead to a significant decrease in detection accuracy; and the latter usually consumes a lot of computing resources and has a high cost in practical applications.
[0004] Currently, no effective solution has been proposed for the problem that the detection of target areas in existing technologies cannot take into account both computational cost and accuracy. Summary of the invention
[0005] Based on this, it is necessary to provide a target area recognition method, device, computer equipment and storage medium to address the above technical problems.
[0006] In a first aspect, the present application provides a method for identifying a target area. The method comprises:
[0007] Acquire multiple initial images to be identified of the target object and a preset mask matrix;
[0008] Detecting all initial images to be identified, and determining a plurality of target images to be identified that match the morphological information of the mask matrix from the initial images to be identified;
[0009] Based on the mask matrix, all target images to be identified are subjected to anti-masking processing respectively to determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0010] In one embodiment, obtaining a mask matrix includes:
[0011] Based on the target object, an original image is acquired; wherein the original image includes a target area to be detected corresponding to the target object;
[0012] All pixels of the original image are traversed in turn to determine the target area pixels that belong to the target area. In the preset initial matrix, the matrix elements corresponding to the target area pixels are marked as target masks, and the matrix elements corresponding to the pixels outside the target area are marked as non-target masks. The mask matrix is obtained through the target mask and the non-target mask.
[0013] In one embodiment, mask marking corresponding to pixel points in the target area includes:
[0014] When at least two target objects are detected, at least two different pixel masks are preset, wherein the pixel masks correspond to the target objects one by one;
[0015] Based on the pixel masks, the corresponding target objects are respectively masked and marked to obtain at least one target mask and a non-target mask, and a mask matrix is obtained through all the target masks and non-target masks.
[0016] In one embodiment, traversing all pixels of the original image in sequence to determine the target area pixels belonging to the target area includes:
[0017] Determine the target pixel among the pixels, and generate auxiliary lines for the target pixel. When it is detected that the intersection of the auxiliary line and the boundary of the target area matches the preset intersection rule, the target pixel is judged to belong to the target area. Repeat the above method until all pixels are traversed to determine all target area pixels belonging to the target area.
[0018] In one embodiment, traversing all pixels of the original image in sequence to determine the target area pixels belonging to the target area includes:
[0019] Set the minimum bounding box for each target area;
[0020] The pixel points in the minimum bounding box of the original image are traversed in sequence to determine the target area pixel points belonging to the target area, and the coordinates of the minimum bounding box are saved in a preset database.
[0021] In one embodiment, the target area includes a regular pattern and / or an irregular pattern.
[0022] In a second aspect, the present application also provides a target area recognition device. The device comprises:
[0023] An acquisition module, used to acquire a plurality of initial images to be identified of a target object and a preset mask matrix;
[0024] A calculation module is used to detect all initial images to be identified, and determine a target image to be identified that matches the morphological information of the mask matrix from the initial images to be identified;
[0025] The generation module is used to detect all the initial images to be identified and determine the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified.
[0026] In one of the embodiments, the device further comprises a detection module;
[0027] The detection module is used to detect the target object within the actual range based on the acquired detection method.
[0028] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0029] Acquire multiple initial images to be identified of the target object and a preset mask matrix;
[0030] Detecting all initial images to be identified, and determining the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified;
[0031] Based on the mask matrix, all target images to be identified are subjected to anti-masking processing to determine the actual range of the target area to be detected corresponding to the target object in the target identification image.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0033] Acquire multiple initial images to be identified of the target object and a preset mask matrix;
[0034] Detecting all initial images to be identified, and determining the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified;
[0035] Based on the mask matrix, all target images to be identified are subjected to anti-masking processing to determine the actual range of the target area to be detected corresponding to the target object in the target identification image.
[0036] The above-mentioned target area recognition method, device, computer equipment and storage medium first obtain multiple images to be recognized corresponding to the target object, and the mask matrix corresponding to the target object; then detect the initial image to be recognized, and determine the target image to be recognized that matches the morphological information of the mask matrix from the initial image to be recognized; finally, based on the mask matrix, all target images to be recognized are subjected to anti-mask processing, so as to determine the actual range of the target area to be detected corresponding to the target object in the target image to be recognized. Different from the prior art, in the prior art, before detecting the target object, it is usually necessary to find the area where the target object is located. This traditional method is usually not accurate enough for the division of the target object area, and is relatively inefficient when processing large batches of images. However, the present application can greatly improve the calculation efficiency on the basis of calculating the accurate actual range of the target area through a preset mask matrix, and can achieve the requirements of both calculation cost and accuracy in some relatively static environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A diagram showing an application environment of a target area recognition method in an embodiment;
[0038] Figure 2 is a schematic flow chart of a target area identification method in one embodiment;
[0039] Figure 3 A schematic diagram of a process for generating a mask matrix in one embodiment;
[0040] Figure 4 is a schematic diagram of a process of identifying a target region based on a mask matrix in one embodiment;
[0041] Figure 5 is a structural block diagram of a target area identification device in one embodiment;
[0042] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The target area recognition method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. First, multiple images to be identified corresponding to the target object and the mask matrix corresponding to the target object are obtained; then the initial image to be identified is detected, and the target image to be identified that matches the morphological information of the mask matrix is determined from the initial image to be identified; finally, based on the mask matrix, all target images to be identified are subjected to anti-mask processing, so as to determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0045] In one embodiment, Figure 2 As shown, a target area recognition method is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0046] Step S110, obtaining a plurality of initial to-be-recognized images of the target object and a preset mask matrix.
[0047] Specifically, the target objects are mostly static objects, and the above-mentioned initial image to be identified can be obtained by photographing, thermal imaging or scanning the target objects according to actual needs. Further, the above-mentioned preset mask matrix includes mask elements corresponding to the above-mentioned target objects, wherein the mask matrix generally includes mask elements corresponding to the target objects and mask elements corresponding to non-target objects. In order to reduce unnecessary calculation overhead, the mask elements corresponding to non-target objects should be the same. And in order to ensure the accuracy of the calculation, there is a more obvious difference between the mask elements corresponding to the target objects and the mask elements corresponding to the non-target objects, such as the mask elements corresponding to the target objects can be set to 1, and the mask elements corresponding to the non-target objects can be set to 0.
[0048] Step S120 , detecting all the initial images to be recognized, and determining a plurality of target images to be recognized that match the morphological information of the mask matrix from the initial images to be recognized.
[0049] Specifically, the initial image to be identified is detected, and the target image to be identified that matches the mask matrix is screened out from the initial image to be identified, wherein, in order to ensure the accuracy of the subsequent division of the actual range of the target area to be detected, it is necessary to determine the target image to be identified that matches the morphological information of the mask matrix from the initial image to be identified. The morphological information is used to indicate the morphological features of the elements included in the initial image to be identified and the mask matrix. In practical applications, the morphology corresponding to the target image to be identified and the target object in the mask matrix, the position of the target object, and other information should all match. In some embodiments, the matching method for the initial image to be identified and the mask matrix includes but is not limited to detecting the similarity of the actual range occupied by the initial image to be identified and the target object in the mask matrix. If the similarity is greater than a preset threshold, it is determined that the two match. In other embodiments, the target object itself can be directly detected. If it is detected that the target object has been deformed, moved, etc., a timestamp can be set accordingly, and the initial image to be identified obtained after the morphological features of the target object change is judged to be mismatched with the mask matrix. It is understandable that any method that can achieve matching between the mask matrix and the initial image to be identified based on morphological features should fall within the protection scope of the present application and will not be described in detail here.
[0050] In some application scenarios, such as when detecting the temperature of a target object, the temperature of the target object can be measured in real time by thermal imaging. In the prior art, the minimum bounding rectangle is usually taken for the area where the target object is located, and the maximum, minimum and average values of the grayscale of the pixels in the minimum bounding rectangle are calculated for the pixels in the minimum bounding rectangle. However, there is still a part of the area in the minimum bounding rectangle that belongs to the area outside the area where the target object is located. Therefore, when calculating the temperature by the existing traditional method, it is very likely that the temperature values of the pixels outside the target area will be counted, resulting in incorrect temperature detection results. In the present application, the precise position of the target object in the thermal imaging image is directly determined by a preset mask matrix, thereby greatly improving the accuracy of temperature detection and effectively improving the calculation efficiency. In other application scenarios, such as when blocking a privacy area, it is usually necessary to set an irregular rectangular mask matrix. At this time, the mask matrix can be quickly and flexibly set by the present application, so as to quickly identify the privacy area and perform corresponding processing. Furthermore, in the application scenario of the present application, in order to ensure calculation efficiency, the scene where the target object is located should be relatively static.
[0051] Step S130 , based on the mask matrix, respectively perform anti-masking processing on all target images to be identified, and determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0052] Specifically, based on a preset mask matrix, the target image to be identified can be subjected to an inverse mask process, thereby determining the actual range of the target area to be detected in the target image to be identified. Based on the present application, those skilled in the art can understand that the actual range of the target area to be detected obtained by the present embodiment is for the precise position of the target object, does not include redundant elements or pixels, and thus can effectively improve the accuracy of target area recognition. And further, the present application can perform an inverse mask process on multiple target images to be identified through a mask matrix. Since the present application is applied in a relatively static scene, there is no change in morphological features or position with the target object in multiple target images to be identified, thereby being able to efficiently process a large number of target images to be identified.
[0053] Through steps S110 to S130, in a relatively static application scenario, the matched target image to be identified is subjected to anti-masking processing through a preset mask matrix, thereby determining the actual range of the target area to be detected corresponding to the target object in the target image to be identified. The above method can significantly increase the efficiency of target area identification while effectively improving the accuracy of target area identification.
[0054] In one embodiment, the method further comprises:
[0055] Based on the target object, an original image is acquired; wherein the original image includes a target area to be detected corresponding to the target object;
[0056] All pixels of the original image are traversed in turn to determine the target area pixels that belong to the target area. In the preset initial matrix, the matrix elements corresponding to the target area pixels are marked as target masks, and the matrix elements corresponding to the pixels outside the target area are marked as non-target masks. The mask matrix is obtained through the target mask and the non-target mask.
[0057] Specifically, a corresponding original image is obtained based on the target object, wherein the original image can be obtained by photographing, thermal imaging, scanning, etc. of the target object according to actual needs. It can be understood that the obtained original image should be the same as the target image to be identified described above, or the similarity between the original image and the actual range corresponding to the target object in the target image to be identified should be greater than a preset threshold. In some embodiments, the threshold can be set to 90%, wherein the target area is the area corresponding to the target object in the original image.
[0058] According to the preset traversal rules, all pixels in the original image are traversed to determine the target area pixels belonging to the target area. The traversal rules can be set by relevant personnel according to actual needs, such as from top to bottom, from left to right, etc. The method for determining the target area pixels includes but is not limited to manually judging whether the traversed pixels belong to the target area, or judging which pixels are located in the target area and which are located outside the target area by computer image science, or segmenting the accurate target area by a well-trained neural network, etc. After determining the target area pixels, the matrix elements corresponding to the target area pixels are marked as target masks, and the matrix elements corresponding to the pixels outside the target area are marked as non-target masks, so as to obtain a mask matrix through the target mask and the non-target mask. The above method can generate an accurate mask matrix, which lays the foundation for the subsequent division of the actual range of the target area to be detected.
[0059] In one embodiment, the method further comprises:
[0060] When at least two target objects are detected, at least two different pixel masks are preset, wherein the pixel masks correspond to the target objects one by one;
[0061] Based on the pixel masks, the corresponding target objects are respectively masked and marked to obtain at least one target mask and a non-target mask, and a mask matrix is obtained through all the target masks and non-target masks.
[0062] Specifically, when there are multiple target objects, different pixel masks need to be preset for different target objects, such as the mask corresponding to target object 1 is set to 1, the mask corresponding to target object 2 is set to 2, and so on. Mask marking is performed based on different target objects to obtain a variety of target masks and non-target masks, thereby obtaining the above-mentioned mask matrix. When there are multiple target objects, the method in this embodiment can be used to improve the target recognition efficiency, and on this basis, the accuracy of target area recognition is also guaranteed, thereby achieving the simultaneous identification of areas corresponding to multiple target objects and performing corresponding detection on each area.
[0063] In one embodiment, the method further comprises:
[0064] Determine the target pixel among the pixels, and generate auxiliary lines for the target pixel. When it is detected that the intersection of the auxiliary line and the boundary of the target area matches the preset intersection rule, the target pixel is judged to belong to the target area. Repeat the above method until all pixels are traversed to determine all target area pixels belonging to the target area.
[0065] Specifically, in this embodiment, the geometric features of the target area can be used to determine whether the traversed pixel points belong to the target area. In some preferred embodiments, the method of this embodiment can be used in a scene where the target area is an irregular shape. The target pixel point among the pixels is randomly determined, and an auxiliary line is generated based on the target pixel point. The auxiliary line should be a straight line, and then the intersection of the auxiliary line and the boundary of the target area is detected. It can be understood that if the target pixel point is located inside the closed target area, the number of intersection points on both sides of the auxiliary line should be an odd number; if the target pixel point is located outside the closed target area, the number of intersection points on both sides of the auxiliary line with the boundary of the target area should be an even number. Since this embodiment is to determine the target area pixel points belonging to the target area, that is, to find the pixel points located inside the closed target area, the above-mentioned preset intersection rule should be that the number of intersection points on both sides of the auxiliary line with the boundary of the target area should be an odd number. If it matches the intersection rule, it indicates that the target pixel point belongs to the target area. If it does not match, it indicates that the target pixel point does not belong to the target area. The above method is repeated to traverse all pixel points in turn, so as to determine all target area pixel points belonging to the target area in the original image.
[0066] In some embodiments, the method further comprises:
[0067] Set the minimum bounding box for each target area;
[0068] The pixel points in the minimum bounding box of the original image are traversed in sequence to determine the target area pixel points belonging to the target area, and the coordinates of the minimum bounding box are saved in a preset database.
[0069] Specifically, a minimum bounding box is generated for the target area in the original image. In practical applications, the target area may be a regular shape, such as a circle, a square, etc., or an irregular shape. In this embodiment, a minimum bounding box is generated for all target areas.
[0070] Then, the pixels in the minimum bounding box are traversed in sequence to determine the target area pixels belonging to the target area, thereby laying a foundation for marking the matrix elements based on the target area pixels in the subsequent steps. Further, after the target area pixels are determined, the coordinates of the minimum bounding box can be saved in a preset database, and after the subsequent target mask and non-target mask marking are completed, the mask matrix is also saved in the database, thereby speeding up the efficiency of the subsequent recognition of the actual range of the target area to be detected based on the mask matrix. Through this embodiment, the calculation efficiency can be effectively accelerated, and the calculation of redundant pixels is greatly reduced.
[0071] In some embodiments, the method further comprises:
[0072] The target area includes regular patterns and / or irregular patterns.
[0073] This embodiment also provides a preferred embodiment of a target area recognition method.
[0074] First we need to generate the required mask matrix. Figure 3 The flowchart of generating a mask matrix in an embodiment is as follows: first, an original image corresponding to a target object is obtained, and the original image includes a target area to be detected corresponding to the target object. The minimum bounding box corresponding to the target area is determined. In this embodiment, the minimum bounding box is a minimum bounding rectangle. Then, the pixel points in the minimum bounding rectangle are traversed, and the intersection of the auxiliary lines of the pixel points and the boundary of the target area is used to determine which pixel points in the minimum bounding rectangle belong to the target area, that is, the pixel points of the target area, and which pixel points belong to the outside of the target area, and the matrix elements corresponding to the pixel points in the target area are marked as target masks, and the matrix elements corresponding to the pixel points outside the target area are marked as non-target masks. The above steps are repeated until all the pixel points in the minimum bounding rectangle are traversed, and the matrix elements are marked corresponding to the pixel points, and all the above non-target masks and target masks are aggregated together, so as to obtain a mask matrix through the target mask and the non-target mask, wherein the mask matrix is saved, and in some embodiments, the minimum bounding rectangle corresponding to the target area can also be saved synchronously.
[0075] After obtaining the mask matrix, the target area of multiple target images to be identified is identified through the mask matrix. Figure 4 The figure is a flowchart of target area recognition based on a mask matrix in one embodiment. After obtaining the mask matrix including the coordinates of the minimum circumscribed rectangle, a plurality of initial images to be recognized are obtained by shooting, scanning, thermal imaging, etc. of the corresponding target object, and then the initial images to be recognized are matched with the mask matrix to obtain the target image to be recognized, wherein the target image to be recognized and the morphology corresponding to the target object in the mask matrix, the position of the target object and other information should all match. Then, based on the mask matrix, the pixel points corresponding to the target mask in the minimum circumscribed rectangle are determined. After the pixel points corresponding to the target mask of all target areas are determined, the anti-mask processing is performed and the actual range of the target area to be detected is output. The relevant technicians can perform subsequent calculations based on the actual range, such as calculating the temperature of the target object according to the actual range in the thermal imaging scene, and accurately and flexibly setting the mask matrix in the privacy shielding scene, so as to facilitate subsequent calculations.
[0076] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0077] Based on the same inventive concept, the embodiment of the present application also provides a target region identification device for implementing the target region identification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more target region identification device embodiments provided below can refer to the limitations of the target region identification method above, and will not be repeated here.
[0078] In one embodiment, Figure 5 As shown, a target area recognition device is provided, including: an acquisition module 51, a calculation module 52 and a generation module 53, wherein:
[0079] An acquisition module 51 is used to acquire a plurality of initial images to be identified of a target object and a preset mask matrix;
[0080] A calculation module 52 is used to detect all initial images to be identified, and determine a target image to be identified that matches the morphological information of the mask matrix from the initial images to be identified;
[0081] The generating module 53 is used to perform anti-masking processing on all target images to be identified based on the mask matrix, and determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0082] Specifically, the acquisition module 51 acquires multiple initial images to be identified and a preset mask matrix corresponding to the target object, and sends the initial images to be identified and the mask matrix to the calculation module 52. The calculation module 52 detects all the initial images to be identified, and determines the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified. Then, the calculation module 52 sends the target images to be identified and the mask matrix to the generation module 53. The generation module 53 performs de-masking processing on all the target images to be identified based on the mask matrix, so as to obtain the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0083] Each module in the above-mentioned target area recognition device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0084] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target area identification related data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a target area identification method is implemented.
[0085] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0086] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0087] Acquire multiple initial images to be identified of the target object and a preset mask matrix;
[0088] Detecting all initial images to be identified, and determining the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified;
[0089] Based on the mask matrix, all target images to be identified are subjected to anti-masking processing respectively to determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0090] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0091] Acquire multiple initial images to be identified of the target object and a preset mask matrix;
[0092] Detecting all initial images to be identified, and determining the target images to be identified that match the morphological information of the mask matrix from the initial images to be identified;
[0093] Based on the mask matrix, all target images to be identified are subjected to anti-masking processing respectively to determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0095] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0096] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A target area recognition method, characterized in that: The method comprises: Acquire multiple initial images to be identified of the target object and a preset mask matrix; Detecting all the initial images to be recognized, and determining a plurality of target images to be recognized that match the morphological information of the mask matrix from the initial images to be recognized; Based on the mask matrix, anti-masking processing is performed on all the target images to be identified respectively to determine the actual range of the target area to be detected corresponding to the target object in the target images to be identified.
2. The method according to claim 1, characterized in that Obtaining the mask matrix includes: Based on the target object, an original image is acquired; wherein the original image includes a target area to be detected corresponding to the target object; All pixel points of the original image are traversed in sequence to determine the target area pixel points belonging to the target area, and in a preset initial matrix, the matrix elements corresponding to the target area pixel points are marked as target masks, and the matrix elements corresponding to the pixel points outside the target area are marked as non-target masks, and the mask matrix is obtained through the target mask and the non-target mask.
3. The method according to claim 2, characterized in that The mask marking corresponding to the pixel points in the target area includes: When at least two target objects are detected, presetting at least two different pixel masks, wherein the pixel masks correspond to the target objects one by one; Based on the pixel masks, the corresponding target objects are respectively masked and marked to obtain at least one of the target masks and the non-target masks, and the mask matrix is obtained through all the target masks and the non-target masks.
4. The method according to claim 2, characterized in that: The step of sequentially traversing all pixels of the original image to determine the target area pixels belonging to the target area includes: Determine a target pixel point among the pixel points, and generate an auxiliary line for the target pixel point. When it is detected that the intersection of the auxiliary line and the boundary of the target area matches a preset intersection rule, determine that the target pixel point belongs to the target area. Repeat the above method until all the pixel points are traversed to determine all the target area pixel points that belong to the target area.
5. The method according to claim 2, characterized in that: The step of sequentially traversing all pixels of the original image to determine the target area pixels belonging to the target area includes: Setting a minimum bounding box for each target area; The pixel points in the minimum bounding box of the original image are traversed in sequence to determine the pixel points of the target area belonging to the target area, and the coordinates of the minimum bounding box are saved in a preset database.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The target area includes regular patterns and / or irregular patterns.
7. A target area recognition device, characterized in that: The device comprises: An acquisition module, used to acquire a plurality of initial images to be identified of a target object and a preset mask matrix; A calculation module, used for detecting all the initial images to be identified, and determining a target image to be identified that matches the morphological information of the mask matrix from the initial images to be identified; A generating module is used to perform inverse mask processing on all the target images to be identified based on the mask matrix, and determine the actual range of the target area to be detected corresponding to the target object in the target image to be identified.
8. The device according to claim 7, characterized in that The device also includes a detection module; The detection module is used to detect the target object within the actual range based on the acquired detection method.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.