Method, device, computer equipment and storage medium for detecting jamming of rigid contact network positioning clamp
The method addresses the inefficiency of manual clamp jamming detection by using image processing techniques to automatically identify clamp jamming with high accuracy and speed, enhancing recognition efficiency in rail transit systems.
Patent Information
- Application Number
- CN202111352012.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-11-16
AI Technical Summary
Existing methods for detecting the jamming of rigid contact network positioning clamps in rail transit systems are labor-intensive and have low recognition efficiency, as they rely on manual identification of high-definition images.
A method involving image enhancement, edge segmentation, Hough transform detection, straight line screening and merging, and grayscale difference to automatically detect the angle between the positioning clamp and bus direction, using histogram equalization and canny operator for edge detection, followed by image rotation and cropping to determine clamp jamming.
Achieves fast recognition speed of milliseconds with an accuracy rate above 85%, enabling automatic and efficient detection of clamp jamming without prior knowledge, relying on image processing techniques.
Smart Images

Figure CN114219818B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent recognition of rail transit contact network images, and more specifically to a method, device, computer equipment and storage medium for detecting the jamming of a rigid contact network positioning wire clamp. Background Art
[0002] At present, in the construction and operation of rail transit in many cities across the country, overhead rigid contact networks are widely used to power trains. The rigid suspension contact network mainly consists of busbars, contact wires, insulating components and suspension devices, and the composite rigid suspension bus positioning clamp plays a vital role as the suspension device of the contact network. In actual operation, the positioning clamp has repeatedly experienced loosening, jamming, and falling off. Severe failures may even cause the contact wire to fall off and cause a pantograph-catenary accident.
[0003] On June 23, 2020, the State Intellectual Property Office disclosed a patent with publication number CN111325147A, entitled "A system and method for detecting detachment of positioning wire clamps based on image processing". In this invention patent, the positioning wire clamp image acquisition end acquires the image of the contact network positioning wire clamp and sends the positioning wire clamp image to the positioning wire clamp image processing end; the positioning wire clamp image processing end processes and analyzes the positioning wire clamp image to determine whether the positioning wire clamp has detached, and if so, an alarm is issued; and after superimposing the positioning wire clamp position information on the positioning wire clamp image, the positioning wire clamp image is saved.
[0004] The above-mentioned prior art can only detect the failure of the positioning wire clamp to fall off, but cannot detect whether the positioning wire clamp is stuck from the positioning wire clamp that has not fallen off. At present, the detection of the positioning wire clamp stuck failure is still limited to the stage of manually viewing the high-definition image of the positioning wire clamp in the later stage. The manual identification of the positioning wire clamp stuck failure in the overhead wire suspension component is labor-intensive and has low identification efficiency. Summary of the invention
[0005] In order to overcome the defects and deficiencies in the above-mentioned prior art, the present invention provides a method, device, computer equipment and storage medium for detecting the jam of a rigid contact network positioning clamp. The purpose of the present invention is to solve the above-mentioned problem of manual identification of the jam of the positioning clamp, which has a large workload and low recognition efficiency. The present invention sequentially performs image enhancement, image edge segmentation, Hough transform detection of straight lines, straight line screening and merging, and straight line grayscale difference on the positioning clamp image to be detected, obtains the bus direction straight line, cuts out the strip area image according to the bus direction straight line, rotates and crops the cut area image, obtains the final candidate strip image, binarizes and extracts the connected domain of the final candidate strip image, extracts the positioning clamp area, calculates the angle between the positioning clamp boundary and the bus direction, and determines whether the positioning clamp is stuck according to the angle calculation result. The present invention has fast recognition speed and high recognition accuracy. A single image can reach millisecond speed, and the recognition accuracy is above 85%, which can realize automatic recognition and detection of the entire process.
[0006] In order to solve the problems existing in the above-mentioned prior art, the present invention is achieved through the following technical solutions:
[0007] A first aspect of the present invention provides a method for detecting a rigid contact network positioning clamp being stuck, the method comprising the following steps:
[0008] S1, obtaining an image to be detected, wherein the image to be detected includes a positioning clamp and a bus bar;
[0009] S2, performing histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain a bus direction straight line;
[0010] S3, intercepting the candidate strip region image according to the bus direction straight line;
[0011] S4, rotating and cropping the candidate strip region image to obtain a final candidate strip image;
[0012] S5, performing binarization processing and connected domain extraction on the final candidate strip image, and extracting the positioning line clip area;
[0013] S6. Extract the positioning clamp boundary line according to the positioning clamp area, calculate the angle between the positioning clamp boundary line and the bus direction, and if the angle is greater than a set threshold, it means that the positioning clamp has a stuck fault.
[0014] In the step S2, the discrete form formula of histogram equalization is as follows:
[0015] Among them, T(r k ) is the grayscale r kImage equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
[0016] In step S2, the image edge segmentation specifically refers to first binarizing the image after histogram equalization processing, and then performing edge detection with a canny operator to obtain the image edge; the Hough transform line detection is a line detection based on the Hough transform of the image edge.
[0017] In step S2, after the straight lines in the image are obtained through Hough transform straight line detection, the straight lines are screened and merged. Specifically, the straight lines that do not conform to the conventional bus direction and are too short are eliminated, and then the straight lines with similar directions among the remaining straight lines are merged.
[0018] The straight line grayscale difference specifically refers to: calculating the difference value of the sum of the grayscales of the intervals on both sides of the merged straight line, and finally determining the edge straight line of the bus, thereby obtaining the bus direction straight line;
[0019] The formula for grayscale difference is as follows:
[0020] Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
[0021] In the step S4, the candidate strip region image is perspective transformed and rotated to make the busbar vertical. The perspective transformation formula is as follows:
[0022] Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates;
[0023] Represents image linear transformation;
[0024] T2=[a 13 a 23 ] T Used to generate image perspective transformation;
[0025] T3=[a 31 a 32 ] indicates image translation;
[0026] The rotated image is cropped according to pixel distribution to obtain the final candidate strip image.
[0027] After the candidate strip area is rotated to the vertical direction of the busbar, step S6 determines whether the positioning clamp is stuck according to the angle between the boundary line of the positioning clamp and the direction of the busbar and the slope direction.
[0028] A second aspect of the present invention provides a rigid contact network positioning clamp jam detection device, the device comprising:
[0029] An image acquisition module to be detected is used to acquire the image to be detected, wherein the acquired image to be detected includes the positioning wire clamp and the bus bar;
[0030] The bus direction straight line acquisition module is used to perform histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain the bus direction straight line;
[0031] A candidate strip region image acquisition module, which cuts out a candidate strip region image according to the bus direction straight line obtained in the bus direction straight line acquisition module;
[0032] A final candidate strip image acquisition module is used to rotate and crop the candidate strip area image to obtain a final candidate strip image;
[0033] A positioning clip region acquisition module is used to perform binarization processing and connected domain extraction on the final candidate strip image to extract the positioning clip region;
[0034] The positioning wire clamp stuck fault judgment module extracts the positioning wire clamp boundary line according to the positioning wire clamp area, and calculates the angle between the positioning wire clamp boundary line and the bus direction. If the angle is greater than the set threshold, it means that the positioning wire clamp has a stuck fault.
[0035] In the bus direction straight line acquisition module, the discrete form formula of the histogram equalization is as follows:
[0036] Among them, T(r k ) is the grayscale r k Image equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
[0037] In the bus direction straight line acquisition module, the image edge segmentation specifically refers to first binarizing the image after histogram equalization processing, and then performing edge detection with the canny operator to obtain the image edge; the Hough transform straight line detection is a straight line detection based on the Hough transform of the image edge.
[0038] In the bus direction straight line acquisition module, after the straight lines in the image are obtained through Hough transform straight line detection, the straight lines are screened and merged. Specifically, the straight lines that do not conform to the conventional bus direction and are too short are eliminated, and then the straight lines with similar directions in the remaining straight lines are merged; the straight line grayscale difference specifically refers to: calculating the difference value of the sum of the grayscale intervals on both sides of the merged straight line, and finally determining the edge straight line of the bus, thereby obtaining the bus direction straight line.
[0039] The formula for grayscale difference is as follows:
[0040] Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
[0041] In the final candidate strip image acquisition module, the candidate strip area image is perspective transformed and rotated to a vertical direction of the bus. The perspective transformation formula is as follows:
[0042] Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates;
[0043] Represents image linear transformation;
[0044] T2=[a 13 a 23 ] T Used to generate image perspective transformation;
[0045] T3=[a 31 a 32 ] indicates image translation;
[0046] The rotated image is cropped according to pixel distribution to obtain the final candidate strip image.
[0047] After the candidate strip area is rotated to the vertical direction of the bus, the positioning clamp jam fault judgment module determines whether the positioning clamp is jammed according to the angle between the positioning clamp boundary line and the bus direction and the slope direction.
[0048] The third aspect of the present invention provides a computer device, comprising a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute some or all of the steps described in the first aspect of the present invention.
[0049] The fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the present invention.
[0050] Compared with the prior art, the beneficial technical effects brought by the present invention are as follows:
[0051] 1. The advantages of the present invention are fast recognition speed, and a single picture can reach a speed of milliseconds. At the same time, the recognition accuracy is high, and the recognition accuracy rate in the existing data is above 85%. At the same time, this scheme does not rely on any prior knowledge, and is a completely unsupervised detection method with strong practicality. As long as the input image is shot at a fixed angle, the full process of automatic recognition can be achieved.
[0052] 2. The positioning principle of the positioning wire clamp area of the present invention is: based on Hough transform straight line detection, the direction of the bus is determined, and then the grayscale of the bus and the positioning wire clamp is calculated through image operation, so as to determine the position of the positioning wire clamp area. The present invention can quickly locate the positioning wire clamp based on the direction characteristics of the bus and the grayscale characteristics of the bus and the positioning wire clamp. Compared with the prior art, the positioning wire clamp recognition efficiency is higher and the recognition accuracy is higher.
[0053] 3. The present invention determines the positioning clamp jamming fault according to the angle between the edge of the positioning clamp and the bus bar, with less calculation amount, high fault identification efficiency and high fault identification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a flow chart of a method for detecting a stuck rigid contact network positioning clamp according to the present invention;
[0055] Figure 2 To locate the image of the wire clamp to be detected;
[0056] Figure 3 It is a partial image of the normal state of the positioning wire clamp;
[0057] Figure 4 A local image showing a stuck fault state of the positioning wire clamp;
[0058] Figure 5The processed image of the positioning wire clamp to be detected after Hough transform straight line detection;
[0059] Figure 6 is the candidate strip region image;
[0060] Figure 7 is the final candidate strip image;
[0061] Figure 8 To locate the wire clamp area image;
[0062] Fig. 9 An image of the target area for positioning the wire clip. DETAILED DESCRIPTION
[0063] The technical solution of the present invention is further described in detail below in conjunction with specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] Example 1
[0065] As a preferred embodiment of the present invention, this embodiment discloses: a method for detecting the jamming of a rigid contact network positioning clamp, the method comprising the following steps:
[0066] S1, obtaining an image to be detected, wherein the image to be detected includes a positioning clamp and a bus bar;
[0067] S2, performing histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain a bus direction straight line;
[0068] S3, intercepting the candidate strip region image according to the bus direction straight line;
[0069] S4, rotating and cropping the candidate strip region image to obtain a final candidate strip image;
[0070] S5, performing binarization processing and connected domain extraction on the final candidate strip image, and extracting the positioning line clip area;
[0071] S6. Extract the positioning clamp boundary line according to the positioning clamp area, calculate the angle between the positioning clamp boundary line and the bus direction, and if the angle is greater than a set threshold, it means that the positioning clamp has a stuck fault.
[0072] As an implementation of this embodiment, in the step S2, the discrete form formula of the histogram equalization is as follows:
[0073] Among them, T(r k ) is the grayscale r k Image equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
[0074] As another implementation of this embodiment, in step S2, image edge segmentation specifically refers to first binarizing the image after histogram equalization processing, and then performing edge detection with a canny operator to obtain the image edge; the Hough transform straight line detection is a straight line detection based on the Hough transform of the image edge.
[0075] As another implementation of this embodiment, in step S2, after the straight lines in the image are obtained by Hough transform straight line detection, the straight lines are screened and merged. Specifically, the straight lines that do not conform to the conventional bus direction and are too short are eliminated, and then the straight lines with similar directions among the remaining straight lines are merged; the straight line grayscale difference specifically refers to: calculating the difference value of the sum of the grayscale intervals on both sides of the merged straight line, and finally determining the edge straight line of the bus, thereby obtaining the bus direction straight line.
[0076] Furthermore, the formula for grayscale difference is as follows:
[0077] Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
[0078] As another implementation of this embodiment, in the step S4, the candidate strip region image is perspective transformed and rotated to a vertical direction of the bus; the perspective transformation formula is as follows:
[0079] Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates;
[0080] Represents image linear transformation;
[0081] T2=[a 13 a 23 ] T Used to generate image perspective transformation;
[0082] T3=[a 31 a 32] indicates image translation;
[0083] The rotated image is cropped according to pixel distribution to obtain the final candidate strip image. After the candidate strip area is rotated to the vertical direction of the bus, step S6 determines whether the positioning clamp is stuck according to the angle between the positioning clamp boundary line and the bus direction and the slope direction.
[0084] As another implementation of this embodiment, S5 specifically includes binarizing the final candidate strip image, performing opening and closing operations on the binarized image, and extracting the maximum connected domain that meets the conditions, which is the position of the positioning wire clip.
[0085] Example 2
[0086] As another preferred embodiment of the present invention, refer to the attached specification Figure 1 -Attached Figure 8 As shown, this embodiment discloses: a method for detecting the jamming of a rigid contact network positioning clamp, the specific process is as follows Figure 1 shown.
[0087] like Figure 2 As shown, Figure 2 To locate the original image data of the wire clip, Figure 2 The black disc-shaped object in the upper middle is the insulator, the brighter middle part and the part across the image diagonally is the busbar (the part connecting with the insulator), and the darker square object is the positioning clamp. The implementation of this embodiment can be divided into two parts: positioning clamp area recognition and positioning clamp feature extraction and recognition.
[0088] The principle of locating the locating wire clamp area is: based on the Hough transform to detect the straight line, determine the direction of the bus, and then calculate the grayscale of the track bus and the locating wire clamp through image calculation, so as to determine the position of the locating wire clamp area.
[0089] The feature extraction of the positioning clamp is based on the following principle: when the positioning clamp is normal, its direction is basically parallel to the direction of the busbar, such as Figure 3 As shown; when a jamming fault occurs, the positioning clamp will deviate from the original direction, and its edge will have a certain angle with the direction of the bus, as shown Figure 4 shown.
[0090] According to the above technical ideas, the specific implementation steps of the positioning wire clamp jam fault determination in this embodiment are as follows: Figure 1 The details are as follows:
[0091] The data used in this embodiment are all real-life photos of subway inspection tasks. Due to the complex on-site environments and large differences in conditions, the illumination intensity and image contrast of each image are very different, so image enhancement must be performed first. Local histogram equalization is used here. The discrete form formula of histogram equalization is as follows:
[0092] Among them, T(r k ) is the grayscale r k Image equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
[0093] Secondly, we need to obtain the direction of the bus in the image. By detecting the straight lines in the image, we can filter out the straight lines at the edge of the bus and get their direction. Line detection is achieved through Hough transform. The image must be binarized first, and then edge detection based on the canny operator can be performed. Only then can Hough transform line detection be performed based on the image edge. Figure 5 shown.
[0094] In getting Figure 5 After the straight line is found, the straight lines need to be screened and merged, and the straight lines that do not conform to the conventional bus direction and are too short are eliminated. Then the straight lines with similar directions among the remaining straight lines are merged. There will be a large difference in grayscale values on both sides of the bus. Based on this, the difference value of the sum of the grayscale intervals on both sides of the straight line is calculated to finally determine the edge straight line of the target bus. The formula for grayscale difference is as follows:
[0095] Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
[0096] After obtaining the busbar direction, in order to extract the positioning clamp area, the image must be cropped and rotated first. The 100-pixel area below the straight line is intercepted as the candidate area for extraction, such as Figure 6 As shown, the candidate strip region image is perspective transformed and rotated until the bus is in the vertical direction; the perspective transformation formula is as follows:
[0097] Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates;
[0098] Represents image linear transformation;
[0099] T2=[a 13 a 23 ] T Used to generate image perspective transformation;
[0100] T3=[a 31 a 32 ] indicates image translation.
[0101] Since black areas will appear in the image after rotation, the image needs to be cropped according to the pixel distribution to obtain the final candidate strip image, such as Figure 7 shown.
[0102] The extraction of the positioning clip area is based on the grayscale distribution characteristics of the image. The grayscale value of the clip area is darker than that of the surrounding background area, and the image is cropped based on this. First, the image is binarized. In order to remove the noise in the image and make the image more visible, the image is opened and closed. Then the largest connected domain that meets the conditions is extracted, which is the location of the positioning clip, such as Figure 8 Then, the image is cropped based on the upper and lower boundaries of the connected domain to obtain the target area for positioning the wire clip, as shown in Fig. 9 shown.
[0103] Fault identification is based on the angle between the boundary of the positioning clamp and the direction of the bus (i.e., the y-axis direction in the figure). Because the acquisition posture and angle of the fixed camera are fixed, the approximate distribution direction of the positioning clamp and the bus in the acquired image is determined. After the above-mentioned image rotation operation, an empirical angle value between the positioning clamp and the bus can be obtained. For example, for the positioning clamp image taken on the left, the normal angle between the positioning clamp and the bus will not be greater than 10 degrees, and the slope of its deviation direction is positive or close to negative infinity (such as Figure 3 The image is rotated to the vertical direction of the busbar). When the insulator is stuck, the angle will be larger, and the slope will be negative and generally not less than -10 (such as Figure 4 The image of the positioning clamp taken on the right shows the opposite conclusion: the angle between the normal positioning clamp and the busbar will not be greater than 10 degrees, and the slope of the deviation direction is negative. When the insulator is stuck, the angle will be larger and the slope will be positive. The boundary line extraction of the positioning clamp is also based on the Hough transform, and then the boundary line is finally determined according to its slope and distribution position. Finally, the angle is calculated to determine when the fault occurs.
[0104] Example 3
[0105] As another preferred embodiment of the present invention, this embodiment discloses a rigid contact network positioning wire clamp jam detection device, the device comprising:
[0106] An image acquisition module to be detected is used to acquire the image to be detected, wherein the acquired image to be detected includes the positioning wire clamp and the bus bar;
[0107] The bus direction straight line acquisition module is used to perform histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain the bus direction straight line;
[0108] A candidate strip region image acquisition module, which cuts out a candidate strip region image according to the bus direction straight line obtained in the bus direction straight line acquisition module;
[0109] A final candidate strip image acquisition module is used to rotate and crop the candidate strip area image to obtain a final candidate strip image;
[0110] A positioning clip region acquisition module is used to perform binarization processing and connected domain extraction on the final candidate strip image to extract the positioning clip region;
[0111] The positioning wire clamp stuck fault judgment module extracts the positioning wire clamp boundary line according to the positioning wire clamp area, and calculates the angle between the positioning wire clamp boundary line and the bus direction. If the angle is greater than the set threshold, it means that the positioning wire clamp has a stuck fault.
[0112] As an implementation of this embodiment, in the bus direction straight line acquisition module, the discrete form formula of the histogram equalization is as follows:
[0113] Among them, T(r k ) is the grayscale r k Image equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
[0114] As another implementation of this embodiment, in the bus direction straight line acquisition module, the image edge segmentation specifically refers to first binarizing the image after histogram equalization processing, and then performing edge detection with a canny operator to obtain the image edge; the Hough transform straight line detection is a straight line detection based on the Hough transform of the image edge.
[0115] As another implementation of the present embodiment, in the bus direction straight line acquisition module, after the straight lines in the image are obtained by Hough transform straight line detection, the straight lines are screened and merged. Specifically, the straight lines that do not conform to the conventional bus direction and are too short are eliminated, and then the straight lines with similar directions among the remaining straight lines are merged; the straight line grayscale difference specifically refers to: calculating the difference value of the sum of the grayscale intervals on both sides of the merged straight line, and finally determining the edge straight line of the bus, thereby obtaining the bus direction straight line.
[0116] Furthermore, the formula for grayscale difference is as follows:
[0117] Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
[0118] As another implementation of this embodiment, in the final candidate strip image acquisition module, the candidate strip area image is perspective transformed and rotated to a vertical direction of the bus; the perspective transformation formula is as follows:
[0119] Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates;
[0120] Represents image linear transformation;
[0121] T2=[a 13 a 23 ] T Used to generate image perspective transformation;
[0122] T3=[a 31 a 32 ] indicates image translation;
[0123] The rotated image is cropped according to the pixel distribution to obtain the final candidate strip image. After the candidate strip area is rotated to the vertical direction of the bus, the positioning clamp jam fault judgment module determines whether the positioning clamp is jammed according to the angle between the positioning clamp boundary line and the bus direction and the slope direction.
[0124] As another implementation of this embodiment, in the positioning clip area acquisition module, the final candidate strip image is binarized, and the binarized image is opened and closed to extract the largest connected domain that meets the conditions, which is the position of the positioning clip.
[0125] Example 4
[0126] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the above-mentioned rigid contact network positioning clamp jam detection method are implemented.
[0127] In this embodiment, the processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0128] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and units, such as the corresponding program units in the above method embodiments of the present invention. The processor executes various functional applications of the processor and works data processing by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiments.
[0129] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] The one or more units are stored in the memory, and when executed by the processor, the method in the above-mentioned embodiment 1 is executed.
[0131] Example 5
[0132] As another preferred embodiment of the present invention, this embodiment discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned embodiment 1 are implemented.
Claims
1. A method for detecting the jamming of a rigid contact network positioning clamp, characterized in that: The method comprises the following steps: S1, obtaining an image to be detected, wherein the image to be detected includes a positioning clamp and a bus bar; S2, performing histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain a bus direction straight line; S3, intercepting the candidate strip region image according to the bus direction straight line; S4, rotating and cropping the candidate strip region image to obtain a final candidate strip image; S5, performing binarization processing and connected domain extraction on the final candidate strip image, and extracting the positioning line clip area; S6. Extract the positioning clamp boundary line according to the positioning clamp area, calculate the angle between the positioning clamp boundary line and the bus direction, and if the angle is greater than a set threshold, it means that the positioning clamp has a stuck fault.
2. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 1, characterized in that: In the step S2, the discrete form formula of histogram equalization is as follows: Among them, T(r k ) is the grayscale r k Image equalization transformation, MN is the total number of image pixels, L is the number of gray levels of the image, n j The grayscale is r k The number of pixels.
3. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 1, characterized in that: In step S2, the image edge segmentation specifically refers to first binarizing the image after histogram equalization processing, and then performing edge detection with a canny operator to obtain the image edge; the Hough transform line detection is a line detection based on the Hough transform of the image edge.
4. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 1, 2 or 3, characterized in that: In step S2, after the straight lines in the image are obtained through Hough transform straight line detection, the straight lines are screened and merged. Specifically, the straight lines that do not conform to the conventional bus direction and are too short are eliminated, and then the straight lines with similar directions among the remaining straight lines are merged.
5. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 1, 2 or 3, characterized in that: The straight line grayscale difference specifically refers to: calculating the difference value of the sum of the grayscale intervals on both sides of the merged straight line, and finally determining the edge straight line of the bus, thereby obtaining the bus direction straight line; The formula for grayscale difference is as follows: Among them, G DIFF (x,y) is the grayscale difference value at (x,y) in the image, N is the calculation interval, g(x,y) is the grayscale value of the pixel (x,y), j is the number of the summation item in the calculation interval, and abs is the absolute value function.
6. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 1, 2 or 3, characterized in that: In the step S4, the candidate strip region image is perspective transformed and rotated to make the busbar vertical. The perspective transformation formula is as follows: Where (u, v) is the original image pixel coordinate, w is the z-axis coordinate of the image, the image is a two-dimensional image, w = 1, and the transformed image coordinates need to be divided by w`, that is, (x = x` / w`, y = y` / w`) is the transformed image pixel coordinates; Represents image linear transformation; T2=[a 13 a 23 ] T Used to generate image perspective transformation; T3=[a 31 a 32 ] indicates image translation; The rotated image is cropped according to pixel distribution to obtain the final candidate strip image.
7. The method for detecting the jamming of the rigid contact network positioning clamp according to claim 6, characterized in that: After the candidate strip area is rotated to the vertical direction of the busbar, step S6 determines whether the positioning clamp is stuck according to the angle between the boundary line of the positioning clamp and the direction of the busbar and the slope direction.
8. A rigid contact network positioning clamp jam detection device, characterized in that: The device includes: An image acquisition module to be detected is used to acquire the image to be detected, wherein the acquired image to be detected includes the positioning wire clamp and the bus bar; The bus direction straight line acquisition module is used to perform histogram equalization, image edge segmentation, Hough transform straight line detection, straight line screening and merging, and straight line grayscale difference on the image to be detected in sequence to obtain the bus direction straight line; A candidate strip region image acquisition module, which cuts out a candidate strip region image according to the bus direction straight line obtained in the bus direction straight line acquisition module; A final candidate strip image acquisition module is used to rotate and crop the candidate strip area image to obtain a final candidate strip image; A positioning clip region acquisition module is used to perform binarization processing and connected domain extraction on the final candidate strip image to extract the positioning clip region; The positioning clamp stuck fault judgment module extracts the positioning clamp boundary straight line according to the positioning clamp area, and calculates the angle between the positioning clamp boundary straight line and the bus direction. If the angle is greater than the set threshold, it means that the positioning clamp has a stuck fault.
9. A computer device, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
