Abnormality detection method and device, electronic equipment and storage medium
By acquiring image quality indicators of wind power control cabinets and implementing optimization strategies, the problem of false detection and missed detection caused by environmental influences in the inspection of large wind power control cabinets was solved, and high-precision anomaly detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JABIL CIRCUIT (WUXI) CO LTD
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-19
Smart Images

Figure CN122244649A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of mechanical equipment anomaly detection technology, specifically relating to an anomaly detection method, device, electronic equipment, and storage medium. Background Technology
[0002] Large wind power control cabinets integrate hundreds of components. Before leaving the factory, the following items need to be checked for abnormalities: indicator light status, label affixing, cable binding, terminal crimping, nameplate integrity, and paint scratches.
[0003] The relevant technologies typically use artificial intelligence (AI) visual automatic detection technology to detect anomalies in large wind power control cabinets. However, the detection technology is easily affected by the environment. When there are environmental problems such as light fluctuations and reflections at the detection site of large wind power control cabinets, inaccurate detection problems such as false detection and missed detection are likely to occur. Summary of the Invention
[0004] This application provides an anomaly detection method, device, electronic equipment, and storage medium, which can solve the problem of inaccurate anomaly detection in large wind power control cabinets due to environmental influences.
[0005] In a first aspect, embodiments of this application provide an anomaly detection method, the method comprising: acquiring an image quality index of a first detection image of a target object; if it is determined from the image quality index that the first detection image has an image quality anomaly, executing an optimization strategy corresponding to the image quality anomaly; acquiring a second detection image of the target object according to the optimization strategy; and performing anomaly detection on the target object based on the second detection image.
[0006] Secondly, embodiments of this application provide an anomaly detection device, which includes: a first acquisition module for acquiring an image quality index of a first detection image of a target object; an execution module for executing an optimization strategy corresponding to the image quality anomaly when it is determined that the first detection image has an image quality anomaly based on the image quality index; a second acquisition module for acquiring a second detection image of the target object according to the optimization strategy; and a detection module for performing anomaly detection on the target object based on the second detection image.
[0007] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0009] In this embodiment, an image quality index of a first detection image of the target object is obtained; if an image quality anomaly is determined to exist in the first detection image based on the image quality index, an optimization strategy corresponding to the quality anomaly is executed; a second detection image of the target object is obtained based on the optimization strategy; and anomaly detection is performed on the target object based on the second detection image. Even in complex detection environments, the optimization strategy can still output a high-quality, high-precision second detection image, thereby improving the accuracy, robustness, and generalization of anomaly detection and avoiding the problem that the detection environment affects image quality, leading to inaccurate anomaly detection of the target object. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating an anomaly detection method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an anomaly detection device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0014] The anomaly detection method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0015] Figure 1 This application illustrates an embodiment of an anomaly detection method, which can be executed by an electronic device for anomaly detection. In other words, the method can be executed by software or hardware installed in the electronic device, and includes the following steps: Step S101: Obtain the image quality index of the first detection image of the target object.
[0016] In this embodiment, the target object for anomaly detection can be a wind power control cabinet. In other embodiments, the target object can also be other tooling equipment, such as a converter control cabinet or a main control system cabinet. This embodiment does not specifically limit the target object.
[0017] In this embodiment, a first detection image of the target object can be captured by a camera, and the image quality index of the first detection image can be obtained. In this embodiment, the image quality index of the first detection image may include the brightness distribution, highlight ratio, and key area sharpness of the first detection image.
[0018] Step S102: If it is determined that the first detection image has an image quality abnormality based on the image quality index, execute the optimization strategy corresponding to the quality abnormality.
[0019] In this embodiment, the detection site of the target object is susceptible to problems such as lighting fluctuations, metal reflections, and shadows inside the cabinet, leading to unstable image quality. Therefore, after obtaining the image quality index of the first detection image, it is necessary to analyze the image quality of the first detection image based on the obtained image quality index. In this embodiment, if it is determined that the first detection image has an image quality abnormality based on the image quality index, it is necessary to execute an optimization strategy corresponding to the image quality abnormality to adjust the detection.
[0020] In one embodiment, the image quality index includes brightness distribution. If it is determined that the first detection image has an image quality abnormality based on the image quality index, an optimization strategy corresponding to the image quality abnormality is executed, including: if it is determined that the overall brightness of the first detection image is less than a brightness threshold based on the brightness distribution, it is determined that the first detection image has a low-light image quality abnormality; and an optimization strategy corresponding to the low-light is executed, the optimization strategy including increasing the supplementary lighting brightness for the target object.
[0021] In this embodiment, based on the acquired image quality indicators, it is determined whether the first detection image has image quality abnormalities, which is also equivalent to determining whether there are problems with the shooting environment. Specifically, based on the brightness distribution of the first detection image, it can be determined whether the overall brightness of the first detection image is too dark and details are indistinguishable.
[0022] Specifically, if the overall brightness of the first detection image is determined to be less than a preset brightness threshold based on the brightness distribution of the first detection image, it can be determined that the first detection image has an image quality abnormality due to low illumination (overall darkness). In this case, the low illumination optimization strategy implemented includes increasing the brightness of the fill light for the target object, for example, automatically increasing the brightness of the fill light to illuminate the target object.
[0023] In one embodiment, the image quality index includes the highlight ratio. If the first detection image is determined to have an image quality abnormality based on the image quality index, an optimization strategy corresponding to the image quality abnormality is executed, including: if the highlight ratio of the first detection image is greater than the ratio threshold, it is determined that the first detection image has an image quality abnormality of excessive reflection; and an optimization strategy corresponding to excessive reflection is executed, the optimization strategy including enabling polarization imaging and switching the anti-reflection model for image acquisition.
[0024] In this embodiment, the proportion of detail-less pure white areas formed by reflections or strong light in the first detection image can be determined based on the highlight ratio of the first detection image. Specifically, if the highlight ratio of the first detection image exceeds a threshold, it can be determined that the first detection image has abnormal image quality due to excessive reflection. In this case, the optimization strategy for excessive reflection includes enabling polarization imaging and switching the anti-reflection model for image acquisition. Polarization imaging can filter out most of the cluttered reflections, improving image clarity. The anti-reflection model is a specially trained AI model that excels at identifying targets in reflective scenes, essentially acting as a "reflection recognition expert."
[0025] In one embodiment, the image quality index includes the sharpness of key regions. If it is determined that the first detection image has an image quality abnormality based on the image quality index, an optimization strategy corresponding to the image quality abnormality is executed, including: if the sharpness of key regions is less than a sharpness threshold, it is determined that the first detection image has a problem of unclear key regions; and an optimization strategy corresponding to the unclear key regions is executed, the optimization strategy including improving the detection sensitivity for key regions.
[0026] In this embodiment, the clarity of key regions in the first detection image can be detected based on the clarity of those key regions. For example, the first detection image may be generally fine, but areas requiring precise identification, such as indicator lights and labels, may be unclear. Specifically, if the clarity of key regions in the first detection image is less than a clarity threshold, it can be determined that the first detection image has an image quality abnormality due to unclear key regions. In this case, the optimization strategies corresponding to unclear key regions include improving the detection sensitivity of key regions and focusing on key regions such as indicator lights and labels, for example, by automatically magnifying or enhancing contrast.
[0027] In this embodiment, during the anomaly detection process of the target object, image quality indicators such as brightness distribution (the overall brightness and darkness of the image and the uniformity of the distribution of bright and dark areas), highlight ratio (the proportion of pure white areas without details formed by reflection or strong light in the image), and key area clarity are collected simultaneously. If image quality anomalies such as excessive reflection, low illumination, or unclear key areas are identified, a multi-dimensional optimization strategy is automatically triggered to form a closed loop of image quality perception, strategy optimization, and result verification. This significantly improves the accuracy of anomaly detection of target objects in complex environments, reduces false alarms and false detections, and greatly improves the accuracy, robustness, and generalization ability of target object detection.
[0028] Step S103: Obtain the second detection image of the target object according to the optimization strategy.
[0029] In this embodiment, the adaptation method between image quality anomalies and optimization strategies is as follows: Excessive Reflection: Enable polarization imaging and switch to anti-reflection model simultaneously.
[0030] Low light level: Automatically adjusts the brightness of the supplementary light.
[0031] Unclear key areas: Improve the detection sensitivity of key areas.
[0032] In this embodiment, the aforementioned optimization strategies can be executed individually or in combination. After result verification and adjustment of the closed-loop optimization strategy, the optimized strategy can be used to re-capture the second detection image of the target object, and it can be determined whether the second detection image has image quality anomalies. If the second detection image does not have image quality anomalies, subsequent anomaly detection processes can be performed based on the second detection image. If the second detection image still has image quality anomalies, the process returns to the environmental perception stage to re-analyze the problem and execute the optimization strategy until the image quality anomalies are resolved.
[0033] Step S103: Perform anomaly detection on the target object based on the second detection image.
[0034] In this embodiment, if the second detection image does not have any image quality abnormalities, subsequent anomaly detection processes can be performed based on the second detection image. Specifically, the abnormal features of the target object (indicator status, label pasting, paint scratches, etc.) can be accurately extracted from the second detection image, and then anomaly confidence is intelligently determined (if the confidence is ≥99%, it is considered qualified; otherwise, a re-detection is triggered), and finally, a structured detection result (including anomaly type, location, associated images, etc.) is generated.
[0035] In this embodiment, an image quality index of a first detection image of the target object is obtained; if the first detection image is determined to have an image quality anomaly based on the image quality index, an optimization strategy corresponding to the quality anomaly is executed; a second detection image of the target object is obtained based on the optimization strategy; and anomaly detection is performed on the target object based on the second detection image. Even in complex detection environments, the optimization strategy can still output a high-quality, high-precision second detection image, thereby improving the accuracy, robustness, and generalization of anomaly detection and avoiding the problem of inaccurate anomaly detection of the target object caused by the image quality anomaly of the first detection image.
[0036] In one embodiment, obtaining the image quality index of a first detected image of a target object includes: calculating the center point coordinates of the target object in the world coordinate system and the left-right tilt, front-back tilt, and planar rotation of the target object based on multiple feature points of the target object; performing rotation compensation on preset detection points based on the left-right tilt, front-back tilt, and planar rotation, and performing translation compensation on preset detection points based on the center point coordinates to transform the preset detection points to the world coordinate system, thereby obtaining the true position of the preset detection points in the world coordinate system, the true position being used to map the preset detection points to the physical position of the target object; obtaining the first detected image of the target object based on the true position of the preset detection points; and obtaining the image quality index based on the first detected image.
[0037] In the field scenario of wind power control cabinets, due to their large size and weight, the placement of wind power control cabinets by manual hoisting may result in a positional deviation of ±50mm to 100mm. This leads to problems such as false detection and inaccurate detection caused by the positional deviation in traditional anomaly detection solutions.
[0038] In this embodiment, after the target object is placed and before capturing the first detection image of the target object, the three-dimensional localization of the target object can be performed first. The outer contour, door frame corners and other feature points of the target object can be identified by the top global camera, and the actual X / Y / Z / θ pose of the target object can be calculated. This pose is used as the base reference for this detection. All 200+ detection points are stored with relative offsets and are automatically mapped to the real position during runtime.
[0039] Specifically, a camera can capture partial images of the target object, and visual algorithms can be used to identify multiple fixed feature points on the surface of the target object, such as the four corner door frames of the wind power control cabinet, the fixing screw holes on the edge panel, and the corner points of the front boundary. These feature points are spatially stable and easy to identify, and can be used to estimate the overall posture of the cabinet.
[0040] The three-dimensional pose of a target object in the world coordinate system (space) can be calculated based on multiple identified feature points. Specifically, this includes calculating the target's true position and orientation in the world coordinate system, where the coordinates of the target object's center point are... The target object's three rotational directions (lateral, vertical, and depth) constitute its body coordinate system, representing its current actual placement. This yields the target object's complete 3D pose, including whether it is tilted forward, whether its left side is higher, whether it has undergone horizontal rotation, and whether it has moved as a whole. This pose serves as the base reference for this detection.
[0041] Specifically, the coordinates of the center point of the target object can be calculated using the following formula: / 4 / 4 / 4
[0042] in, Represents the coordinates of the center point of the target object, ( ), ( ), ( ), ( ) represent the coordinates of the four feature points respectively.
[0043] The rotation matrix R is 3 An orthogonal matrix of 3, used to describe left-right tilt (Roll), forward-backward tilt (Pitch), and horizontal rotation (Yaw): =[[r 11 r 12 r 13 ], [r 21 r 22 r 23 ], [r 31 r 32 r 33 ]] Among them, [r 11 r 12 r 13 [r] is used to describe left and right tilt (Roll), 21 r 22 r 23 [r] is used to describe the forward and backward tilt (Pitch). 31 r 32 r 33 Used to describe horizontal rotation (Yaw).
[0044] The center point coordinates of the target object The rotation matrix R is set as the Base reference. The function of the Base reference is equivalent to: "fixing the current true position and orientation of the target object, and transforming all other detection points based on this coordinate system." Each subsequent detection point will be mapped to its position based on this Base reference.
[0045] In this embodiment, multiple preset detection points are pre-configured using the rack's own local coordinates. These preset detection points are based on the "standard installation position" of the target object. The coordinates of each preset detection point are stored relative to the target object's local coordinate system, i.e., how much it is offset horizontally from the target object's reference point, how much it is offset from the top or bottom of the target object, and how much it is offset in the depth direction inside the rack. These local coordinates are independent of the target object's current tilt or movement. In other words, the preset detection points reflect the standard position of the rack during design, not the actual position on site.
[0046] In this embodiment, the preset detection point can be mapped to the world coordinate system. In order to obtain the real coordinates of the preset detection point on site, a two-step conversion is required. First, the preset detection point is converted from the "local coordinates of the target object" to the "world coordinates". Taking into account all the tilts and rotations of the target object, this step will automatically compensate for: left and right tilt (Roll), front and back tilt (Pitch), and horizontal rotation (Yaw). That is to say, "the preset detection point will tilt in the same way as the target object".
[0047] Specifically, the local coordinates of the preset detection points : (△X, △Y, △Z) Coordinates of rotational transformation (compensated attitude) : R
[0048] In this embodiment, the preset detection point coordinates can also be translated to the true center position of the target object by position translation transformation. This step compensates for the actual X-direction position offset, Y-direction position offset, and Z-height change, ultimately obtaining the true position of the preset detection point in the world coordinate system.
[0049] Coordinates of translation transformation (compensated position) : C+
[0050] Even if the cabinet tilts, rotates, or shifts, the preset detection point will still fall on the correct physical location of the target object. This ensures that the camera's XYZ+pan-tilt-zoom (PTZ) shooting will not cause the preset detection point to shift, and it will automatically compensate for on-site placement errors, vibrations, and changes in tray height. No matter how the target object is positioned on-site, the preset detection point will always accurately map to its true physical location for detection.
[0051] In one embodiment, before acquiring the image quality index of the first detected image of the target object, the method further includes: receiving a detection instruction through a control channel, the detection instruction being used to instruct anomaly detection of the target object; and independently polling a servo enable signal, a limit signal, and an emergency stop signal through a status channel.
[0052] Traditional wind turbine cabinet testing processes are lengthy, and single programmable logic controller (PLC) channels are prone to communication congestion, leading to motion interruptions or status loss, thus affecting the overall cabinet testing reliability. The anomaly detection method provided in this application employs a dual-channel PLC architecture and incremental result reporting, ensuring long-term operational stability and real-time interactive capabilities.
[0053] Specifically, in this embodiment, a detection command is received via a control channel, instructing anomaly detection of the target object. The servo enable signal, limit signal, and emergency stop signal are independently polled via a status channel. In this embodiment, after each area (e.g., the "left door indicator light group") is completed, structured results are immediately pushed to the Human Machine Interface (HMI) and Manufacturing Execution System (MES) via the Transmission Control Protocol (TCP). This ensures uninterrupted communication during target object anomaly detection and allows engineers to view the results of detected areas, pause, or skip non-critical items during the detection process, significantly improving on-site operational flexibility.
[0054] In one embodiment, after performing anomaly detection on the target object based on the second detection image, the method further includes: acquiring relevant information related to the target object and anomaly detection results obtained from performing anomaly detection on the target object; and generating improvement suggestions based on the relevant information and the anomaly detection results.
[0055] Traditional wind turbine cabinet inspection processes have long been independent of the production system. Anomaly records are stored locally, unable to be linked to specific assembly stations, material batches, or operators, leading to repeated occurrences of the same cabinet type and the same defect. Specifically, this approach can obtain relevant information about the target object, such as the current cabinet serial number (SN), work order number, and assembly team. After anomaly detection is completed, the anomaly type (e.g., "label misalignment"), location (e.g., "inside the left door"), and image are linked to the anomaly detection results. A rule engine identifies high-frequency patterns (e.g., "3 consecutive cabinets with NG labels in a certain team") and generates improvement suggestions based on relevant information and anomaly detection results. For example, it might suggest training on label pasting for assembly station #5. This creates a closed loop of "detection-analysis-feedback" and automatically generates actionable improvement suggestions, reducing quality anomaly response time from "weekly" to "minute-level," lowering the production line anomaly rate, and significantly improving the first-pass yield of the target object.
[0056] It should be noted that the anomaly detection method provided in this application embodiment can be executed by an anomaly detection device or a control module within that anomaly detection device for executing the anomaly detection method. This application embodiment uses the execution of the anomaly detection method by an anomaly detection device as an example to illustrate the anomaly detection device provided in this application embodiment.
[0057] Figure 2 This is a schematic diagram of the structure of an anomaly detection device according to an embodiment of this application. Figure 2As shown, the anomaly detection device 200 includes: a first acquisition module 210, an execution module 220, a second acquisition module 230, and a detection module 240.
[0058] The first acquisition module 210 is used to acquire the image quality index of the first detection image of the target object; the execution module 220 is used to execute an optimization strategy corresponding to the image quality abnormality when it is determined that the first detection image has an image quality abnormality based on the image quality index; the second acquisition module 230 is used to acquire the second detection image of the target object according to the optimization strategy; and the detection module 240 is used to perform anomaly detection on the target object based on the second detection image.
[0059] In one embodiment, the image quality index includes brightness distribution, and the execution module 220 is configured to: determine that the first detection image has low-light image quality abnormality when the overall brightness of the first detection image is less than a brightness threshold according to the brightness distribution; and execute the optimization strategy corresponding to the low-light, wherein the optimization strategy includes increasing the supplementary lighting brightness for the target object.
[0060] In one embodiment, the image quality index includes the highlight ratio, and the execution module 220 is configured to: determine that the first detected image has an image quality abnormality due to excessive reflection when the highlight ratio of the first detected image is greater than the ratio threshold; and execute the optimization strategy corresponding to the excessive reflection, wherein the optimization strategy includes enabling polarization imaging and switching the anti-reflection model for image acquisition.
[0061] In one embodiment, the image quality index includes the sharpness of key regions, and the execution module 220 is configured to: determine that the first detected image has an image quality abnormality due to unclear key regions when the sharpness of key regions is less than a sharpness threshold; and execute an optimization strategy corresponding to the unclear key regions, wherein the optimization strategy includes improving the detection sensitivity for key regions.
[0062] In one embodiment, the first acquisition module 210 is configured to calculate the center point coordinates of the target object in the world coordinate system, as well as the left-right tilt, front-back tilt, and planar rotation of the target object, based on multiple feature points of the target object; perform rotation compensation on a preset detection point based on the left-right tilt, front-back tilt, and planar rotation, and perform translation compensation on the preset detection point based on the center point coordinates to transform the preset detection point to the world coordinate system, thereby obtaining the true position of the preset detection point in the world coordinate system. The true position is used to map the preset detection point to the physical position of the target object; acquire a first detection image of the target object based on the true position of the preset detection point; and acquire the image quality index based on the first detection image.
[0063] In one embodiment, the detection module 240 is further configured to receive a detection instruction via a control channel, the detection instruction being used to instruct anomaly detection of the target object; and to independently poll the servo enable signal, limit signal, and emergency stop signal via a status channel.
[0064] In one embodiment, the detection module 240 is further configured to acquire relevant information related to the target object and anomaly detection results obtained by performing anomaly detection on the target object; and generate improvement suggestions based on the relevant information and the anomaly detection results.
[0065] The anomaly detection device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0066] The anomaly detection device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0067] The anomaly detection device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0068] Optionally, such as Figure 3 As shown in the illustration, this application embodiment also provides an electronic device 300, including a processor 301 and a memory 302. The memory 302 stores a program or instructions that can run on the processor 301. When the program or instructions are executed by the processor 301, they perform the following: acquiring an image quality index of a first detection image of a target object; if it is determined from the image quality index that the first detection image has an image quality abnormality, executing an optimization strategy corresponding to the image quality abnormality; acquiring a second detection image of the target object according to the optimization strategy; and performing anomaly detection on the target object based on the second detection image.
[0069] In one implementation, the image quality index includes a brightness distribution. If, based on the brightness distribution, the overall brightness of the first detected image is determined to be less than a brightness threshold, then the first detected image is determined to have a low-light image quality anomaly. An optimization strategy corresponding to the low-light condition is then executed, the optimization strategy including increasing the supplementary lighting brightness for the target object.
[0070] In one implementation, the image quality index includes the highlight ratio. If the highlight ratio of the first detected image is greater than the ratio threshold, it is determined that the first detected image has an image quality abnormality due to excessive reflection. An optimization strategy corresponding to the excessive reflection is executed. The optimization strategy includes enabling polarization imaging and switching the anti-reflection model for image acquisition.
[0071] In one implementation, the image quality metric includes the sharpness of key regions. If the sharpness of key regions is less than a sharpness threshold, it is determined that the first detected image has an image quality abnormality due to unclear key regions. An optimization strategy corresponding to the unclear key regions is then executed, and the optimization strategy includes improving the detection sensitivity for key regions.
[0072] In one implementation, based on multiple feature points of the target object, the coordinates of the center point of the target object in the world coordinate system, as well as the left-right tilt, front-back tilt, and planar rotation of the target object are calculated. Rotation compensation is applied to a preset detection point based on the left-right tilt, front-back tilt, and planar rotation. Translation compensation is applied to the preset detection point based on the center point coordinates to transform the preset detection point to the world coordinate system, obtaining the true position of the preset detection point in the world coordinate system. This true position is used to map the preset detection point to the physical position of the target object. A first detection image of the target object is obtained based on the true position of the preset detection point. Based on the first detection image, the image quality index is obtained.
[0073] In one implementation, before acquiring the image quality index of the first detected image of the target object, a detection instruction is received through a control channel, the detection instruction being used to instruct anomaly detection of the target object; and a servo enable signal, limit signal, and emergency stop signal are independently polled through a status channel.
[0074] In one implementation, after performing anomaly detection on the target object based on the second detection image, relevant information related to the target object and anomaly detection results obtained from performing anomaly detection on the target object are acquired; and improvement suggestions are generated based on the relevant information and the anomaly detection results.
[0075] The specific execution steps can be found in the various steps of the above-described anomaly detection method embodiments, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0076] It should be noted that the electronic devices in the embodiments of this application include: servers, terminals, or other devices besides terminals.
[0077] The above electronic device structure does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or arrange them differently. For example, an input unit may include a Graphics Processing Unit (GPU) and a microphone, and a display unit may use a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar display panels. User input units include at least one of a touch panel and other input devices. A touch panel is also called a touchscreen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.
[0078] Memory can be used to store software programs and various data. Memory can primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory can include volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).
[0079] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.
[0080] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described anomaly detection method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0081] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as ROM, RAM, magnetic disk, or optical disk.
[0082] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0084] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An anomaly detection method, characterized in that, include: Obtain the image quality index of the first detected image of the target object; If the first detected image is determined to have an image quality abnormality based on the image quality index, an optimization strategy corresponding to the image quality abnormality is executed. According to the optimization strategy, a second detection image of the target object is obtained; Based on the second detected image, anomaly detection is performed on the target object.
2. The method according to claim 1, characterized in that, The image quality index includes brightness distribution. When it is determined that the first detected image has an image quality abnormality based on the image quality index, the optimization strategy corresponding to the image quality abnormality is executed, including: If, based on the brightness distribution, the overall brightness of the first detected image is determined to be less than a brightness threshold, then the first detected image is determined to have an image quality abnormality due to low illumination. The optimization strategy corresponding to the low illumination is executed, and the optimization strategy includes increasing the supplementary lighting brightness for the target object.
3. The method according to claim 1, characterized in that, The image quality index includes the highlight ratio. When it is determined that the first detected image has an image quality abnormality based on the image quality index, the optimization strategy corresponding to the image quality abnormality is executed, including: If the highlight ratio of the first detected image is greater than the ratio threshold, it is determined that the first detected image has an image quality abnormality due to excessive reflection. The optimization strategy corresponding to the excessive reflection is executed, which includes enabling polarization imaging and switching the anti-reflection model for image acquisition.
4. The method according to claim 1, characterized in that, The image quality index includes the sharpness of key regions. When it is determined that the first detected image has an image quality anomaly based on the image quality index, the optimization strategy corresponding to the image quality anomaly is executed, including: If the clarity of the critical region is less than the clarity threshold, it is determined that the first detected image has an image quality abnormality due to unclear critical regions. An optimization strategy is implemented for the unclear key regions, the optimization strategy including improving the detection sensitivity for the key regions.
5. The method according to claim 1, characterized in that, Obtain the image quality metrics of the first detected image of the target object, including: Based on multiple feature points of the target object, calculate the coordinates of the center point of the target object in the world coordinate system, as well as the left and right tilt, forward and backward tilt, and planar rotation of the target object; The preset detection point is rotated and compensated based on left and right tilt, forward and backward tilt and planar rotation. The preset detection point is translated and compensated based on the coordinates of the center point to transform the preset detection point to the world coordinate system and obtain the true position of the preset detection point in the world coordinate system. The true position is used to map the preset detection point to the physical position of the target object. Based on the actual position of the preset detection points, obtain the first detection image of the target object; Based on the first detected image, the image quality index is obtained.
6. The method according to claim 5, characterized in that, Before obtaining the image quality index of the first detected image of the target object, the method further includes: The system receives a detection command through a control channel, the detection command being used to instruct anomaly detection of the target object. The servo enable signal, limit signal, and emergency stop signal are independently polled through the status channel.
7. The method according to claim 1, characterized in that, After performing anomaly detection on the target object based on the second detected image, the method further includes: Obtain relevant information related to the target object and anomaly detection results obtained by performing anomaly detection on the target object; Based on the relevant information and the anomaly detection results, improvement suggestions are generated.
8. An anomaly detection device, characterized in that, include: The first acquisition module is used to acquire the image quality index of the first detection image of the target object; The execution module is used to execute an optimization strategy corresponding to the image quality abnormality when it is determined that the first detected image has an image quality abnormality based on the image quality index. The second acquisition module is used to acquire a second detection image of the target object according to the optimization strategy; The detection module is used to perform anomaly detection on the target object based on the second detection image.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the anomaly detection method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the anomaly detection method as described in any one of claims 1-7.