DPI spectrometer detection method, equipment, storage medium and device
Through AprilTag code image alignment and similarity evaluation technology, the problems of high inspection cost and scenario limitations in the DPI spectrometer detection solution are solved, and automated, low-cost spectrometer change detection and early warning are achieved.
Patent Information
- Application Number
- CN202311091358.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-08-28
AI Technical Summary
The existing DPI spectrometer detection solution has high inspection costs and is limited by scenarios and cannot cope with the changes of multiple types of DPI spectrometers, resulting in low inspection efficiency.
The AprilTag-based image alignment technology is used in combination with a similarity evaluation method to automatically detect changes in the DPI spectrometer, including image alignment, key area segmentation, and similarity calculation, to achieve aligned image evaluation and anomaly detection.
It realizes the detection and early warning of spectrometer changes in the case of cabinet door obstruction, reduces the cost of manual inspection, avoids missed inspections, and improves inspection efficiency.
Smart Images

Figure CN117132567B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a DPI spectrometer detection method, equipment, storage medium and device. Background Art
[0002] The optical splitter of a DPI device has the ability to identify and control service data flows, and is closely related to the data security of the IDC room. Because the DPI optical splitter wiring controls the connection between network devices and the IDC core network equipment, the wiring of the DPI optical splitter equipment in the IDC room must be guaranteed to be error-free at all times. Daily inspections are required to ensure that the wiring is correct and avoid potential data leaks and other risks.
[0003] Current methods for detecting optical splitters in DPI devices can be categorized into two main types: manual inspections and unobstructed optical splitter detection algorithms. 1) Manual inspections, still the method used in most computer rooms, involve dedicated personnel patrolling the room at fixed intervals, inspecting each optical splitter cabinet to ensure that the splitter wiring remains intact. 2) Unobstructed optical splitter detection algorithms are used. These algorithms detect optical splitters without cabinet door obstructions. They typically compare the original, unobstructed image with the image to be detected. Similarity algorithms or neural network models are typically used for the comparison, and alerts are issued if any changes are detected.
[0004] However, manual inspections have the following disadvantages: (1) Large computer rooms often have tens of thousands of devices, making manual inspections extremely costly. Furthermore, the low temperature and noise levels in computer rooms make it difficult for people to stay for long periods of time. (2) Manual inspections are prone to missed inspections due to fatigue and poor vision, resulting in low inspection efficiency and frequency, making it difficult to conduct inspections at night.
[0005] Existing algorithms for detecting optical splitters without cabinet door obstruction have the following disadvantages: (1) To prevent unauthorized wiring, cabinets in computer rooms are currently equipped with cabinet doors. The application of such algorithms still requires manual intervention to open the cabinet doors and capture images for algorithm comparison, making them difficult to directly apply to computer room cabinets with closed doors in normal conditions. (2) Such algorithms determine whether the optical splitters have changed by detecting the number and position of the optical splitters. This is heavily constrained by prior features and cannot flexibly respond to other types of DPI optical splitter changes.
[0006] Therefore, the existing DPI spectrometer detection solution has high inspection costs and is subject to scenario restrictions, which makes it unable to flexibly cope with changes in multiple types of DPI spectrometers, thereby resulting in low inspection efficiency and affecting user use. Summary of the Invention
[0007] The main purpose of the present invention is to provide a DPI spectrometer detection method, equipment, storage medium and device, aiming to solve the technical problems that the existing DPI spectrometer detection scheme has high inspection costs and is limited by scenarios, resulting in the inability to flexibly respond to changes in multiple types of DPI spectrometers.
[0008] To achieve the above object, the present invention provides a DPI spectrometer detection method, which includes the following steps:
[0009] Aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain a target source image;
[0010] Performing a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result;
[0011] The target source image is detected for abnormality based on the similarity evaluation result to obtain a detection result.
[0012] Optionally, the step of aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain the target source image includes:
[0013] Comparing a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer with a second AprilTag code contained in a preset standard image to obtain a comparison result;
[0014] The target source image is aligned with the preset standard image according to the comparison result to obtain the target source image.
[0015] Optionally, the step of comparing the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer with the second AprilTag code contained in the preset standard image to obtain a comparison result includes:
[0016] Determining a distribution type of the AprilTag code based on a first AprilTag code contained in an initial source image corresponding to the target DPI spectrometer;
[0017] Selecting a second AprilTag code from a preset standard image according to the distribution type;
[0018] Comparing the first AprilTag code and the second AprilTag code according to preset corner points to obtain a corner point comparison result;
[0019] The step of aligning the target source image with the preset standard image according to the comparison result to obtain the target source image includes:
[0020] Calculating a homography matrix based on the feature point group included in the corner point comparison result;
[0021] The target source image is aligned with the preset standard image based on the homography matrix to obtain a target source image.
[0022] Optionally, before the step of performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result, the step further includes:
[0023] Segmenting the first key area in the target source image according to a preset segmentation ratio to obtain segmented sub-blocks;
[0024] Segment the target source image horizontally and vertically according to the boundary corner point information corresponding to the sub-segmentation blocks to obtain segmented sub-image blocks;
[0025] performing binarization processing on the target source image based on a threshold sequence corresponding to the sub-image block to obtain an initial mask;
[0026] The initial mask is subjected to denoising processing to obtain a cabinet door foreground occlusion mask in the first key area.
[0027] Optionally, the step of performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result includes:
[0028] performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image based on the cabinet door foreground occlusion mask and a preset similarity calculation formula to obtain a similarity evaluation result;
[0029] The preset similarity calculation formula includes:
[0030]
[0031]
[0032] in, refers to the target source image, T i,roi Refers to the second key area in the preset standard image; It refers to the cabinet door foreground occlusion mask, and P is the similarity comparison result of the key area.
[0033] Optionally, the step of detecting whether the target source image has an abnormality based on the similarity evaluation result and obtaining the detection result includes:
[0034] performing binarization processing on the device image block included in the similarity evaluation result based on the Otsu method to obtain a binarized image block;
[0035] Performing an opening operation on the binary image block to remove noise areas to obtain a denoised binary image block;
[0036] The target source image is detected based on the denoised binary image block to determine whether there is an abnormality, and a detection result is obtained.
[0037] Optionally, the step of detecting whether the target source image has an abnormality based on the denoised binary image block and obtaining a detection result includes:
[0038] Extracting a similarity map sub-region from the denoised binary image block;
[0039] The target source image is detected based on the similarity graph sub-region to determine whether there is an abnormality, and a detection result is obtained.
[0040] In addition, to achieve the above-mentioned purpose, the present invention also proposes a DPI spectrometer detection device, which includes a memory, a processor, and a DPI spectrometer detection program stored on the memory and runnable on the processor, and the DPI spectrometer detection program is configured to implement the steps of DPI spectrometer detection as described above.
[0041] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a DPI spectrometer detection program is stored. When the DPI spectrometer detection program is executed by a processor, the steps of the DPI spectrometer detection method described above are implemented.
[0042] In addition, to achieve the above-mentioned object, the present invention further proposes a DPI spectrometer detection device, the DPI spectrometer detection device comprising:
[0043] An image alignment module is configured to align the target source image with a preset standard image based on a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer to obtain a target source image;
[0044] A similarity evaluation module is used to perform similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result;
[0045] The anomaly detection module is used to detect whether there is an anomaly in the target source image according to the similarity evaluation result, and obtain a detection result.
[0046] The present invention obtains a target source image by aligning the target source image with a preset standard image based on a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer; performs a similarity evaluation on a first key area in the target source image and a second key area in the preset standard image to obtain a similarity evaluation result; and detects whether the target source image has an abnormality based on the similarity evaluation result to obtain a detection result. Compared with the existing DPI spectrometer detection solution, which has high inspection costs and is subject to scenario limitations and cannot flexibly respond to changes in multiple types of DPI spectrometers, the present invention can realize spectrometer change detection and early warning in the case of cabinet door occlusion, can effectively avoid manual missed inspections and reduce the labor cost of computer room inspections. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a structural diagram of a DPI spectrometer detection device in the hardware operating environment involved in an embodiment of the present invention;
[0048] Figure 2 This is a flow chart of a first embodiment of a DPI spectrometer detection method according to the present invention;
[0049] Figure 3 Schematic diagram of AprilTag code distribution in the first embodiment of the DPI spectrometer detection method of the present invention;
[0050] Figure 4 This is a schematic diagram of the key focus area positioning of the first embodiment of the DPI spectrometer detection method of the present invention;
[0051] Figure 5 This is a flow chart of DPI device passive optical splitter detection in an obstruction scenario in the first embodiment of the DPI optical splitter detection method of the present invention;
[0052] Figure 6 This is a block expansion diagram of the second embodiment of the DPI spectrometer detection method of the present invention;
[0053] Figure 7 This is a flow chart of a third embodiment of the DPI spectrometer detection method of the present invention;
[0054] Figure 8 This is a flowchart of the early warning determination of the third embodiment of the DPI spectrometer detection method of the present invention;
[0055] Figure 9 This is a structural block diagram of the first embodiment of the DPI spectrometer detection device of the present invention.
[0056] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0057] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0058] Reference Figure 1 , Figure 1 This is a structural diagram of a DPI spectrometer detection device in the hardware operating environment involved in an embodiment of the present invention.
[0059] like Figure 1 As shown, the DPI spectrometer detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), and optionally the user interface 1003 may also include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable memory (NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0060] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the DPI spectrometer detection device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0061] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a DPI spectrometer detection program.
[0062] exist Figure 1 In the DPI spectrometer detection device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the DPI spectrometer detection device calls the DPI spectrometer detection program stored in the memory 1005 through the processor 1001, and executes the DPI spectrometer detection method provided by the embodiment of the present invention.
[0063] Based on the above hardware structure, an embodiment of the DPI spectrometer detection method of the present invention is proposed.
[0064] Reference Figure 2 , Figure 2 1 is a flow chart of a first embodiment of a DPI spectrometer detection method according to the present invention, and provides a first embodiment of a DPI spectrometer detection method according to the present invention.
[0065] In this embodiment, the DPI spectrometer detection method includes the following steps:
[0066] Step S10: aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain a target source image.
[0067] It should be noted that the execution subject in this embodiment can be a device including a spectrometer anomaly detection system, and the spectrometer anomaly detection system includes a DPI spectrometer detection function, such as: a computer, a tablet, a mobile phone or a notebook, and can also be other devices that can achieve the same or similar functions. In this embodiment and the following embodiments, the DPI spectrometer detection method of the present invention is explained using a computer as an example.
[0068] It should be understood that the target DPI spectrometer may refer to the DPI spectrometer that needs to be security-tested in the computer room. The spectrometer may be a device built into a cabinet, where each device in the computer room has its own number. For the cabinet numbered i, there is a standard patch panel template image T that is pre-captured at the cabinet i shooting point. i (Preset standard image), where at time t during inspection: follow the inspection route to the preset shooting point of cabinet i and take an image of the cabinet (initial source image), and the preset standard image T i Or the source image taken during the previous inspection Compare and determine whether the current splitter status has changed, in order to ensure the security of the splitter of the DPI equipment in the computer room. In actual application, you can choose the template image T according to the application requirements. i Or the image captured during the previous inspection? For comparison, this scheme uses With T i The comparison is described as an example.
[0069] It is understandable that since there are errors between the inspection stop point and direction and the standard position of the shooting template image each time, it is difficult to ensure that the shooting position is completely consistent and the shooting angle is different, so the initial source image needs to be Align to the preset standard image T iExisting feature extraction methods like SIFT suffer from severe mismatching when used on cabinet images with a uniform overall grayscale distribution. Therefore, this solution proposes using the AprilTag code to obtain high-precision feature points to assist with alignment. The AprilTag code, similar to a fast-response matrix code, can be used for camera calibration, object size estimation, and monocular distance measurement.
[0070] Among them, the first AprilTag code is the AprilTag code physically marked on the cabinet corresponding to the DPI spectrometer captured, and the second AprilTag code is the AprilTag code at the standard position in the pre-stored template image. By aligning the first AprilTag code and the second AprilTag code, more accurate feature point alignment can be achieved.
[0071] In a specific implementation, the target source image is aligned with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain an aligned target source image.
[0072] Furthermore, step S10 also includes: comparing the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer with the second AprilTag code contained in the preset standard image to obtain a comparison result; aligning the target source image with the preset standard image according to the comparison result to obtain the target source image.
[0073] It should be noted that by comparing the first AprilTag code contained in the initial source image with the second AprilTag code contained in the preset standard image, it is determined based on the comparison result whether there is a positional difference between the initial source image and the preset standard image, so as to align the initial source image with the template image and obtain the aligned target source image.
[0074] Furthermore, according to the differences in the needs of the computer room, the distribution of the AprilTag code may have different planning situations, so it is necessary to determine the distribution type of the AprilTag code in the initial source image. The step of comparing the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer with the second AprilTag code contained in the preset standard image to obtain the comparison result includes: determining the distribution type of the AprilTag code based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer; selecting the second AprilTag code from the preset standard image according to the distribution type; and comparing the first AprilTag code and the second AprilTag code according to preset corner points to obtain corner point comparison results.
[0075] It should be noted that, to further illustrate the distribution of AprilTag codes, please refer to Figure 3 The AprilTag code distribution diagram shown in FIG. 1 is a diagram showing the AprilTag code distribution diagram. To ensure the alignment quality, adaptive processing is performed for different distribution situations. By determining the distribution type of the AprilTag code in the initial source image, a second AprilTag code is selected from the corresponding preset standard image. Then, the second AprilTag code and the first AprilTag code are compared according to preset corner points. Based on the corner point comparison results, it is determined whether the initial source image needs to be adjusted. For further explanation, refer to FIG. Figure 3 The three distribution situations shown include (a) a single code on a single side, (b) multiple codes on a single side, and (c) multiple codes on multiple sides. For the above three situations, the specific alignment steps may include:
[0076] Step A: Assume that k auxiliary AprilTag codes are attached to the cabinet door. First, identify and locate the AprilTag codes in the source image and template image: Identify the initial source image For the AprilTag code in the k-th recognized AprilTag code, its four corner points are recorded as Recognition template image T i For the AprilTag code in the k-th recognized AprilTag code, its four corner points are recorded as
[0077] Step B: Get the source image from step A and template image T i The AprilTag code of the kth group of recognition can generate four pairs of feature points A total of 4*k pairs of feature points can be generated. Solving the characteristic equation of the homography matrix requires at least 4 pairs of feature points. In order to more robustly adapt to different positioning code distributions, an adaptive solution is performed.
[0078] against Figure 3 In case (a), only a single positioning code is used to associate the cabinet. In this case, the available matching point pairs are limited, so Figure 3 In (a), [A, B, C, D] is used as the characteristic point group to solve the equation.
[0079] against Figure 3 In case (b), there are multiple positioning codes on one side of the cabinet door, which are associated with different equipment information in the cabinet. In this case, the intervals between AprilTag codes in different rows can be used to obtain a feature point group with a wider coverage range [A i ,D i ,B j ,C j ] or [B j ,Cj ,A k ,D k ].For example Figure 3 In (b), [A1, D1, B2, C2], [A2, D2, B3, C3], and [B1, C1, A3, D3] shown in the gray dashed boxes can be used as the characteristic point groups for solving the equation.
[0080] against Figure 3 In case (c), there are multiple pairs of positioning codes on both sides of the cabinet door, which are associated with different types of information of different devices in the cabinet. In this case, the intervals between the AprilTag codes can be used to obtain a feature point group with a wider coverage, and the detection error of a single AprilTag code can be averaged and weakened. First, the four corner points of the AprilTag code are used to obtain the feature point group with a wider coverage. Calculate its center of gravity F k , then the centroid combination of AprilTag code pairs of different devices [F i ,F i+1 ,F j ,F j+1 ] as the characteristic point group for solving the equation. For example: Figure 3 In (c), [F1, F2, F3, F4], [F3, F4, F5, F6], and [F1, F2, F5, F6] shown in the gray dotted box can be used as the feature point group for solving the equation, and the corner point comparison result is determined based on the feature point group obtained by the above calculation.
[0081] Furthermore, the step of aligning the target source image with the preset standard image according to the comparison result to obtain the target source image includes: calculating the homography matrix based on the feature point group contained in the corner point comparison result; and aligning the target source image with the preset standard image based on the homography matrix to obtain the target source image.
[0082] It should be noted that the feature point group obtained in the above steps is used as input, and the homography matrix H is calculated by the following formula. H is used to transform the source image Align to template image T i , remember the source image after alignment for
[0083] in and Represents the homogeneous coordinates of the feature points before and after the homography transformation.
[0084] In practice, because the grayscale of the cabinet door and the equipment inside are similar, and the foreground is composed of densely connected small holes, conventional methods like SIFT often produce low matching accuracy and a small number of feature point pairs. Therefore, this step focuses on optimizing the acquisition of high-quality feature point pairs. This allows for more accurate image alignment, ensuring subsequent similarity assessment based on the aligned target source image, and ultimately enabling safe detection of the spectrometer to avoid potential safety hazards.
[0085] Step S20: performing a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result.
[0086] It should be noted that the first key area of the target source image refers to the cabinet door area in the collected source image, and the cabinet door area includes the area image after the cabinet door and the spectrometer overlap. Since the spectrometer is built into the cabinet door, there will be occlusion, resulting in area overlap. The second key area in the preset standard image can refer to the area image after the cabinet door and the spectrometer overlap when the interface of the spectrometer is in a standard connection and the cabinet door of the spectrometer is in a standard state. Before performing the similarity evaluation, the first key area and the second key area need to be located, so each template image T needs to be located. i , it is necessary to extract the focus area T in the template image roi (Second key area), generally this area only selects the target equipment area inside the cabinet door, and can be adjusted according to needs in specific implementation. i and T i,roi Region range, target source image after positioning alignment is required In order to further illustrate the key focus area positioning process, we can combine Figure 4 The following is a schematic diagram of the key area of focus positioning, where the specific positioning process is as follows:
[0087] Among them, two examples of positioning methods for key areas of focus (key areas) are shown in Figure 4 , Figure 4 The outer rectangles in the middle represent the cabinet door, and the hexagonal grid area is the focus area. According to the distribution characteristics of the AprilTag code, two types of positioning methods can be selected. i,roi The width is w×h, and the AprilTag code is r×r.
[0088] Step 1: Figure 4 In the case of (1), the corresponding Figure 3 (a) Use the AprilTag code margin to locate the focus area. Assume that the distance between the upper left corner of the AprilTag code is T i,roiThe horizontal distance from the left side of the area is d, and the distance from the top of the cabinet door is z;
[0089] Identified in step S20 Can determine the side length of the AprilTag code in the image Then the horizontal coordinates of the left and right sides can be determined and Vertical coordinates of the upper and lower boundaries and
[0090] Step 2: Figure 4 In the case of (2), the corresponding Figure 3 (b) and (c) are scenarios where this type of positioning code is associated with devices in the cabinet. Assume that the upper edge of the AprilTag code corresponding to each device is collinear with the upper edge of the device U position, and the right side is at a distance of T i,roi The horizontal distance to the left of the region is d.
[0091] Similarly, the Can determine the side length of the AprilTag code in the image
[0092] Then determine the horizontal coordinates of the left and right sides and The vertical coordinates of the upper boundary can be determined by the first positioning code corner point The vertical coordinate of the lower boundary is determined by the lowest AprailTag code and the cabinet specifications Here, u and u0 correspond to the U-position height of the cabinet and the distance between the bottom U-position partition and the lower edge of the hexagonal mesh area, respectively.
[0093] Finally, from the aligned target source image The focus area in the initial source image S is obtained by cropping the upper left and lower right corner points (x0, y0) and (x1, y1) of the region (First key area).
[0094] It is understood that by comparing the first key region with the second key region, the similarity between the two is determined, and then whether the key region in the target source image is abnormal is determined based on the regional similarity. The similarity evaluation result includes the similarity between the first key region and the second key region and the similarity image.
[0095] Step S30: detecting whether the target source image has any abnormality according to the similarity evaluation result, and obtaining a detection result.
[0096] It should be noted that the similarity contained in the similarity evaluation result and the similarity image are used to detect whether there is an abnormality in the target source image, and a detection result is obtained. The detection result includes two situations: the presence of an abnormality and the absence of an abnormality. In the case of the presence of an abnormality, an early warning needs to be issued to effectively avoid safety problems.
[0097] In the specific implementation, to further illustrate the DPI device passive optical splitter detection process in the obstruction scene in this solution, you can refer to Figure 5 The passive optical splitter detection flow chart of the DPI device in the occlusion scene shown in FIG, wherein 101) patrol and collect source image S, 102) align the source image to the standard image, 103) locate the focus area T in the standard image S and T roi and S roi , 104) detect the cabinet door foreground occlusion mask M in S, 105) T roi and S roi Perform similarity evaluation and generate a detection graph P, 106) determine whether an early warning occurs based on the detection graph P.
[0098] This embodiment obtains a target source image by aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer; performs a similarity evaluation on a first key area in the target source image and a second key area in the preset standard image to obtain a similarity evaluation result; and detects whether there is an abnormality in the target source image based on the similarity evaluation result to obtain a detection result. Compared with the existing DPI spectrometer detection solution, which has high inspection costs and is subject to scenario limitations and cannot flexibly respond to changes in multiple types of DPI spectrometers, this embodiment can realize spectrometer change detection and early warning in the case of cabinet door obstruction, can effectively avoid manual missed inspections and reduce the labor cost of computer room inspections.
[0099] Based on the above Figure 2 The first embodiment shown provides a second embodiment of the DPI spectrometer detection method of the present invention.
[0100] In this embodiment, in order to avoid the influence of the cabinet door on the spectrometer detection, it is necessary to eliminate the influence of the foreground occlusion mask before the similarity evaluation. Before step S20, the method further includes: segmenting the first key area in the target source image according to a preset segmentation ratio to obtain segmented sub-segmentation blocks; segmenting the target source image horizontally and vertically according to the boundary corner point information corresponding to the sub-segmentation blocks to obtain segmented sub-image blocks; binarizing the target source image based on the threshold sequence corresponding to the sub-image blocks to obtain an initial mask; and denoising the initial mask to obtain a foreground occlusion mask of the cabinet door in the first key area.
[0101] It should be noted that in order to avoid the influence of cabinet door occlusion when judging the change of the spectrometer in similarity evaluation, it is necessary to locate the cabinet door foreground area in advance. This solution proposes a block threshold method to realize door panel mask positioning. For further explanation of this solution, please refer to Figure 6 The block expansion diagram shown is implemented as follows:
[0102] Step A: Segment the first key area in the target source image according to the preset segmentation ratio to obtain the segmented sub-blocks, that is, by determining the block ratios a and b in the width and height directions, the first key area is Corner point pt 01 ,pt 02 The upper, lower, left and right boundaries of the focus area are obtained and recorded as R up ,R bottom ,R right ,R left .
[0103] R up ,R bottom ] is the boundary to divide the height direction into b parts [R up ,…,R j ,…,R bottom ], with [R right ,R left ] is the boundary and the width direction is divided into a parts [R right ,…,R i ,…,R left ], and then get the first key area The boundary corner points of each sub-block.
[0104] Step B: Segment the target source image horizontally and vertically according to the boundary corner information corresponding to the sub-segmentation blocks to obtain the segmented sub-image blocks. The corner points of the sub-blocks are selected so that the sub-blocks cover the complete area of the source image, so that the information in the image can be more fully utilized. Figure 6 As shown in Figure (a), according to step A, The division of the inner sub-block is extended to Figure (b) The horizontal and vertical divisions are transformed into [0,…,R i ,…,W] and [0,…,R j ,…,H], we get The segmentation result.
[0105] Step C: Let the sub-image block list obtained in step B be {s j ,j=1,2,…,a×b}, for each sub-image block s j , use Otsu's method to obtain the segmentation threshold tj , get the threshold sequence Th={t j ,j=1,2,…,a×b}.
[0106] Step D: Use K-means algorithm to classify the Th threshold sequence, sort the number of samples in each category, and select the cluster center of the category with the largest number of samples as the final full-image threshold Th final .
[0107] Step E: Use threshold Th final Will Binarize to get the initial mask M init , for M init Perform opening operation to extract noise area N, M init Subtract the set from N to get the door foreground area mask Depend on pt 01 ,pt 02 Obtain a mask of the area of interest
[0108] In this embodiment, the step S20 further includes: performing a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image based on the cabinet door foreground occlusion mask and a preset similarity calculation formula to obtain a similarity evaluation result.
[0109] It should be noted that the source image has been obtained by the above steps Focus area mask Based on structural similarity and T i,roi Perform similarity evaluation. Since the cabinet door foreground does not belong to the target area, a binary foreground mask is used to further remove the influence of the cabinet door.
[0110] The preset similarity calculation formula includes:
[0111]
[0112]
[0113] in, refers to the target source image, T i,roi Refers to the second key area in the preset standard image; It refers to the cabinet door foreground occlusion mask, and P is the similarity comparison result of the key area.
[0114] This embodiment obtains a target source image by aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer; performs a similarity evaluation on a first key area in the target source image and a second key area in the preset standard image to obtain a similarity evaluation result; and detects whether there is an abnormality in the target source image based on the similarity evaluation result to obtain a detection result. Compared with the existing DPI spectrometer detection solution, which has high inspection costs and is subject to scenario limitations and cannot flexibly respond to changes in multiple types of DPI spectrometers, this embodiment can realize spectrometer change detection and early warning in the case of cabinet door obstruction, can effectively avoid manual missed inspections and reduce the labor cost of computer room inspections.
[0115] Reference Figure 7 , Figure 7 1 is a flow chart of the first embodiment of the DPI spectrometer detection method of the present invention, and a third embodiment of the DPI spectrometer detection method of the present invention is proposed.
[0116] In this embodiment, step S30 further includes:
[0117] Step S301: performing binarization processing on the device image block included in the similarity evaluation result based on the Otsu method to obtain a binarized image block.
[0118] It should be noted that for unmanned inspection scenarios, the similarity map P is needed to make early warning judgments to determine whether an early warning is necessary. If an early warning is issued, the computer room staff can use the detection map P displayed in the form of a heat map to assist in confirming the location of changes in the key focus area. The Otsu method (maximum inter-class variance method Otsu) refers to using a threshold to divide the data in the image into two categories. The grayscale of the pixels in the image in one category is less than this threshold, and the grayscale of the pixels in the image in the other category is greater than or equal to the threshold. If the variance of the grayscale of the pixels in the two categories is larger, it means that the obtained threshold is the optimal threshold (variance is a measure of the uniformity of grayscale distribution. The larger the inter-class variance between the background and foreground, the greater the difference between the two parts of the image. When part of the foreground is mistakenly classified as the background or part of the background is mistakenly classified as the foreground, the difference between the two parts will become smaller. Therefore, the segmentation that maximizes the inter-class variance means the smallest probability of misclassification.).
[0119] It can be understood that by using this threshold, the image can be divided into foreground and background. Compared to other existing algorithms, the Otsu method has the advantages of simple and fast computation and is unaffected by image brightness and contrast. To avoid sensitivity to image noise, this solution performs difference detection after denoising the image.
[0120] In a specific implementation, the device image blocks included in the similarity evaluation results are binarized using the Otsu method to obtain binary image blocks.
[0121] Step S302: performing an opening operation on the binary image block to remove the noise area, thereby obtaining a denoised binary image block.
[0122] It should be noted that, in order to further explain the anomaly detection process in this solution, you can refer to Figure 8 The warning determination flow chart shown in the figure is as follows: Step A: Pre-train the target detection network N pairs of source images Detect the optical splitter devices in the device list [Sp1,Sp2,…,Sp k ], respectively extract the rectangular sub-areas corresponding to the devices.
[0123] Step B: Binarize P using the Otsu method, and perform an opening operation on the binarized result of P to remove the noise area to obtain P′;
[0124] Step C: For each device corresponding to the image block Sp k , extract the corresponding similarity graph sub-region in P′
[0125] Step S303: detecting whether the target source image has any abnormality based on the denoised binary image block to obtain a detection result.
[0126] It should be noted that, the target source image is detected for abnormality based on the denoised binary image block P′ to obtain a detection result.
[0127] Furthermore, the step S303 further includes: extracting a similarity map sub-region from the denoised binary image block; and detecting whether the target source image has an abnormality based on the similarity map sub-region to obtain a detection result.
[0128] It should be noted that step C specifically includes: Step 1: Extraction The coordinates of the foreground points, that is, the points in the high-difference area, are obtained as a coordinate sequence X, and X is clustered to generate n clusters.
[0129] Step 2: Filter the clusters obtained by clustering, and the number of points in the cluster is less than the percentage threshold Th of the overall foreground point number cls The clusters are filtered out as noise clusters, and m clusters are obtained after screening. cls It can be adjusted in the range of [0.01, 0.05] according to application requirements.
[0130] Step 3: If the number of clusters m after screening is greater than 0, it is considered that the kth optical splitter device has changed and an early warning is issued; if m=0, no early warning is issued and the next device is detected.
[0131] This embodiment aligns the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain a target source image; performs similarity evaluation on a first key area in the target source image and a second key area in the preset standard image to obtain a similarity evaluation result; binarizes the device image block contained in the similarity evaluation result based on the Otsu method to obtain a binarized image block; performs an opening operation on the binarized image block to remove the noise area to obtain a denoised binarized image block; detects whether the target source image has an abnormality based on the denoised binarized image block to obtain a detection result. Compared with the existing DPI spectrometer detection solution, which has high inspection costs and is limited by scenarios and cannot flexibly respond to changes in multiple types of DPI spectrometers, this embodiment can realize spectrometer change detection and early warning when there is cabinet door obstruction, effectively avoid manual missed inspections, and reduce the labor cost of computer room inspections.
[0132] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a DPI spectrometer detection program is stored. When the DPI spectrometer detection program is executed by a processor, the steps of the DPI spectrometer detection method described above are implemented.
[0133] Reference Figure 9 , Figure 9 This is a structural block diagram of the first embodiment of the DPI spectrometer detection device of the present invention.
[0134] like Figure 9 As shown, the DPI spectrometer detection device proposed in the embodiment of the present invention includes:
[0135] An image alignment module 10 is configured to align a target source image with a preset standard image based on a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer to obtain a target source image;
[0136] A similarity evaluation module 20 is configured to perform a similarity evaluation on the first key region in the target source image and the second key region in the preset standard image to obtain a similarity evaluation result;
[0137] The anomaly detection module 30 is configured to detect whether the target source image has an anomaly based on the similarity evaluation result, and obtain a detection result.
[0138] This embodiment obtains a target source image by aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer; performs a similarity evaluation on a first key area in the target source image and a second key area in the preset standard image to obtain a similarity evaluation result; and detects whether there is an abnormality in the target source image based on the similarity evaluation result to obtain a detection result. Compared with the existing DPI spectrometer detection solution, which has high inspection costs and is subject to scenario limitations and cannot flexibly respond to changes in multiple types of DPI spectrometers, this embodiment can realize spectrometer change detection and early warning in the case of cabinet door obstruction, can effectively avoid manual missed inspections and reduce the labor cost of computer room inspections.
[0139] Furthermore, the image alignment module 10 is also used to compare the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer with the second AprilTag code contained in the preset standard image to obtain a comparison result; and align the target source image with the preset standard image according to the comparison result to obtain the target source image.
[0140] Furthermore, the image alignment module 10 is further configured to determine a distribution type of the AprilTag code based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer; select a second AprilTag code from a preset standard image according to the distribution type; and compare the first AprilTag code and the second AprilTag code according to preset corner points to obtain a corner point comparison result.
[0141] The image alignment module 10 is further configured to calculate a homography matrix based on the feature point group included in the corner point comparison result; and align the target source image with the preset standard image based on the homography matrix to obtain the target source image.
[0142] Furthermore, the anomaly detection module 30 is also used to segment the first key area in the target source image according to a preset segmentation ratio to obtain segmented sub-segmentation blocks; segment the target source image horizontally and vertically according to the boundary corner point information corresponding to the sub-segmentation blocks to obtain segmented sub-image blocks; binarize the target source image based on the threshold sequence corresponding to the sub-image blocks to obtain an initial mask; and denoise the initial mask to obtain a cabinet door foreground occlusion mask in the first key area.
[0143] Furthermore, the anomaly detection module 30 is further configured to perform a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image based on the cabinet door foreground occlusion mask and a preset similarity calculation formula to obtain a similarity evaluation result;
[0144] The preset similarity calculation formula includes:
[0145]
[0146]
[0147] in, refers to the target source image, T i,roi Refers to the second key area in the preset standard image; It refers to the cabinet door foreground occlusion mask, and P is the similarity comparison result of the key area.
[0148] Furthermore, the anomaly detection module 30 is also used to binarize the device image block contained in the similarity evaluation result based on the Otsu method to obtain a binarized image block; perform an opening operation on the binarized image block to remove the noise area to obtain a denoised binarized image block; and detect whether there is an anomaly in the target source image based on the denoised binarized image block to obtain a detection result.
[0149] Furthermore, the anomaly detection module 30 is further configured to extract a similarity map sub-region from the denoised binary image block; and detect whether the target source image has an anomaly based on the similarity map sub-region to obtain a detection result.
[0150] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any limitation on this.
[0151] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.
[0152] In addition, for technical details not fully described in this embodiment, reference can be made to the DPI spectrometer detection method provided in any embodiment of the present invention, and will not be repeated here.
[0153] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0154] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent superiority or inferiority of the embodiments. In a unit claim that enumerates several means, several of these means may be embodied by the same item of hardware. The use of the terms first, second, and third, etc., does not denote any order; these terms should be interpreted as designations.
[0155] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0156] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A DPI spectrometer detection method, characterized in that: The DPI spectrometer detection method comprises the following steps: Aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain a target source image; Performing a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result; Detecting whether the target source image has an abnormality based on the similarity evaluation result to obtain a detection result; Before the step of performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result, the method further includes: Segmenting the first key area in the target source image according to a preset segmentation ratio to obtain segmented sub-blocks; Segment the target source image horizontally and vertically according to the boundary corner point information corresponding to the sub-segmentation blocks to obtain segmented sub-image blocks; performing binarization processing on the target source image based on a threshold sequence corresponding to the sub-image block to obtain an initial mask; Performing denoising on the initial mask to obtain a cabinet door foreground occlusion mask in the first key area; The step of performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result includes: performing similarity evaluation on the first key area in the target source image and the second key area in the preset standard image based on the cabinet door foreground occlusion mask and a preset similarity calculation formula to obtain a similarity evaluation result; The preset similarity calculation formula includes: in, refers to the target source image, T i,roi Refers to the second key area in the preset standard image; It refers to the cabinet door foreground occlusion mask, and P is the similarity comparison result of the key area.
2. The DPI spectrometer detection method according to claim 1, wherein: The step of aligning the target source image with a preset standard image based on the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer to obtain the target source image includes: Comparing a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer with a second AprilTag code contained in a preset standard image to obtain a comparison result; The target source image is aligned with the preset standard image according to the comparison result to obtain the target source image.
3. The DPI spectrometer detection method according to claim 2, wherein: The step of comparing the first AprilTag code contained in the initial source image corresponding to the target DPI spectrometer with the second AprilTag code contained in the preset standard image to obtain a comparison result includes: Determining a distribution type of the AprilTag code based on a first AprilTag code contained in an initial source image corresponding to the target DPI spectrometer; Selecting a second AprilTag code from a preset standard image according to the distribution type; Comparing the first AprilTag code and the second AprilTag code according to preset corner points to obtain a corner point comparison result; The step of aligning the target source image with the preset standard image according to the comparison result to obtain the target source image includes: Calculating a homography matrix based on the feature point group included in the corner point comparison result; The target source image is aligned with the preset standard image based on the homography matrix to obtain a target source image.
4. The DPI spectrometer detection method according to any one of claims 1 to 3, wherein: The step of detecting whether the target source image has an abnormality based on the similarity evaluation result and obtaining the detection result includes: performing binarization processing on the device image block included in the similarity evaluation result based on the Otsu method to obtain a binarized image block; Performing an opening operation on the binary image block to remove noise areas to obtain a denoised binary image block; The target source image is detected based on the denoised binary image block to determine whether there is an abnormality, and a detection result is obtained.
5. The DPI spectrometer detection method according to claim 4, wherein: The step of detecting whether the target source image has an abnormality based on the denoised binary image block and obtaining a detection result includes: Extracting a similarity map sub-region from the denoised binary image block; The target source image is detected based on the similarity graph sub-region to determine whether there is an abnormality, and a detection result is obtained.
6. A DPI spectrometer detection device, characterized in that: The DPI spectrometer detection device includes: a memory, a processor, and a DPI spectrometer detection program stored in the memory and executable on the processor. When the DPI spectrometer detection program is executed by the processor, the DPI spectrometer detection method according to any one of claims 1 to 5 is implemented.
7. A storage medium, characterized in that: The storage medium stores a DPI spectrometer detection program, and when the DPI spectrometer detection program is executed by the processor, the DPI spectrometer detection method according to any one of claims 1 to 5 is implemented.
8. A DPI spectrometer detection device, characterized in that: The DPI spectrometer detection device comprises: An image alignment module is configured to align a target source image with a preset standard image based on a first AprilTag code contained in an initial source image corresponding to a target DPI spectrometer to obtain a target source image; A similarity evaluation module is used to perform similarity evaluation on the first key area in the target source image and the second key area in the preset standard image to obtain a similarity evaluation result; An anomaly detection module, configured to detect whether the target source image has an anomaly based on the similarity evaluation result, and obtain a detection result; The anomaly detection module is further configured to segment the first key area in the target source image according to a preset segmentation ratio to obtain segmented sub-segmentation blocks; segment the target source image horizontally and vertically based on boundary corner point information corresponding to the sub-segmentation blocks to obtain segmented sub-image blocks; binarize the target source image based on a threshold sequence corresponding to the sub-image blocks to obtain an initial mask; and denoise the initial mask to obtain a cabinet door foreground occlusion mask in the first key area. The anomaly detection module is further configured to perform a similarity evaluation on the first key area in the target source image and the second key area in the preset standard image based on the cabinet door foreground occlusion mask and a preset similarity calculation formula to obtain a similarity evaluation result; The preset similarity calculation formula includes: in, refers to the target source image, T i,roi Refers to the second key area in the preset standard image; It refers to the cabinet door foreground occlusion mask, and P is the similarity comparison result of the key area.
Citation Information
Patent Citations
Electrical equipment appearance abnormity detection method based on image comparison
CN104809732A
Target detection tracking method in shielding environment
CN110009665A
Flying fiber detection method for machine room inspection
CN114818964A