Target object detection region determination method, device, equipment and storage medium

By automatically identifying and editing the detection region of the target object image, and combining the positional affine transformation relationship, the problem of low efficiency in detection region determination in the prior art is solved, and efficient and accurate detection region determination is achieved.

CN115797615BActive Publication Date: 2025-11-28SHENZHEN SMARTMORE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211439278.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2025-11-28
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in determining the target object detection area, relying on manual operation, which is inefficient.

Method used

By performing detection region recognition on the target object image, multiple initial detection regions are automatically identified and highlighted. Users can refer to these regions for editing operations and determine the final detection region using positional affine transformation relationships. Combined with human-computer interaction, this improves efficiency.

Benefits of technology

It improves the efficiency and accuracy of detection area recognition, and achieves efficient determination of the overall detection area of ​​the target object image through automatic recognition and editing functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797615B_ABST
    Figure CN115797615B_ABST
Patent Text Reader

Abstract

The application relates to a target object detection region determination method and device, equipment and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: highlighting a plurality of initial detection regions identified in a target object image by performing detection region identification on the target object image; determining a target sub-object image specified from a plurality of sub-object images; in response to a detection region editing operation performed on the target sub-object image with reference to the initial detection region in the target sub-object image, performing corresponding detection region editing processing on a target region in the target sub-object image acted on by the detection region editing operation; and determining a corresponding region of the target region in a non-target sub-object image according to a position affine transformation relationship between the target sub-object image and the non-target sub-object image, and performing detection region editing processing on the corresponding region to obtain a detection region determination result. The method can improve the determination efficiency of the detection region.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to a target object detection region determination method and device, equipment and a storage medium. BACKGROUND

[0002] With the rapid development of computer vision technology, it is an indispensable step to detect a target object. For example, in order to optimize the target object, or for the reason of improving the quality of the target object, it is necessary to detect defects of the target object. Before detecting the target object, it is usually necessary to determine a detection region in an image including the target object, so as to reduce the detection range and improve the detection efficiency. At present, the detection region is usually manually determined by a person from the image including the target object, but the efficiency of the manual detection region determination is very low. SUMMARY

[0003] Therefore, it is necessary to provide a target object detection region determination method, device, equipment and storage medium capable of improving the determination efficiency of the detection region.

[0004] In a first aspect, the present application provides a target object detection region determination method. The method comprises:

[0005] performing detection region identification on the target object image to highlight a plurality of initial detection regions identified in the target object image; the target object image comprises a plurality of sub-object images; the plurality of sub-object images are images of a plurality of sub-objects with the same structure of the target object;

[0006] determining a target sub-object image from the plurality of sub-object images; the target sub-object image comprises a part of the initial detection regions in the plurality of initial detection regions;

[0007] performing corresponding detection region editing processing on the target region in response to a detection region editing operation on the target sub-object image referring to the initial detection region in the target sub-object image; the target region is a region acted on by the detection region editing operation in the target sub-object image;

[0008] determining a corresponding region of the target region in the non-target sub-object image according to a position affine transformation relationship between the target sub-object image and the non-target sub-object image, and performing detection region editing processing on the corresponding region to obtain a detection region determination result.

[0009] In a second aspect, the present application further provides a target object detection region determination device. The device comprises:

[0010] The region identification module is configured to perform region identification on the target object image to highlight a plurality of initial detection regions in the target object image; the target object image comprises a plurality of sub-object images; the plurality of sub-object images are images of a plurality of sub-objects of the target object, which have the same structure;

[0011] The image determination module is configured to determine a target sub-object image from the plurality of sub-object images; the target sub-object image comprises a part of the plurality of initial detection regions;

[0012] The region editing module is configured to perform corresponding detection region editing processing on a target region in response to a detection region editing operation performed on the target sub-object image with reference to an initial detection region in the target sub-object image; the target region is a region in the target sub-object image on which the detection region editing operation is performed;

[0013] The region determination module is configured to determine a corresponding region of the target region in a non-target sub-object image according to a position affine transformation relationship between the target sub-object image and the non-target sub-object image, and perform detection region editing processing on the corresponding region to obtain a detection region determination result.

[0014] In some embodiments, the region identification module is further configured to calculate a specific shape similarity of each graph element according to a graph element contour of each graph element in the target object image; and determine the plurality of initial detection regions in a region in which a plurality of first graph elements with a specific shape similarity greater than a preset similarity threshold are located, and highlight the plurality of initial detection regions in the target object image.

[0015] In some embodiments, the region identification module is further configured to determine a shape attribute parameter of the plurality of first graph elements for reflecting a shape feature; select a plurality of second graph elements with a shape attribute parameter within a preset shape parameter range from the plurality of first graph elements; and determine a region in which the plurality of second graph elements are located as the plurality of initial detection regions.

[0016] In some embodiments, the region editing module is further configured to determine a target region in the target sub-object image on which a detection region editing operation is performed in response to the detection region editing operation performed on the target sub-object image with reference to an initial detection region in the target sub-object image; identify graph elements in the target region to obtain at least one target graph element; each target graph element is a complete graph element or a part of a complete graph element; and perform detection region editing processing on the at least one target graph element.

[0017] In some embodiments, the region editing module is further configured to determine a region contour of the target region in the target sub-object image according to a vertex coordinate of the target region in the target sub-object image; and determine a graph element in the region contour as a target graph element.

[0018] In some embodiments, the region editing module is further configured to, in a case where the detected region editing operation is a detected region adding operation, highlight a region in which the target graph element is located in the target sub-object graph to obtain an added detected region; and in a case where the detected region editing operation is a detected region deleting operation, unhighlight an initial detected region corresponding to the target graph element in the target sub-object graph.

[0019] In some embodiments, the region determining module is further configured to calculate a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph according to position information and angle information of the target sub-object graph and the non-target sub-object graph in the target object image respectively; and map the target region to a corresponding region in the non-target sub-object graph after position affine transformation according to position information of the target region in the target sub-object graph and the position affine transformation relationship.

[0020] In a third aspect, the present application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the target object detected region determining method when executing the computer program.

[0021] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the target object detected region determining method when executed by a processor.

[0022] In a fifth aspect, the present application further provides a computer program product, which comprises a computer program, and the computer program implements the steps of the target object detected region determining method when executed by a processor.

[0023] The aforementioned method, apparatus, computer device, storage medium, and computer program product for determining the detection region of a target object automatically identify the detection region of an image comprising multiple sub-object images, thereby obtaining multiple initial detection regions. This automatic identification improves the efficiency of detection region recognition. In addition to automatic detection region recognition, a human-computer interaction function for editing the detection region is provided. Specifically, multiple identified initial detection regions are highlighted in the target object image, and a target sub-object image is specified from the multiple sub-object images, including a portion of the initial detection regions. In response to a detection region editing operation performed on the target sub-object image with reference to the initial detection regions in the target sub-object image, corresponding detection region editing processing is performed on the target region in the target sub-object image where the detection region editing operation is applied. Based on the affine transformation relationship between the target sub-object image and non-target sub-object images, the corresponding region of the target region in the non-target sub-object image is determined, and detection region editing processing is performed on the corresponding region to obtain the detection region determination result. In other words, this application improves the accuracy of detection area determination by correcting the detection area based on automatic identification of the detection area. On this basis, by determining a portion of the target object image as a sub-object image, the detection area can be edited and processed only on the sub-object image to achieve the effect of detection area identification of the entire target object image, thereby further improving the efficiency of detection area determination. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the method for determining the detection region of a target object in some embodiments;

[0025] Figure 2 This is a flowchart illustrating the method for determining the detection region of a target object in other embodiments;

[0026] Figure 3 This is a flowchart illustrating the method for determining the detection region of a target object in other embodiments;

[0027] Figure 4 This is a structural block diagram of a target object detection area determination device in some embodiments;

[0028] Figure 5 These are internal structural diagrams of the computer device in some embodiments;

[0029] Figure 6 This is an internal structural diagram of a computer device in some other embodiments. Detailed Implementation

[0030] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination 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 not used to limit the present application.

[0031] In some embodiments, as shown in Figure 1 A target object detection area determination method is provided, and the present embodiment is exemplified by the method applied to a computer device. It should be understood that the computer device can be a server or a terminal, and the method can be implemented by the server or the terminal alone or through interaction between the server and the terminal. In the present embodiment, the method includes but is not limited to the following steps:

[0032] In step 102, the initial detection areas identified in the target object image are highlighted by detecting the target object image.

[0033] The target object is an object that needs to be detected, and the target object has a plurality of sub-objects with the same structure.

[0034] The target object can be some electronic components in the industrial field. In some embodiments, the target object can be a printed circuit board (PCB), which refers to the support body of electronic components and is also the carrier of electrical interconnection of electronic components. Since the PCB is made by electronic printing, it is also called a "printed" circuit board. It should be understood that the target object is not limited to an object in the industrial field that needs to be detected, but can also be an object in other fields that has a plurality of sub-objects with the same structure.

[0035] The target object image is an image obtained by image acquisition equipment for image acquisition of the target object. The image acquisition equipment refers to a device with a photographing function, which can be but is not limited to various cameras and mobile devices.

[0036] The sub-object refers to a component part with the same structure and fixed position in the target object. In some embodiments, if the target object is an electronic component, the sub-object can be an electronic component with the same structure and fixed position. In the present embodiment, the sub-object refers to PCS. PCS is the abbreviation of Pieces, which is a unit of measurement, referring to the plural of number, piece, and unit. PCS is commonly seen on packaging labels, indicating how many units are contained in the package, such as: a PCB package marked "2 / PCS" means that a PCB contains 2 components with the same structure.

[0037] In addition, in the actual production of the PCB, a whole PCB is usually printed with multiple arranged PCSs which have the same structure and fixed positions. After the detection area in the PCB is finally identified, the multiple PCSs in the PCB can be cut to be used individually. It can be understood that after the PCB is cut, each PCS obtained after the cutting can be used as an independent PCB.

[0038] It should be noted that if the target object has multiple sub-objects with the same structure, the target object image also includes multiple sub-object images. The multiple sub-object images are images of the multiple sub-objects with the same structure possessed by the target object.

[0039] The preset specific shape refers to a specified geometric shape, including at least one of a rectangle, a circle, a ring, or an irregular line.

[0040] The detection area refers to an area that needs to be determined in the image and is used for targeted detection of the image.

[0041] Specifically, the computer device performs detection area identification on the target object image and automatically identifies multiple initial detection areas with the preset specific shape. Then, the computer device highlights the multiple initial detection areas identified in the target object image. Highlighting the multiple initial detection areas identified by the computer device can enable the user to directly see the result of automatic identification of the area, and on this basis, subsequent manual adjustment is performed as a reference.

[0042] It can be understood that highlighting the multiple initial detection areas in the target object image refers to highlighting the area positions of the multiple initial detection areas in the target object image, which can enable the user to more clearly know the specific orientation of the multiple initial detection areas in the target object image.

[0043] In some embodiments, highlighting includes, but is not limited to, at least one of taking the multiple initial detection areas as the foreground of the target object image, highlighting the multiple initial detection areas, color filling the multiple initial detection areas, text labeling the multiple initial detection areas, or drawing a display box corresponding to the range of the multiple initial detection areas.

[0044] Step 104, determining a target sub-object image specified from the multiple sub-object images.

[0045] The target sub-object graph includes part of the plurality of initial detection regions. It should be noted that when the automatic recognition effect is not ideal, the detection region may not be included, at which time the initial detection region can be re-identified automatically, and then the detection region editing process can be performed manually. The detection region editing process can also be directly performed manually on the target sub-object graph, such as detection region addition processing.

[0046] Specifically, the computer device can randomly select one of the plurality of sub-object graphs as the target sub-object graph. In addition, the user can also specify one of the plurality of sub-object graphs as the target sub-object graph. For example, the user can select one of the plurality of sub-object graphs displayed on the interactive interface, and the computer device responds to the user's selection operation to select the sub-object as the target sub-object graph.

[0047] Step 106, in response to the detection region editing operation on the target sub-object graph with reference to the initial detection region in the target sub-object graph, performing corresponding detection region editing processing on the target region.

[0048] The detection region editing operation refers to an operation for determining a detection region that needs to be edited in the target sub-object graph, that is, the target region. The target region is the region acted on by the detection region editing operation in the target sub-object graph.

[0049] In some embodiments, the detection region editing operation includes a detection region addition operation, that is, an operation for determining a target region that needs to be added in the target sub-object graph. It can be understood that the user can click the add region control in the interactive interface to indicate that the region determined by the user in the target sub-object graph is a target region that needs to be added. The user can determine the region acted on in the target sub-object graph as the target region that needs to be added by clicking or framing any region in the target sub-object graph.

[0050] In some embodiments, the detection region editing operation includes a detection region deletion operation, that is, an operation for determining a target region that needs to be deleted in the target sub-object graph. It can be understood that the user can click the delete region control in the interactive interface to indicate that the region determined by the user in the target sub-object graph is a target region that needs to be deleted. The user can determine the region acted on in the target sub-object graph as the target region that needs to be deleted by clicking or framing any region in the target sub-object graph.

[0051] Specifically, the user can refer to the initial detection region automatically identified by the computer device, and determine whether to supplement some detection regions not identified by the computer device on the basis of the initial detection region, or whether to delete a part of the detection regions identified by the computer device, so as to perform a supplement or deletion operation of the detection region on the target sub-object graph, and determine the target region that needs to be supplemented or deleted in the target sub-object graph. The computer device responds to the supplement or deletion operation of the detection region on the target sub-object graph, and performs corresponding supplement or deletion processing of the detection region on the target region acted on by the detection region editing operation in the target sub-object graph.

[0052] In step 108, the corresponding region of the target region in the non-target sub-object graph is determined according to the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, and the detection region editing processing is performed on the corresponding region to obtain the detection region determination result.

[0053] The non-target sub-object graph refers to a sub-object graph in the plurality of sub-object graphs, except for the target sub-object graph. Affine transformation, also known as affine mapping, refers to a linear transformation of a vector space in geometry and a translation, which is transformed into another vector space. The position affine transformation relationship refers to the position mapping conversion relationship between the target sub-object graph and the non-target sub-object graph. Through the position affine transformation relationship, it can be determined which position or region in the target sub-object graph corresponds to which position or region in the non-target object graph.

[0054] Specifically, the computer device determines the corresponding region of the target region in the non-target sub-object graph according to the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph determined in advance, or the computer device determines the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph according to the position information and angle information of the target sub-object graph and the non-target sub-object graph in the target object image, and then determines the corresponding region of the target region in the non-target sub-object graph according to the position affine transformation relationship. The computer device performs the same detection region editing processing on the corresponding region as the target sub-object graph to obtain the detection region determination result. According to the detection region determination result, the final determined detection region in the target object image can be extracted.

[0055] The above target object detection region determination method can improve the detection region recognition efficiency by automatically recognizing the detection region of the target object image including multiple sub-object images. On the basis of automatically recognizing the detection region, human-computer interaction is further provided to perform the detection region editing function. Specifically, the multiple initial detection regions recognized in the target object image are highlighted, and a target sub-object image is determined from the multiple sub-object images, the target sub-object image including part of the multiple initial detection regions; in response to the detection region editing operation on the target sub-object image with reference to the initial detection region in the target sub-object image, the corresponding detection region editing processing is performed on the target region in the target sub-object image affected by the detection region editing operation, the corresponding region of the target region in the non-target sub-object image is determined according to the position affine transformation relationship between the target sub-object image and the non-target sub-object image, and the detection region editing processing is performed on the corresponding region to obtain the detection region determination result. That is, the application can correct the detection region on the basis of automatically recognizing the detection region, improve the accuracy of the detection region determination result, and further improve the detection region determination efficiency by determining part of the target sub-object image in the target object image, performing the detection region editing operation and processing on the target sub-object image, and realizing the detection region recognition effect of the whole target object image.

[0056] In some embodiments, step 102 specifically includes but is not limited to: calculating the specific shape similarity of each graph element according to the graph element contour of each graph element in the target object image; determining multiple initial detection regions from the region where multiple first graph elements with a specific shape similarity greater than a preset similarity threshold are located, and highlighting the multiple initial detection regions in the target object image.

[0057] Wherein, the graph element refers to a basic graphic element, which is composed of several different point, line, surface patterns or the same pattern cycle combination, and the point, line and surface patterns are the graph elements.

[0058] In some embodiments, the preset similarity threshold can be input by the user in the parameter input box of the interactive interface. It can be understood that the preset similarity threshold corresponding to different preset specific shapes is different.

[0059] Specifically, the computer device identifies all the graph elements in the target object image, performs contour extraction on each graph element by using a contour extraction algorithm in computer vision to obtain a graph element contour of each graph element. The computer device calculates a specific shape similarity of each graph element. If the specific shape similarity between a certain graph element and the preset specific shape is greater than a preset similarity threshold, it means that the graph element is very likely to be the same as or similar to the preset specific shape. If the specific shape similarity between a certain graph element and the preset specific shape is less than or equal to the preset similarity threshold, it means that the graph element is not similar to the preset specific shape. The computer device determines the graph elements with the specific shape similarity greater than the preset similarity threshold as first graph elements, and determines a plurality of initial detection regions from a region where the plurality of first graph elements are located. In addition, the computer device highlights the plurality of initial detection regions in the target object image to prompt that the highlighted part is the preliminary detection region determination result. The present application can improve the processing efficiency by screening out the first graph elements matching the preset specific shape in the automatic identification stage.

[0060] It can be understood that the initial detection region can include only one graph element or a plurality of graph elements, and the present application does not specifically limit the number of specific graph elements in the initial detection region.

[0061] It should be noted that the preset specific shape refers to a geometric shape specified in advance. In some embodiments, the preset specific shape can be at least one of a rectangle, a circle, a ring, or an irregular line. The irregular line refers to a shape displayed in a strip shape. In the case where the preset specific shape is a rectangle, the specific shape similarity of a certain graph element is the area ratio between the outer contour of the graph element and the maximum circumscribed rectangle of the graph element. In the case where the preset specific shape is a circle, the specific shape similarity of a certain graph element is the curvature of the outer contour of the graph element. In the case where the preset specific shape is a ring, the specific shape similarity of a certain graph element is the minimum value of the curvatures of the outer contour and the inner contour of the graph element. In the case where the preset specific shape is an irregular line, the specific shape similarity of a certain graph element is the ratio of the maximum length to the maximum width of the graph element.

[0062] In some embodiments, in order to improve the calculation accuracy, the computer device can further perform a binarization processing on the target object image to obtain a binarized image, and perform contour recognition on the graph elements of the binarized image to obtain the graph element contours of the graph elements.

[0063] In some embodiments, the step of "determining a plurality of initial detection regions from a region where a plurality of first graph elements with the specific shape similarity greater than the preset similarity threshold are located" specifically includes but is not limited to: determining shape attribute parameters of the plurality of first graph elements for reflecting shape features; screening a plurality of second graph elements with the shape attribute parameters within a preset shape parameter range from the plurality of first graph elements; and determining a region where the plurality of second graph elements are located as the plurality of initial detection regions.

[0064] It can be understood that one initial detection region can only contain one second grapheme, and one initial detection region can also contain multiple second graphemes. Assuming that the target object image includes three second graphemes, namely grapheme A, grapheme B and grapheme C, the region where the grapheme A is located can be determined as the first initial detection region, the region where the grapheme B is located can be determined as the second initial detection region, and the region where the grapheme C is located can be determined as the third initial detection region. In addition, the region where the grapheme A, the grapheme B and the grapheme C are located together can also be determined as an initial detection region, and the present application does not make specific limitation thereto.

[0065] The shape attribute parameter is used to reflect the shape feature of the first grapheme, and the shape attribute parameter includes at least one of the length, the width, the inner diameter or the outer diameter.

[0066] In some embodiments, the preset shape parameter range can be obtained by the user inputting in the parameter input box of the interaction interface, and the preset shape parameter range includes at least one of the length range, the width range, the inner diameter range or the outer diameter range.

[0067] Specifically, the computer device determines the shape attribute parameter of the first grapheme for reflecting the shape feature. The computer device compares the shape attribute parameter of each first grapheme with the preset shape parameter range to identify whether the shape attribute parameter of the first grapheme is within the preset shape parameter range. If the shape attribute parameter of the first grapheme is within the preset shape parameter range, it indicates that the shape of the first grapheme is closer to the preset specific shape, and the computer device screens multiple second graphemes with the shape attribute parameter within the preset shape parameter range from the multiple first graphemes, and determines the region where the multiple second graphemes are located as multiple initial detection regions. The present application screens the second grapheme closer to the preset specific shape through the shape attribute parameter on the basis of determining the first grapheme, which can further ensure the accuracy of the multiple initial detection regions obtained by automatic identification.

[0068] In some embodiments, step 106 specifically includes but is not limited to: in response to a detection region editing operation on the target sub-object graph referring to the initial detection region in the target sub-object graph, determining a target region in the target sub-object graph acted on by the detection region editing operation; identifying graphemes in the target region to obtain at least one target grapheme; and performing detection region editing processing on the at least one target grapheme.

[0069] Each target grapheme is a complete grapheme or a part of a complete grapheme.

[0070] In some embodiments, the computer device can determine the region selected by the user in the interactive interface as the target region. It can be understood that, in order to implement the high degree of freedom of the user in selecting the region, the present application can also provide two selection modes of rectangular frame selection and polygon frame selection by constructing a frame selection management tool, and record all the editing operations of the detection region in the management tool to support the undo and restore of single-step operations, and also can delete the detection region automatically identified or manually selected before.

[0071] In some embodiments, both pixel-level and primitive-level selection modes of the detection region can be provided in the interactive interface. The pixel-level selection mode is more flexible, which can ensure that the user can frame any detection region in the target sub-object graph in the interactive interface, and each target primitive in the detection region can be a complete primitive or a part of a primitive. The primitive-level selection mode is more convenient, and the user can only frame a small area of a target primitive in the target sub-object graph in the interactive interface, and the computer device can automatically extract all complete target primitives containing the small area.

[0072] Specifically, the user can refer to the initial detection region automatically identified by the computer device, and determine whether to supplement some detection regions not identified by the computer device on the basis of the initial detection region, or whether to delete a part of the detection regions identified by the computer device, to perform a supplement or deletion operation on the detection region of the target sub-object graph, and determine the target region to be supplemented or deleted in the target sub-object graph. The computer device determines the target region desired to be supplemented or deleted by the user in the target sub-object graph in response to the supplement or deletion operation of the detection region performed by the user on the target sub-object graph. The computer device identifies at least one primitive in the target region, and takes the at least one primitive in the target region as a target primitive, and performs a corresponding supplement or deletion processing on the at least one target primitive, which can accurately correct the region obtained by automatic identification.

[0073] In some embodiments, the computer device can determine all the primitives in the target region as the target primitives according to the position information of the target region in the target sub-object graph and the position information of each primitive in the target sub-object graph.

[0074] In some embodiments, the step of "identifying the primitives in the target region to obtain at least one target primitive" specifically includes but is not limited to: determining the region contour of the target region in the target sub-object graph according to the vertex coordinates of the target region in the target sub-object graph; and determining the primitive whose primitive contour is in the region contour as the target primitive.

[0075] The vertex coordinates of the target region in the target sub-object graph refer to pixel coordinates of each vertex of the target region in the target sub-object graph.

[0076] Specifically, the computer device calculates the contour of the target region in the target sub-object graph according to the vertex coordinates of the target region in the target sub-object graph determined in advance or detected, to obtain a region contour. The computer device directly obtains or identifies the contours of all the graphics primitives in the target sub-object graph as primitive contours. The computer device determines the primitive contours within the region contour by intersecting the region contour and the primitive contours, and determines the graphics primitives within the region contour as target graphics primitives.

[0077] It can be understood that, in the case where the target region is determined by the pixel-level selection mode and the box selection, the target region selected by the pixel-level selection mode can contain all the foreground elements in the selection box, i.e., foreground elements, and the basic unit of the foreground elements is a pixel. After the foreground elements of the target region are determined, the computer device can use image processing to obtain all the foreground elements in the selection box.

[0078] In the case where the target region is determined by the graphics primitive-level selection mode and the box selection, the target region selected by the graphics primitive-level selection mode contains all the foreground graphics primitives in the selection box, i.e., foreground graphics primitives, and the basic unit of the foreground graphics primitives is a graphics primitive. After the foreground graphics primitives of the target region are determined, the computer device can use image processing to obtain all the foreground elements in the selection box, and extend to the graphics primitives by using a connected region searching algorithm, to ensure that the foreground graphics primitives identified based on the target region are complete graphics primitives.

[0079] In some embodiments, the step of "performing a detection region editing process on the at least one target graphics primitive" specifically includes, but is not limited to, at least one of the following processes: in the case where the detection region editing operation is a detection region adding operation, highlighting the region in which the target graphics primitive is located in the target sub-object graph to obtain an added detection region; in the case where the detection region editing operation is a detection region deleting operation, canceling highlighting of the initial detection region corresponding to the target graphics primitive in the target sub-object graph.

[0080] It should be noted that, in the present embodiment, the target object image or the target sub-object graph is highlighted to mark the determined detection region in the target object image or the target sub-object graph. It can be understood that the highlighted region in the target object image is the target detection region to be determined in the present embodiment.

[0081] Specifically, in the case that the detection region editing operation is a detection region adding operation, it is indicated that the target graph element determined according to the target region is a graph element that needs to be supplemented to the initial detection region, at this time, the computer device can highlight the region where the target graph element is located in the target sub-object graph to obtain the added detection region. In the case that the detection region editing operation is a detection region deleting operation, it is indicated that the target graph element determined according to the target region is a graph element that needs to be removed from the initial detection region, at this time, the computer device can unhighlight the initial detection region corresponding to the target graph element in the target sub-object graph. By distinguishing different detection region editing operations to highlight or unhighlight the determined target graph element, the detection region editing process can be more flexible.

[0082] In some embodiments, the step of "determining the corresponding region of the target region in the non-target sub-object graph according to the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph" in step 108 specifically includes but is not limited to including: calculating the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph according to the position information and the angle information of the target sub-object graph and the non-target sub-object graph in the target object image respectively; mapping the target region to the corresponding region in the non-target sub-object graph after position affine transformation according to the position information of the target region in the target sub-object graph and the position affine transformation relationship.

[0083] Wherein, the position information refers to the pixel coordinates of the target sub-object graph and the non-target sub-object graph in the target object image, and the angle information refers to the plane angle of the target sub-object graph and the non-target sub-object graph placed in the target object image, for example, 90 degrees or 180 degrees.

[0084] In some embodiments, the user can select the region box selection mode of the specified region in the target sub-object graph to realize the region adding or region deleting operation. In the case of region adding, the selection box for region box selection of the target sub-object graph can be determined as an adding box, and the region in the adding box is the target region that needs to be supplemented. In the case of region deleting, the selection box for region box selection of the target sub-object graph can be determined as a deleting box, and the region in the deleting box is the target region that needs to be deleted. It should be noted that the adding box and the deleting box are both selection boxes for region box selection, the difference is whether the selected region needs to be supplemented or deleted.

[0085] Specifically, the computer device calculates the position affine transformation relationship between the target sub-object graph and the non-target sub-object graph according to the position information and the angle information of the target sub-object graph and the non-target sub-object graph in the target object image respectively. In addition, the computer device maps the new frame or the deletion frame into the corresponding region in the non-target sub-object graph after position affine transformation, according to the position information of the target region in the target sub-object graph and the position affine transformation relationship. Through synchronously mapping all the detection region editing processing of the target sub-object graph to the remaining non-target sub-object graph, the application can realize the region editing of the whole image by only editing a part of the sub-graph, and obtain the detection region determination result of the whole image, thereby effectively improving the efficiency of detection region determination.

[0086] In some embodiments, for each non-target sub-object graph with a new frame or a deletion frame, the detection region editing processing in the target sub-object graph can be performed in parallel, that is, the target graph elements in the contour range of the new frame or the deletion frame are selected, and the human-selected detection region operation such as highlighting or canceling highlighting is performed on the target graph elements. Finally, the detection region mapping result of the whole target object image is obtained, and the final detection region determination result is obtained.

[0087] In some embodiments, the computer device can also obtain the relative coordinates of each new frame and deletion frame in the target object image and the graphic selection mode, such as the pixel selection mode or the graph element selection mode. Since the computer device needs to map all the detection region editing operations of the user on the target sub-object graph to the target object image, it is necessary to not only retain the frame selection operation information of the user, but also include the information of the deletion operation. The information of the deletion frame is the same as that of the new frame, and is recorded as the relative coordinates of the frame selection. In order to record the sequence of the deletion and selection operations, the computer device will perform XOR operation on the existing new frame and the newly added deletion frame after each deletion operation, remove the overlapping area with the newly added deletion frame, and modify the recorded coordinate information.

[0088] In some embodiments, as shown in Figure 2 The detection region determination method of the target object of the application specifically further includes but is not limited to: a detection region automatic identification step of a PCB image, a manual editing step of a detection region of a single PCS image, and a whole image PCS copying step.

[0089] The detection region automatic identification step of the PCB image includes: determining the input parameters set by the user, inputting the binary image obtained by performing binary processing on the PCB image, extracting the contour of each graph element in the binary image, calculating the shape attribute according to the contour information of each graph element, comparing the shape attribute with the input parameters, and outputting the identified multiple initial detection regions.

[0090] The steps for manually editing the detection region of a single PCS image include: extracting a single PCS image from the PCB image based on the coordinates of all PCS images in the PCB image; modifying the preceding results based on the user-selected add or delete mode; determining the new bounding box and the delete bounding box in the PCS image based on the user-selected pixel-level or primitive-level region selection mode; storing the coordinate information of each vertex of the new and delete bounding boxes in the PCS image in vector form; calculating the contour lines of each new and delete bounding box based on the vertex information of the new and delete bounding boxes; extracting the contours of all primitives in the PCS image; and calculating the detection region of the PCS based on image processing algorithms such as contour collision detection and connected component search.

[0091] The process of copying the entire PCS image includes: obtaining information on all newly added and deleted bounding boxes in a single PCS image through a management tool; mapping the operation of manually editing the detection area of ​​a single PCS image to the PCB image based on the PCS coordinates in the PCB image and the relative coordinates of the newly added and deleted bounding boxes in a single PCS image; and obtaining the final determined detection area.

[0092] In some embodiments, such as Figure 3 As shown, the target object image is a PCB image, multiple sub-object images are multiple PCS images, the target sub-object image is the target PCS image, and the non-target sub-object images are non-target PCS images. The method for determining the detection area of ​​the target object in this application further includes, but is not limited to, the following steps:

[0093] Step 302: Calculate the specific shape similarity of each graphic element based on its outline in the PCB image.

[0094] Step 303: Identify primitives with a specific shape similarity greater than a preset similarity threshold to obtain multiple first primitives.

[0095] Step 304: Determine the shape attribute parameters of multiple first primitives to reflect their shape features.

[0096] Step 306: Select multiple second elements from multiple first elements whose shape attribute parameters are within the preset shape parameter range.

[0097] Step 308: The regions where multiple second primitives are located are determined as multiple initial detection regions.

[0098] Step 310: Highlight multiple initial detection areas in the PCB image.

[0099] Step 312: Determine the target PCS image from the multiple PCS images.

[0100] In step 314, in response to the detection region editing operation on the target PCS image with reference to the initial detection region in the target PCS image, a target region in the target PCS image on which the detection region editing operation is performed is determined.

[0101] In step 316, a region contour of the target region in the target PCS image is determined according to the vertex coordinates of the target region in the target PCS image.

[0102] In step 318, a primitive in the region contour is determined as a target primitive, and in a case where the detection region editing operation is an adding operation on the detection region, step 320 is performed. In a case where the detection region editing operation is a deleting operation on the detection region, step 322 is performed.

[0103] In step 320, a region in which the target primitive is located in the target PCS image is highlighted to obtain an added detection region.

[0104] In step 322, the initial detection region corresponding to the target primitive in the target PCS image is unhighlighted.

[0105] In step 324, a position affine transformation relationship between the target PCS image and each non-target PCS image is calculated according to the position information and the angle information of the target PCS image and the non-target PCS image in the PCB image respectively.

[0106] In step 326, the target region is mapped to a corresponding region in the non-target PCS image after position affine transformation according to the position information of the target region in the target PCS image and the position affine transformation relationship.

[0107] In step 328, detection region editing processing is performed on the corresponding region to obtain a detection region determination result.

[0108] It can be understood that the detection region editing processing on the corresponding region in the non-target PCS image can refer to steps 316 to 322, that is, the region contour of the corresponding region in the non-target PCS image can be determined according to the vertex coordinates of the corresponding region in the non-target PCS image, the primitive in the region contour is determined as a target primitive, and the determined target primitive is highlighted or unhighlighted according to the operation type of the detection region editing operation. After the detection region editing processing on all corresponding regions in the non-target PCS image is completed, all highlighted primitives in the PCB image can be taken as the detection region determination result.

[0109] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0110] Based on the same inventive concept, this application also provides a target object detection region determination device for implementing the target object detection region determination method described above. The solution provided by this device is similar to the implementation scheme described in the above method. Therefore, the specific limitations in one or more target object detection region determination device embodiments provided below can be found in the limitations of the target object detection region determination method described above, and will not be repeated here.

[0111] In some embodiments, such as Figure 4 As shown, a target object detection region determination device is provided, including: a region recognition module 402, an image determination module 404, a region editing module 406, and a region determination module 408, wherein:

[0112] The region recognition module 402 is used to highlight multiple initially detected regions in the target object image by performing region recognition on the target object image; the target object image includes multiple sub-object images; the multiple sub-object images are images of multiple sub-objects with the same structure that the target object has;

[0113] Image determination module 404 is used to determine a target sub-object map specified from multiple sub-object maps; the target sub-object map includes a portion of initial detection regions from multiple initial detection regions;

[0114] The region editing module 406 is used to perform corresponding detection region editing processing on the target region in response to the detection region editing operation performed on the target sub-object graph based on the initial detection region in the target sub-object graph; the target region is the area in the target sub-object graph where the detection region editing operation is applied.

[0115] The region determination module 408 is configured to determine a corresponding region of the target region in the non-target sub-object graph according to a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, perform a detection region editing process on the corresponding region, and obtain a detection region determination result.

[0116] The above target object detection region determination apparatus can improve the detection region recognition efficiency by automatically recognizing the detection region of the target object image including a plurality of sub-object graphs. The apparatus further provides a human-computer interaction for editing the detection region. Specifically, the plurality of initial detection regions recognized in the target object image are highlighted, and a target sub-object graph is determined from the plurality of sub-object graphs, the target sub-object graph including part of the plurality of initial detection regions. In response to a detection region editing operation on the target sub-object graph with reference to the initial detection region in the target sub-object graph, a corresponding detection region editing process is performed on the target region in the target sub-object graph affected by the detection region editing operation. The corresponding region of the target region in the non-target sub-object graph is determined according to a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, and a detection region editing process is performed on the corresponding region to obtain a detection region determination result. That is, the apparatus can correct the detection region on the basis of the automatic recognition of the detection region, improve the accuracy of the detection region determination result, and further improve the detection region determination efficiency by determining part of the target sub-object graph in the target object image, performing the detection region editing operation and process only on the target sub-object graph, and achieving the effect of the detection region recognition of the entire target object image.

[0117] In some embodiments, the region recognition module 402 is further configured to calculate a specific shape similarity of each graph element according to a graph element contour of each graph element in the target object image, determine a plurality of initial detection regions from a region in which a plurality of first graph elements with a specific shape similarity greater than a preset similarity threshold are located, and highlight the plurality of initial detection regions in the target object image.

[0118] In some embodiments, the region recognition module 402 is further configured to determine a shape attribute parameter of the plurality of first graph elements for reflecting a shape feature, the plurality of first graph elements being graph elements with a specific shape similarity greater than a preset similarity threshold, select a plurality of second graph elements with a shape attribute parameter within a preset shape parameter range from the plurality of first graph elements, and determine a region in which the plurality of second graph elements are located as the plurality of initial detection regions.

[0119] In some embodiments, the region editing module 406 is further configured to, in response to a detection region editing operation on the target sub-object graph, determine a target region in the target sub-object graph on which the detection region editing operation is performed; identify graph elements in the target region to obtain at least one target graph element; each target graph element being a complete graph element or a part of a complete graph element; and perform a detection region editing process on the at least one target graph element.

[0120] In some embodiments, the region editing module 406 is further configured to determine a region contour of the target region in the target sub-object graph according to vertex coordinates of the target region in the target sub-object graph; and determine a graph element in the region contour as a target graph element.

[0121] In some embodiments, the region editing module 406 is further configured to, in a case where the detection region editing operation is an adding operation, highlight a region in which the target graph element is located in the target sub-object graph to obtain an added detection region; and in a case where the detection region editing operation is a deleting operation, unhighlight a corresponding initial detection region of the target graph element in the target sub-object graph.

[0122] In some embodiments, the region determining module 408 is further configured to calculate a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph according to position information and angle information of the target sub-object graph and the non-target sub-object graph in the target object image respectively; and map the target region to a corresponding region in the non-target sub-object graph after position affine transformation according to position information of the target region in the target sub-object graph and the position affine transformation relationship.

[0123] The above modules in the target object detection region determining apparatus can be realized by software, hardware, or a combination thereof. The above modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above modules.

[0124] In some embodiments, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 8. Figure 5As shown in the figure. 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 operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used to store data related to the detection area determination. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a target object detection area determination method.

[0125] In some embodiments, a computer device, which can be a terminal, is provided, and an internal structure diagram of the computer device can be as shown in the figure. Figure 6 As shown in the figure. 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 operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is used to store data related to the detection area determination. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a target object detection area determination method.

[0126] Those skilled in the art can understand that Figure 5 and Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0127] In some embodiments, a computer device is also provided, which includes a memory and a processor, the memory has stored therein a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0128] In some embodiments, a computer readable storage medium is provided, which has stored thereon a computer program, and the computer program, when executed by a processor, implements the steps in the above method embodiments.

[0129] In some embodiments, a computer program product is provided, which includes a computer program, and the computer program, when executed by a processor, implements the steps in the above method embodiments.

[0130] 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.

[0131] 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. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to 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 (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0132] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0133] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method of determining a detection area of a target object, characterized by, The method comprises: highlighting a plurality of initial detection regions in a target object image by performing detection region identification on the target object image; the target object image comprises a plurality of sub-object graphs; the plurality of sub-object graphs are images of a plurality of sub-objects of the target object, and the plurality of sub-objects have the same structure; determining a target sub-object graph from the plurality of sub-object graphs; the target sub-object graph comprises a part of the plurality of initial detection regions; performing corresponding detection region editing processing on a target region in response to a detection region editing operation performed on the target sub-object graph by referring to an initial detection region in the target sub-object graph; the target region is a region in the target sub-object graph on which the detection region editing operation is performed; determining a corresponding region of the target region in a non-target sub-object graph according to a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, and performing the detection region editing processing on the corresponding region to obtain a detection region determination result.

2. The method of claim 1, wherein, The method comprises: calculating specific shape similarities of each graph element in the target object image according to a graph element contour of each graph element in the target object image; highlighting a plurality of initial detection regions in the target object image by determining the plurality of initial detection regions from a region in which a plurality of first graph elements with a specific shape similarity greater than a preset similarity threshold are located.

3. The method of claim 2, wherein, The method comprises: determining shape attribute parameters of the plurality of first graph elements for reflecting shape features; the plurality of first graph elements are the graph elements with the specific shape similarity greater than the preset similarity threshold; screening a plurality of second graph elements with shape attribute parameters within a preset shape parameter range from the plurality of first graph elements; determining a region in which the plurality of second graph elements are located as the plurality of initial detection regions.

4. The method of claim 1, wherein, The method comprises: determining a target region in the target sub-object graph on which the detection region editing operation is performed in response to the detection region editing operation performed on the target sub-object graph by referring to the initial detection region in the target sub-object graph; identifying graph elements in the target region to obtain at least one target graph element; each target graph element is a complete graph element or a part of a complete graph element; performing detection region editing processing on the at least one target graph element.

5. The method of claim 4, wherein, The method comprises: determining a region contour of the target region in the target sub-object graph according to vertex coordinates of the target region in the target sub-object graph; determining a target graph element as a graph element whose graph element contour is within the region contour.

6. The method of claim 4, wherein, The detection region editing processing on the at least one target graph element comprises at least one of the following: In a case where the detection region editing operation is a detection region adding operation, a region in which the target graph element is located in the target sub-object graph is highlighted to obtain an added detection region; In a case where the detection region editing operation is a detection region deleting operation, an initial detection region corresponding to the target graph element in the target sub-object graph is un-highlighted.

7. The method according to any one of claims 1 to 6, characterized in that, The corresponding region of the target region in the non-target sub-object graph is determined according to a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, comprising: The position affine transformation relationship between the target sub-object graph and the non-target sub-object graph is calculated according to position information and angle information of the target sub-object graph and the non-target sub-object graph in the target object image respectively; The target region is mapped to the corresponding region in the non-target sub-object graph after position affine transformation according to position information of the target region in the target sub-object graph and the position affine transformation relationship.

8. An apparatus for determining a detection area of a target object, characterized by comprising: Comprise: A region identification module is configured to highlight a plurality of initial detection regions identified in a target object image by performing detection region identification on the target object image; The target object image comprises a plurality of sub-object graphs; the plurality of sub-object graphs are images of a plurality of sub-objects of the same structure possessed by a target object; An image determination module is configured to determine a target sub-object graph specified from the plurality of sub-object graphs; the target sub-object graph comprises a part of the plurality of initial detection regions; A region editing module is configured to perform corresponding detection region editing processing on a target region in response to a detection region editing operation performed on the target sub-object graph with reference to an initial detection region in the target sub-object graph; The target region is a region on which the detection region editing operation acts in the target sub-object graph; A region determination module is configured to determine a corresponding region of the target region in a non-target sub-object graph according to a position affine transformation relationship between the target sub-object graph and the non-target sub-object graph, and perform the detection region editing processing on the corresponding region to obtain a detection region determination result. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image processing method, electronic equipment and computer readable storage medium

    CN111652796A

  • Image anonymization apparatus, image anonymization method, and program

    JP2021064089A