Target object detection method, target object detection device, and storage medium
Patent Information
- Application Number
- CN202310913811.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-07-24
AI Technical Summary
但终端内务结构相对复杂,物料的边界并不清晰,通过机器视觉获取的直线与实际物料边界存在误差,导致目标物检测结果存在误差
[0023] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: acquiring a grayscale image inside the terminal, determining the target region corresponding to the target object to be detected in the grayscale image, detecting the internal and external features of the target region respectively, and obtaining the target object detection result. This disclosure improves detection accuracy and efficiency.
Smart Images

Figure CN117058663B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of visual inspection, and in particular to object detection methods, object detection devices, and storage media. Background Technology
[0002] In terminal manufacturing, there is a great need to inspect the shape of internal materials, such as the position and skew angle of copper foil, heat dissipation pads, and tamper-evident labels.
[0003] In related technologies, machine vision is used to acquire images of materials inside a terminal. Based on the boundaries of the materials in the image, corresponding straight lines are obtained. The position and skew information of the materials are determined based on the intersection and angle of these lines, thus identifying any abnormalities in the materials. However, the internal structure of the terminal is relatively complex, and the boundaries of the materials are not clear. The straight lines acquired by machine vision have errors compared to the actual material boundaries, leading to errors in the target object detection results. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this disclosure provides a target object detection method, a target object detection device, and a storage medium.
[0005] According to a first aspect of the present disclosure, a target object detection method is provided, comprising: acquiring a grayscale image inside a terminal, and determining a target region in the grayscale image, wherein the target region corresponds to a target object to be detected inside the terminal; performing feature detection on the target region to obtain a first feature detection result, and performing feature detection on the region surrounding the target region to obtain a second feature detection result; and determining a detection result of the target object to be detected based on the first feature detection result and the second feature detection result.
[0006] In one embodiment, the feature detection of the target region includes: performing feature detection on the target region based on preset first information, wherein the first information is information about the target region in a grayscale image inside a terminal where the detection result is normal.
[0007] In one embodiment, the first information includes first location information and a first feature. The step of performing feature detection on the target region based on the preset first information includes: determining the region in the target region whose location corresponds to the first location information as a first region; obtaining the grayscale feature of the first region; and determining the first feature detection result of the target region based on the difference between the grayscale feature of the first region and the first feature.
[0008] In one embodiment, the feature detection of the region surrounding the target region includes: performing feature detection on the target region based on preset second information, wherein the second information is information about the target region in a grayscale image inside a terminal where the detection result is normal and information about the region surrounding the target region.
[0009] In one embodiment, the second information includes second location information, a second feature, third location information, and a third feature; the feature detection of the target region based on the preset second information includes: determining the region in the target region whose location corresponds to the second location information as a second region; acquiring the grayscale features of the second region, and detecting the target object to be detected based on the difference between the grayscale features of the second region and the second feature; in response to detecting the target object to be detected, determining multiple regions in the grayscale image corresponding to the third location information as a third region set; acquiring the grayscale features of each detected region in the third region set, and determining the number of abnormal detected regions in the third region set based on the difference between the grayscale features of each detected region and the third feature; and determining the second feature detection result of the target object to be detected based on the number of abnormal detected regions.
[0010] In one embodiment, the first information is determined as follows: a grayscale image inside the terminal where the target object detection result is normal is obtained; the corner area of the target area corresponding to the target object in the grayscale image is determined as the detection area; and the position information and grayscale features of the detection area are determined as the first information.
[0011] In one embodiment, the second information is determined as follows: A grayscale image of a terminal where the target object detection result is normal is acquired; a contour line is determined outside the edge of the target region corresponding to the target object in the grayscale image; a certain distance exists between the contour line and the edge of the target region corresponding to the target object, and this distance corresponds to the category of the target object to be detected; a third region set is determined along the contour line, surrounding the target region; the third region set includes multiple detection regions, and the interval between the multiple detection regions corresponds to the category of the target object to be detected; the central region of the target region corresponding to the target object in the grayscale image is determined; the position information and grayscale features of the multiple detection regions in the third region set, and the position information and grayscale features of the central region are determined as the second information.
[0012] In one embodiment, determining the detection result of the target object based on the first feature detection result and the second feature detection result includes: determining that the detection result of the target object is abnormal in response to both the first feature detection result and the second feature detection result being abnormal; and determining that the detection result of the target object is normal in response to the presence of a normal detection result among the first feature detection result and the second feature detection result.
[0013] According to a first aspect of the present disclosure, a target object detection apparatus is provided, comprising: an acquisition unit, configured to acquire a grayscale image inside a terminal and determine a target region in the grayscale image, wherein the target region corresponds to a target object to be detected inside the terminal; a processing unit, configured to perform feature detection on the target region to acquire a first feature detection result, and perform feature detection on a region surrounding the target region to acquire a second feature detection result; and a determination unit, configured to determine a detection result of the target object to be detected based on the first feature detection result and the second feature detection result.
[0014] In one embodiment, the processing unit performs feature detection on the target region in the following manner: it performs feature detection on the target region based on preset first information, wherein the first information is the information of the target region in a grayscale image inside a terminal where the detection result is normal.
[0015] In one embodiment, the first information includes first location information and a first feature. The processing unit performs feature detection on the target region based on the preset first information in the following manner: the region in the target region whose location corresponds to the first location information is determined as the first region; the grayscale feature of the first region is obtained, and the first feature detection result of the target region is determined based on the difference between the grayscale feature of the first region and the first feature.
[0016] In one embodiment, the processing unit performs feature detection on the region surrounding the target region in the following manner: it performs feature detection on the target region based on preset second information, wherein the second information is the information of the target region in the grayscale image inside the terminal where the detection result is normal and the information of the region surrounding the target region.
[0017] In one embodiment, the second information includes second location information, a second feature, a third location information, and a third feature; the processing unit performs feature detection on the target region based on the preset second information in the following manner: determining the region in the target region whose location corresponds to the second location information as a second region; acquiring the grayscale features of the second region, and detecting the target object to be detected based on the difference between the grayscale features of the second region and the second feature; in response to detecting the target object to be detected, determining multiple regions in the grayscale image corresponding to the third location information as a third region set; acquiring the grayscale features of each detected region in the third region set, and determining the number of abnormal detected regions in the third region set based on the difference between the grayscale features of each detected region and the third feature; and determining the second feature detection result of the target object to be detected based on the number of abnormal detected regions.
[0018] In one embodiment, the first information is determined by the processing unit in the following manner: acquiring a grayscale image inside the terminal where the target object detection result is normal, determining the corner area of the target area corresponding to the target object in the grayscale image as the detection area, and determining the position information and grayscale features of the detection area as the first information.
[0019] In one embodiment, the second information is determined by the processing unit in the following manner: acquiring a grayscale image inside the terminal where the target object detection result is normal; determining a contour line outside the edge of the target region corresponding to the target object in the grayscale image, wherein there is a certain distance between the contour line and the edge of the target region corresponding to the target object, and the distance corresponds to the category of the target object to be detected; determining a third region set surrounding the target region along the contour line, wherein the third region set includes multiple detection regions, and the interval between the multiple detection regions corresponds to the category of the target object to be detected; determining the central region of the target region corresponding to the target object in the grayscale image; and determining the position information and grayscale features of the multiple detection regions in the third region set, and the position information and grayscale features of the central region as the second information.
[0020] In one embodiment, the determining unit determines the detection result of the target object based on the first feature detection result and the second feature detection result in the following manner: in response to the first feature detection result being abnormal and the second feature detection result being abnormal, the detection result of the target object is determined to be abnormal; in response to the presence of a normal detection result among the first feature detection result and the second feature detection result, the detection result of the target object is determined to be normal.
[0021] According to a third aspect of the present disclosure, a target object detection apparatus is provided, characterized in that it includes: a processor: a memory for storing processor-executable instructions; wherein the processor is configured to: execute the target object detection method described in the first aspect or any embodiment of the first aspect.
[0022] According to a fourth aspect of the present disclosure, a storage medium is provided, characterized in that the storage medium stores instructions that, when executed by a processor, enable the processor to perform the target detection method described in the first aspect or any embodiment of the first aspect.
[0023] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: acquiring a grayscale image inside the terminal, determining the target region corresponding to the target object to be detected in the grayscale image, detecting the internal and external features of the target region respectively, and obtaining the target object detection result. This disclosure improves detection accuracy and efficiency.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0026] Figure 1 This is a schematic diagram illustrating a method for detecting materials inside a terminal based on machine vision, according to an exemplary embodiment of this disclosure.
[0027] Figure 2 This is a flowchart illustrating a target detection method according to an exemplary embodiment.
[0028] Figure 3 This is a flowchart illustrating a method for feature detection of a target region according to an exemplary embodiment.
[0029] Figure 4 This is a flowchart illustrating a method for detecting materials inside a terminal based on target area features, according to an exemplary embodiment of this disclosure.
[0030] Figure 5A and Figure 5B This is a schematic diagram of a detection region when performing feature detection on a target region according to an exemplary embodiment of the present disclosure.
[0031] Figure 6This is a flowchart illustrating a method for feature detection of a region surrounding a target region according to an exemplary embodiment.
[0032] Figure 7 This is a schematic diagram of a detection region when performing feature detection on a region surrounding a target region according to an exemplary embodiment of the present disclosure.
[0033] Figure 8A and 8B This is a schematic diagram of the detection region when performing feature detection on a pair of regions surrounding a target region according to an exemplary embodiment of the present disclosure.
[0034] Figure 9 This is a flowchart illustrating a method for determining first information according to an exemplary embodiment.
[0035] Figure 10 This is a flowchart illustrating a method for configuring a detection region when performing region detection according to an exemplary embodiment of the present disclosure.
[0036] Figure 11 This is a flowchart illustrating a method for determining second information according to an exemplary embodiment.
[0037] Figure 12 This is a flowchart illustrating a method for configuring a detection region when performing contour detection according to an exemplary embodiment of the present disclosure.
[0038] Figure 13 This is a flowchart illustrating a method for determining the detection result of a target object based on a first feature detection result and a second feature detection result, according to an exemplary embodiment.
[0039] Figure 14 This is a schematic diagram illustrating a scenario of material detection based on machine vision according to an exemplary embodiment of the present disclosure.
[0040] Figure 15 This is a block diagram illustrating a target detection device according to an exemplary embodiment.
[0041] Figure 16 This is a block diagram illustrating an apparatus for detecting a target object according to an exemplary embodiment. Detailed Implementation
[0042] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.
[0043] The target object detection method provided in this disclosure is applied to scenarios where materials inside a terminal are detected using detection equipment.
[0044] In terminal manufacturing, various materials within the terminal have corresponding placement standards. For example, the position and degree of skew of the terminal's copper foil, heat dissipation pads, and tamper-evident labels must meet certain requirements. Based on these installation standards, after the terminal's materials are assembled, it is necessary to inspect the position and degree of skew of each material to determine if the installation meets the requirements. Previously, the inspection of each material was done manually, which resulted in relatively subjective standards, inaccurate results, wasted manpower, and low efficiency.
[0045] In related technologies, machine vision is used to detect the position and skewness of materials. Quantitative algorithms, such as line angles and line intersection coordinates, are used to calculate the position and skewness of the materials. Figure 1 The schematic diagram of the method for detecting materials inside a machine vision-based terminal is shown. An image of the material to be tested is acquired through an image acquisition device. A reference coordinate system is established within the image of the material. A reference point O(X1, Y1) of the material is determined based on manual judgment. Machine vision recognition identifies the straight lines corresponding to different edges of the material and determines the intersection point C(X2, Y2) between these lines. Then, the position and skew information of the material are determined based on the coordinates of the reference point O and the intersection point C. Finally, the distance between the reference point O and the intersection point C, and the slope of the line connecting them, are used to determine whether the position and skew information of the material meets the requirements.
[0046] However, in actual testing, the terminal contains a large amount of material with a complex internal structure, and the boundaries between different materials are not clear. This leads to a discrepancy between the straight lines corresponding to the material edges obtained by machine vision based on the terminal's internal images and the actual material boundaries. This results in low detection stability, large measurement errors, and the misclassification of abnormal materials as normal or vice versa, causing over-detection and under-detection. Furthermore, the aforementioned detection methods rely on real-time image extraction, which lacks pre-defined markers. Manual parameter tuning based on experience is required to set reference points for detection, making process selection relatively difficult. Moreover, determining intersection points based on the straight lines corresponding to material edges requires constantly switching the detected lines and modifying numerous parameters, resulting in a complex and lengthy detection process. In summary, related technologies using machine vision to detect material positions suffer from large detection errors, complex detection processes, long detection times, and low detection efficiency.
[0047] In view of this, this disclosure provides a target object detection method. Based on a grayscale image of the target object conforming to a standard, a detection area for material detection is pre-configured, and standard material features of the corresponding area are extracted. During material detection, an image of the material to be tested is acquired. Based on the pre-set configuration information, the corresponding detection area in the image is extracted, and the material features of the detection area are obtained. Then, based on the detected material features and the corresponding standard material features, it is determined whether the material to be tested is abnormal. By pre-configuring the detection area and comparing the detected material features with the standard material features to determine whether the material is abnormal, detection efficiency and accuracy are improved, avoiding over-detection and under-detection.
[0048] Figure 2 This is a flowchart illustrating a target object detection method according to an exemplary embodiment. Figure 2 As shown, the method includes steps S101 to S103.
[0049] In step S101, a grayscale image inside the terminal is acquired, and the target region is determined in the grayscale image.
[0050] There is a correspondence between the target area and the target object to be detected inside the terminal.
[0051] In this embodiment of the disclosure, an image inside the terminal is acquired by an image acquisition device, and the RGB (red, green, blue) values of the three primary colors of the terminal image are converted into grayscale values by a conversion algorithm. The image region corresponding to the target object to be detected, i.e., the target region, is then determined in the grayscale image.
[0052] In this embodiment of the disclosure, the purpose of detecting the target object is to determine whether the target object's position area, tilt angle, etc., inside the terminal meet the standards. The determination of the target area is based on the design area of the target object in the standard product image of the terminal. It can be understood that there may be multiple target objects to be detected inside the terminal, and there may be multiple target areas corresponding to different target objects in the grayscale image inside the terminal.
[0053] In step S102, feature detection is performed on the target region to obtain a first feature detection result, and feature detection is performed on the region surrounding the target region to obtain a second feature detection result.
[0054] In step S103, the detection result of the target object to be detected is determined based on the first feature detection result and the second feature detection result.
[0055] In this embodiment of the disclosure, the different regions detected during target object detection are divided based on the edge of the target region, namely the internal region of the target region within the edge and the outer contour region outside the edge.
[0056] In this embodiment of the disclosure, when the location of the target object inside the terminal meets the standard, the grayscale features inside the target area corresponding to the target object in the grayscale image are specific, and the grayscale features of the outer contour area surrounding the target area are also specific. Therefore, by detecting the grayscale features of the target area and detecting the grayscale features of the area surrounding the target area (i.e., the outer contour area), it can be determined whether the location of the target object inside the terminal meets the standard.
[0057] In this embodiment of the disclosure, by detecting the internal and external features of the target area corresponding to the target object to be tested respectively, the detection result of the target object is obtained, thereby improving the detection accuracy and detection efficiency.
[0058] The following embodiments of this disclosure further illustrate the method for detecting features of a target region and obtaining a first feature detection result.
[0059] In one embodiment of this disclosure, feature detection of a target region includes: performing feature detection on the target region based on preset first information, wherein the first information is information about the target region in a grayscale image inside a terminal where the detection result is normal.
[0060] In this embodiment of the disclosure, the grayscale image corresponding to the target area is the grayscale image of the target object to be tested. By acquiring the grayscale features of the target area in the actual detected target object and comparing them with the grayscale features of the standard target object, the first feature detection result of the target object is determined by the difference in regional features.
[0061] In this embodiment of the disclosure, the first information is the internal region information of the target object with a normal detection result, that is, the detection region configuration information inside the target region where the first detection is performed, including the location information of the detection region inside the target region corresponding to the target object to be detected and the standard region features of the detection region.
[0062] In this embodiment of the disclosure, different regions are detected during target object detection based on the edge division of the target region, namely the internal region and the outer contour region. This disclosure detects the internal region and the outer contour region of the target region corresponding to the target object respectively, and obtains the internal first feature detection result and the outer contour first feature detection result respectively. The following embodiments of this disclosure describe the detection process of the internal region features within the edge of the target region.
[0063] Figure 3 This is a flowchart illustrating a method for feature detection of a target region according to an exemplary embodiment. Figure 3 As shown, the method includes steps S201 to S202.
[0064] In step S201, the region in the target region whose location corresponds to the first location information is determined as the first region.
[0065] In step S202, the grayscale features of the first region are obtained, and the first feature detection result of the target region is determined based on the difference between the grayscale features of the first region and the first feature.
[0066] In this embodiment, the grayscale feature of the first region is the actual region feature obtained through real-time detection. The first feature is the standard region feature of the detection region that conforms to the standard. A grayscale feature difference threshold can be preset to determine whether the grayscale feature of the target region is abnormal. When the difference between the actual region feature and the standard region feature is greater than the threshold, the region feature detection result, i.e., the first feature detection result, is determined to be abnormal. When the difference between the actual region feature and the standard region feature is less than or equal to the threshold, the region feature detection result, i.e., the first feature detection result, is determined to be normal.
[0067] In this embodiment, based on the grayscale image of the target object whose detection result is normal, the first information of the detection area for regional feature detection, namely the detection area configuration information (including location information and standard feature information) for detecting the target area, is determined. By comparing the features of the actual target object in the grayscale image with those of the standard target object in the grayscale image of the standard product, it is determined whether the first feature detection result of the actual target object, i.e., the target area feature detection result, is normal. By pre-configuring the detection area information, the target area detection result can be quickly obtained, improving detection efficiency.
[0068] In an exemplary embodiment of this disclosure, the target object to be detected is internal materials such as copper foil, heat dissipation pads, and labels inside the terminal. The materials are detected based on standard area feature information of the materials in a pre-configured standard product. For example... Figure 4 The flowchart of the method for detecting materials inside a terminal based on target region features shows that, in response to enabling region feature detection, an image of the actual product's interior is acquired, and the RGB values of the image are converted into grayscale values, thereby converting the image of the actual product's interior into a grayscale image. The material to be tested is located within this grayscale image. Based on the location information contained in pre-configured standard region feature information, the detection region S is located within the material to be tested area of the grayscale image, as shown below. Figure 5A and Figure 5B The diagram illustrates the detection area during feature detection of a target region. Detection areas S are typically distributed at the corners and edges of the material being measured, and there are multiple such areas. For example... Figure 5AThe rectangular test material in section 5B contains detection areas S1, S2, S3, and S4, or the L-shaped test material in section 5B contains detection areas S1, S2, and S3. After acquiring the detection areas, the information of the detection area S (the grayscale values of each pixel in area S) is stored, and the grayscale features within area S are calculated to obtain feature values characterizing the grayscale features within area S (such as the maximum grayscale value, the average grayscale value, the mean, and the variance of the grayscale values within area S). The actual grayscale features of the detection area S in the actually detected test material are compared with the standard features of the standard product to determine the degree of difference between the two, thus achieving the inspection of the test material. Specifically, the difference between the feature values of the actual grayscale features and the feature values of the standard grayscale features is obtained, and a threshold judgment is performed on the difference. Based on the test material, a corresponding threshold is determined. When the difference is greater than the threshold, the test material is considered normal; when the difference is less than or equal to the threshold, the test area is considered abnormal. After obtaining the test results, the material testing process ends.
[0069] The following embodiments of this disclosure further illustrate a method for detecting features of the region (outer contour region) surrounding a target region and obtaining a second feature detection result (contour feature detection result).
[0070] In one embodiment of this disclosure, feature detection of the region surrounding the target region includes: performing feature detection on the target region based on preset second information, wherein the second information is information about the target region in a grayscale image inside a terminal where the detection result is normal and information about the region surrounding the target region.
[0071] In this embodiment, the second information of the target object is the external contour information of the target object that conforms to the standard, including the position information of the external contour region and the standard contour features of the external contour region, that is, the grayscale features of the external contour region when the detection result is normal. The actual outer contour features of the target object to be detected are actually acquired in the grayscale image. Based on a feature comparison between the standard contour features of the standard target object in the pre-set standard product grayscale image and the actual outer contour features, it is determined whether the outer contour features of the target object to be detected are normal.
[0072] In this embodiment, region feature detection (first feature detection) and contour feature detection (second feature detection) are performed on the target object respectively. The two detection methods are parallel and there is no specific order of execution. When performing feature detection on the target object, region feature detection can be performed first, followed by contour feature detection; or contour feature detection can be performed first, followed by region feature detection; or region feature detection and contour feature detection can be performed simultaneously. The following embodiments of this disclosure illustrate the contour feature detection method.
[0073] Figure 6This is a flowchart illustrating a method for feature detection of a region surrounding a target region according to an exemplary embodiment. Figure 6 As shown, the method includes steps S301 to S305.
[0074] In step S301, the area in the target area whose location corresponds to the second location information is determined as the second area.
[0075] In step S302, the grayscale features of the second region are obtained, and the target object to be detected is detected based on the difference between the grayscale features of the second region and the second feature.
[0076] In this embodiment, the second location information corresponds to the location of the central region of the grayscale image of the standard target object, and the grayscale feature of the second region is the grayscale feature of the central region. Based on the second location information, the corresponding region in the grayscale image of the target object of the actual test product is obtained, and the grayscale feature of that region in the actual product is obtained. By comparing the grayscale features of the corresponding region in the standard target object and the actual product, a threshold judgment is made based on the difference in grayscale features between the corresponding region in the actual product and the standard product, thereby determining whether the target object exists in the actual product.
[0077] In step S303, in response to the detection of the target object, multiple regions in the grayscale image corresponding to the third location information are determined as a third region set.
[0078] In step S304, the grayscale features of each detection region in the third region set are obtained, and the number of detection regions with anomalies in the third region set is determined based on the difference between the grayscale features of each detection region and the third feature.
[0079] In step S305, the second feature detection result of the target object to be detected is determined based on the number of detection areas with anomalies.
[0080] In this embodiment of the disclosure, the method for contour feature detection is similar to the method for region feature detection described above, that is, by comparing the contour features of a standard target object with those of the actual target object to determine whether the contour features of the target object to be detected are abnormal.
[0081] In this embodiment, the third location information corresponds to the position of the set of contour regions (third region set) surrounding the target object in the grayscale image of the standard target object. By comparing the grayscale features of each contour detection region in the standard target object and the actual target object, a threshold judgment is performed based on the difference in grayscale features and a pre-set difference threshold. This identifies abnormal regions among multiple broken contour detection regions, using the same method as the region feature judgment method. The number of abnormal regions is then determined, and a threshold judgment is performed based on a preset quantity threshold to determine whether the contour features of the detected target object are abnormal. By comparing the features of the actual target object with those of the standard target object, the normality of the contour features of the actual target object is determined, quickly obtaining region detection results and improving detection efficiency.
[0082] In an exemplary embodiment of this disclosure, the target object to be detected is internal materials such as copper foil, heat dissipation pads, and labels inside the terminal. Contour feature detection is performed on the materials based on pre-configured standard product material feature information of the standard contour region. For example... Figure 7 The diagram illustrates the detection area during feature detection of the region surrounding the target area. The region surrounding the target area is the outer contour region of the target object in the grayscale image. In response to enabling region feature detection, an image of the actual product's interior is acquired and converted to grayscale. Information about the internal detection region T from the standard contour region feature information, along with the contour detection region set A, is loaded. Based on the location information of the internal detection region T, the internal detection region T of the material to be tested is located within the material image. Information about the detection region T is extracted and saved, and then feature values representing the regional characteristics of the detection region T are calculated (based on the grayscale values within region T). After acquiring the feature values of the region T to be tested in the actual product, a threshold judgment is performed based on the difference between the feature values of the region T to be tested in the actual product and the feature values of the region T to be tested in the standard product. This determines whether the corresponding region within the feature map of the actual product contains the material to be tested. If the difference is greater than the threshold, the material to be tested exists; if the difference is less than or equal to the threshold, the material to be tested does not exist.
[0083] In response to the presence of a test material in the corresponding region within the feature map of the actual acquired product, the contour detection region set B of the test material is located within the material image based on the position information of the contour detection region set A contained in the standard contour region feature information. Figure 8A and Figure 8B This diagram illustrates the detection area when performing feature detection on the region surrounding the target area. The region surrounding the target area is the outline region of the target object in the grayscale image. Feature detection of the outline region requires detection based on a set of outline detection regions. This set includes multiple regions distributed around the material to be measured and maintaining a certain distance from it (i.e.,...). Figure 8A and Figure 8B When determining the contour detection region set B (around the distribution of small points of the material to be tested), it is necessary to determine multiple regions (such as b1, b2, b3, etc.) in the contour detection region set B one by one based on multiple regions (such as a1, a2, a3, etc.) contained in the contour detection region set A. For example, region b1 is determined based on region a1, region b2 is determined based on region a2, etc. After determining the contour detection region set B used for actual detection of the material to be tested, the grayscale features of each region in the region set B are obtained. Then, the standard features of each region in the contour detection region set A and the actual features of each region in the region set B are obtained. The difference of the feature values corresponding to each region is obtained. Based on the difference of feature values, a threshold judgment is made to determine whether each region in the region set B is abnormal. The number of abnormal regions is counted. Then, based on the number of abnormal regions, a threshold judgment is made to determine whether the number of abnormal regions exceeds the threshold, or to determine the proportion of the number of abnormal regions in the total number of regions in the region set B. It is then determined whether the contour features of the material to be tested are abnormal. After obtaining the judgment result, the contour detection process ends.
[0084] In this embodiment, both the first information used for region feature determination and the second information used for contour feature detection need to be preset, and different detection configuration information needs to be set for different target objects. The following embodiments of this disclosure describe the method for setting the first information.
[0085] Figure 9 This is a flowchart illustrating a method for determining first information according to an exemplary embodiment. Figure 9 As shown, the method includes steps S401 to S402.
[0086] In step S401, a grayscale image of the terminal whose target detection result is normal is obtained.
[0087] In step S402, the corner region of the target area corresponding to the target object in the grayscale image is determined as the detection region, and the position information and grayscale features of the detection region are determined as the first information.
[0088] In this embodiment of the disclosure, a grayscale image of the target object whose detection result is normal is obtained, such as... Figure 5A and Figure 5B As shown, a detection area for region detection, namely the first area mentioned above, is set in the corner area of the target object in the grayscale image. The location information of the detection area is saved, and the grayscale features in the detection area are saved for comparison with the region features of the actual detected target object.
[0089] Understandably, to improve detection accuracy, more detection areas can be set in the corner areas of the target object in the grayscale image.
[0090] In an exemplary embodiment of this disclosure, such as Figure 10 The flowchart illustrates the configuration method for the detection area during area detection. A standard product image is imported and converted to grayscale. A region, denoted as detection area S, is selected on the target object. Detection area S is located inside the target object near its corners. The algorithm calculates the grayscale features of the detection area. The location information and grayscale features of the detection area are stored as area feature detection information (first information). Obtaining the area feature detection information allows for further determination of whether more areas need to be added. If a new detection area needs to be added, its location information and grayscale features are added to the area feature detection information.
[0091] In this embodiment of the disclosure, based on the grayscale image of the target object whose detection result is normal, regional feature detection information for region detection is configured, which avoids the need to set detection points in real time when actually detecting the target object, thus improving detection efficiency.
[0092] In this embodiment of the disclosure, the configuration of contour feature detection information (second information) is similar to the configuration method of region feature detection information (first information). The following embodiments of this disclosure illustrate the method for determining the second information.
[0093] Figure 11 This is a flowchart illustrating a method for determining second information according to an exemplary embodiment. Figure 11 As shown, the method includes steps S501 to S504.
[0094] In step S501, a grayscale image of the terminal whose target detection result is normal is obtained, and a contour line is determined outside the edge of the target area corresponding to the target object in the grayscale image.
[0095] There is a certain distance between the outline and the edge of the target area corresponding to the target object, and the distance corresponds to the category of the target object to be detected.
[0096] In step S502, a third set of regions surrounding the target region is determined along the contour line.
[0097] The third region set includes multiple detection regions, and the intervals between these regions correspond to the categories of the target objects to be detected.
[0098] In step S503, the center region of the target area corresponding to the target object in the grayscale image is determined.
[0099] In step S504, the location information and grayscale features of multiple detection areas in the third region set, and the location information and grayscale features of the central region are determined as the second information.
[0100] In this embodiment of the disclosure, a grayscale image of the target object whose detection result is normal is obtained, such as... Figure 8A and Figure 8B As shown, a detection region (the second region mentioned earlier) is set within the target object's internal area in the grayscale image to detect the target object. The location information and grayscale features of this detection region are saved for comparison with the actual target object's region features. Similarly, an outer contour line is defined around the target object in the grayscale image, with the distance between the outer contour line and the target object determined based on the target object's category. After determining the outer contour line, a set of contour detection regions is set on the outer contour line for contour region detection. The location information and corresponding grayscale features of each region in the contour detection region set are saved for comparison with the actual target object's region features.
[0101] It is understandable that the external contour of a target object can have regular contours such as rectangles and triangles, as well as irregular contours. When the external contour of the target object is irregular, the contour lines may not correspond to the actual contour of the target object. To improve detection efficiency, fewer contour lines can be set, reducing the computational load during feature calculation. Alternatively, to improve detection accuracy, more contour lines can be set.
[0102] In an exemplary embodiment of this disclosure, such as Figure 12 The flowchart illustrates the configuration method for the detection area during contour detection. In response to the start of the configuration process, a standard product image is imported and converted to grayscale. An area is selected within the material to be measured, denoted as the detection area T. Detection area T is located inside the material and must be at a certain distance from the material's edge. An algorithm is used to calculate the features of area T, typically grayscale features. The area information, including its location and grayscale features, is stored. Contour lines f (as shown in Figure A, contour lines f1, f2, f3, and f4) are selected. Contour lines f are located outside the material and maintain a certain distance from it. Based on the determined contour lines, contour detection areas a are automatically generated along the contour lines. All contour detection areas a constitute the contour detection area set A. The location information and grayscale features of all contour detection areas a are determined and saved, and these information are used as the contour feature detection information.
[0103] In this embodiment of the disclosure, the detection result of the target object needs to be determined based on the regional feature detection result (first feature detection result) and the contour feature detection result (first feature detection result) of the target object. The following embodiments of the disclosure describe the method for determining the detection result of the target object.
[0104] Figure 13This is a flowchart illustrating a method for determining the detection result of a target object based on a first feature detection result and a second feature detection result, according to an exemplary embodiment. Figure 13 As shown, the method includes steps S601, S602A, and S602B.
[0105] In step S601, the first feature detection result and the second feature detection result of the target object are obtained.
[0106] In step S602A, in response to the first feature detection result being abnormal and the second feature detection result being abnormal, it is determined that the detection result of the target object is abnormal.
[0107] In step S602B, in response to the presence of a normal detection result in either the first feature detection result or the second feature detection result, the detection result of the target object is determined to be normal.
[0108] In this embodiment, the target object detection method is mainly applied to the detection of materials inside the terminal, such as copper foil, thermal pads, and labels that have been removed. These materials have a negligible impact on the terminal's lifespan and performance; therefore, the standard for determining the target object's detection result is relatively lenient. If either the first feature detection result or the second feature detection result is normal, the target object detection result is determined to be normal.
[0109] Understandably, the determination of the detection result will change accordingly as the target object changes. If the target object being detected is an internal component of the terminal, the detection standard can be raised. If both the first feature detection result and the second feature detection result are normal, the target object detection result is determined to be normal.
[0110] In an exemplary embodiment of this disclosure, this disclosure can be applied to scenarios involving target object detection based on machine vision, such as... Figure 14 The diagram illustrates a scenario where machine vision is used to inspect materials. When the target object passes through the production line, an industrial camera captures an image of the target object and sends the image to an industrial control computer. The industrial control computer then runs the target object detection method mentioned in this disclosure based on its internal processing software, or sends the target object image to the cloud and runs the target object detection method mentioned in this disclosure to finally obtain the target object detection result.
[0111] In this embodiment, based on the grayscale image of a target object with normal detection results, region feature detection information and contour feature detection information are obtained. Monitoring areas for region feature detection are determined in the corner areas inside the target object, and the grayscale features and position information of the corresponding areas are determined and saved. Multiple detection areas for contour feature detection are determined in the contour areas outside the target object, and the grayscale features and position information of the corresponding areas are determined and saved. During target object detection, based on the position information contained in the pre-configured region feature detection information, the corresponding areas in the target object are determined, and the grayscale features of the corresponding areas are determined, thereby obtaining the region feature detection results. Based on the position information contained in the pre-configured contour feature detection information, multiple corresponding contour areas in the target object are determined, and the grayscale features of each corresponding contour area are determined. The grayscale feature detection results of each contour area are then judged, and the number of abnormal contour areas is determined, ultimately obtaining the contour feature detection results of the target object. In response to obtaining the region feature detection results and contour feature detection results of the target object, the overall detection result of the target object is obtained. This disclosure reduces the configuration time for configuring detection points during target object detection, improving the user experience. It also improves detection stability and reduces the over-detection rate and the under-detection rate. It reduces the parameters used in the detection, shortens the detection time, and improves detection efficiency.
[0112] Based on the same concept, this disclosure also provides a target object detection device 100.
[0113] It is understood that the target detection device 100 provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.
[0114] Figure 15 This is a block diagram illustrating a target detection device 100 according to an exemplary embodiment. (Refer to...) Figure 15 The device includes an acquisition unit 101, a processing unit 102, and a determination unit 103.
[0115] The acquisition unit 101 is used to acquire a grayscale image inside the terminal and determine the target region in the grayscale image.
[0116] There is a correspondence between the target area and the target object to be detected inside the terminal.
[0117] The processing unit 102 is used to perform feature detection on the target region, obtain a first feature detection result, and perform feature detection on the region surrounding the target region, obtain a second feature detection result.
[0118] The determining unit 103 is used to determine the detection result of the target object to be detected based on the first feature detection result and the second feature detection result.
[0119] In one embodiment, the processing unit 102 performs feature detection on the target region in the following manner: it performs feature detection on the target region based on preset first information, wherein the first information is the information of the target region in the grayscale image inside the terminal where the detection result is normal.
[0120] In one embodiment, the first information includes first location information and a first feature. The processing unit 102 performs feature detection on the target region based on the preset first information in the following manner: the region in the target region whose location corresponds to the first location information is determined as the first region; the grayscale features of the first region are obtained, and the first feature detection result of the target region is determined based on the difference between the grayscale features of the first region and the first feature.
[0121] In one embodiment, the processing unit 102 performs feature detection on the region surrounding the target region in the following manner: the target region is detected based on preset second information, wherein the second information is the information of the target region in the grayscale image inside the terminal where the detection result is normal and the information of the region surrounding the target region.
[0122] In one embodiment, the second information includes second location information, a second feature, third location information, and a third feature. The processing unit 102 performs feature detection on the target region based on the preset second information in the following manner: It determines the region in the target region whose location corresponds to the second location information as the second region; it acquires the grayscale features of the second region and detects the target object to be detected based on the difference between the grayscale features of the second region and the second feature; in response to the detection of the target object, it determines a set of multiple regions in the grayscale image corresponding to the third location information as the third region set; it acquires the grayscale features of each detected region in the third region set and determines the number of abnormal detected regions in the third region set based on the difference between the grayscale features of each detected region and the third feature; and it determines the second feature detection result of the target object to be detected based on the number of abnormal detected regions.
[0123] In one embodiment, the first information is determined by the processing unit 102 in the following manner: acquiring a grayscale image inside the terminal where the target object detection result is normal, determining the corner area of the target area corresponding to the target object in the grayscale image as the detection area, and determining the position information and grayscale features of the detection area as the first information.
[0124] In one embodiment, the second information is determined by the processing unit 102 in the following manner: A grayscale image of the terminal where the target object detection result is normal is acquired; a contour line is determined outside the edge of the target region corresponding to the target object in the grayscale image; a certain distance exists between the contour line and the edge of the target region corresponding to the target object, and this distance corresponds to the category of the target object to be detected; a third region set surrounding the target region is determined along the contour line; the third region set includes multiple detection regions, and the interval between the multiple detection regions corresponds to the category of the target object to be detected; the central region of the target region corresponding to the target object in the grayscale image is determined; and the position information and grayscale features of the multiple detection regions in the third region set, and the position information and grayscale features of the central region are determined as the second information.
[0125] In one embodiment, the determining unit 103 determines the detection result of the target object based on the first feature detection result and the second feature detection result in the following manner: In response to both the first feature detection result and the second feature detection result being abnormal, the detection result of the target object is determined to be abnormal. In response to the presence of a normal detection result among the first and second feature detection results, the detection result of the target object is determined to be normal.
[0126] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0127] Figure 16 This is a block diagram illustrating an apparatus 200 for target detection according to an exemplary embodiment. The apparatus 200 can be provided as a terminal. For example, the apparatus 200 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0128] Reference Figure 16 The device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input / output (I / O) interface 212, sensor component 214, and communication component 216.
[0129] Processing component 202 typically controls the overall operation of device 200, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 202 may include one or more modules to facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.
[0130] Memory 204 is configured to store various types of data to support the operation of device 200. Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0131] The power supply component 206 provides power to the various components of the device 200. The power supply component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 200.
[0132] Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 208 includes a front-facing camera and / or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0133] Audio component 210 is configured to output and / or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or transmitted via communication component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.
[0134] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0135] Sensor assembly 214 includes one or more sensors for providing status assessments of various aspects of device 200. For example, sensor assembly 214 may detect the on / off state of device 200, the relative positioning of components such as the display and keypad of device 200, changes in the position of device 200 or a component of device 200, the presence or absence of user contact with device 200, the orientation or acceleration / deceleration of device 200, and temperature changes of device 200. Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 214 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0136] Communication component 216 is configured to facilitate wired or wireless communication between device 200 and other devices. Device 200 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 216 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0137] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, which can be executed by a processor 220 of the device 200 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0139] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0140] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.
[0141] It is further understood that the terms “center,” “longitudinal,” “lateral,” “front,” “rear,” “up,” “down,” “left,” “right,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” and “outer,” etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this embodiment and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation.
[0142] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.
[0143] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.
[0144] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0145] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for detecting a target object, characterized in that, include: Acquire a grayscale image from within the terminal, and determine the target area corresponding to the target object to be detected in the grayscale image. The target area is determined based on the design area of the target object to be detected in the standard product image of the terminal. Based on preset first information, feature detection is performed on the target region to obtain a first feature detection result. Based on preset second information, feature detection is performed on the target region to obtain a second feature detection result. The first information is the information of the target region in the grayscale image inside the terminal where the detection result is normal, and the first information includes first location information and first feature. The second information is the information of the target region in the grayscale image inside the terminal where the detection result is normal and the information of the region surrounding the target region. The first feature detection result indicates whether the grayscale feature of the target region is abnormal, and the second feature detection result indicates whether the contour feature of the target object to be detected is abnormal. Based on the first feature detection result and the second feature detection result, the detection result of the target object to be detected is determined; The step of performing feature detection on the target region based on preset first information and obtaining a first feature detection result includes: The region in the target area whose location corresponds to the first location information is defined as the first region; The grayscale features of the first region are obtained, and the detection result of the first feature of the target region is determined based on the difference between the grayscale features of the first region and the first feature. The second information is determined in the following way: A grayscale image of the terminal where the target object detection result is normal is obtained. A contour line is determined outside the edge of the target area corresponding to the target object in the grayscale image. There is a certain distance between the contour line and the edge of the target area corresponding to the target object. The distance corresponds to the category of the target object to be detected. A third set of regions is determined along the contour line to surround the target region. The third set of regions includes multiple detection regions, and the interval between the multiple detection regions corresponds to the category of the target object to be detected. Determine the central region of the target region in the grayscale image that corresponds to the target object; The location information and grayscale features of multiple detection regions in the third region set, and the location information and grayscale features of the central region are determined as the second information.
2. The method according to claim 1, characterized in that, The second information includes second location information, second feature, third location information, and third feature; The feature detection of the target region based on preset second information includes: The region in the target area whose location corresponds to the second location information is determined as the second region; The grayscale features of the second region are obtained, and the target object to be detected is detected based on the difference between the grayscale features of the second region and the second feature. In response to the detection of the target object, multiple regions in the grayscale image corresponding to the third location information are determined as a third region set; The grayscale features of each detection region in the third region set are obtained, and the number of detection regions with anomalies in the third region set is determined based on the difference between the grayscale features of each detection region and the third feature. Based on the number of detection areas with anomalies, the second feature detection result of the target object to be detected is determined.
3. The method according to claim 1, characterized in that, The first information is determined in the following way: A grayscale image of the terminal whose target object detection result is normal is obtained. The corner area of the target area corresponding to the target object in the grayscale image is determined as the detection area, and the position information and grayscale features of the detection area are determined as the first information.
4. The method according to claim 1, characterized in that, The step of determining the detection result of the target object to be detected based on the first feature detection result and the second feature detection result includes: In response to the first feature detection result being abnormal and the second feature detection result being abnormal, it is determined that the detection result of the target object is abnormal; In response to the presence of a normal detection result in either the first feature detection result or the second feature detection result, the detection result of the target object is determined to be normal.
5. A target object detection device, characterized in that, include: The acquisition unit acquires a grayscale image from inside the terminal and determines a target area corresponding to the target object to be detected in the grayscale image. The target area is determined based on the design area of the target object to be detected in the standard product image of the terminal. The processing unit is configured to perform feature detection on the target region based on preset first information to obtain a first feature detection result, and perform feature detection on the target region based on preset second information to obtain a second feature detection result. The first information is the information of the target region in a grayscale image inside the terminal where the detection result is normal, and the first information includes first location information and first feature. The second information is the information of the target region in a grayscale image inside the terminal where the detection result is normal and the information of the region surrounding the target region. The first feature detection result indicates whether the grayscale features of the target region are abnormal, and the second feature detection result indicates whether the contour features of the target object to be detected are abnormal. The determining unit is configured to determine the detection result of the target object to be detected based on the first feature detection result and the second feature detection result; The processing unit performs feature detection on the target region based on preset first information in the following manner to obtain a first feature detection result: The region in the target area whose location corresponds to the first location information is defined as the first region; The grayscale features of the first region are obtained, and the detection result of the first feature of the target region is determined based on the difference between the grayscale features of the first region and the first feature. The second information is determined by the processing unit in the following manner: A grayscale image of the terminal where the target object detection result is normal is obtained. A contour line is determined outside the edge of the target area corresponding to the target object in the grayscale image. There is a certain distance between the contour line and the edge of the target area corresponding to the target object. The distance corresponds to the category of the target object to be detected. A third set of regions is determined along the contour line to surround the target region. The third set of regions includes multiple detection regions, and the interval between the multiple detection regions corresponds to the category of the target object to be detected. Determine the central region of the target region in the grayscale image that corresponds to the target object; The location information and grayscale features of multiple detection regions in the third region set, and the location information and grayscale features of the central region are determined as the second information.
6. A target object detection device, characterized in that, include: processor: Memory used to store processor-executable instructions; The processor is configured to execute the target detection method according to any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores instructions that, when executed by a processor, enable the processor to perform the target detection method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Space target segmentation network and method based on edge perception attention mechanism
CN115984293A
Edge defect detection method and device, electronic equipment and storage medium
CN116188379A