Image processing-based line box orientation adjustment method

By using an image processing-based method, the Canny algorithm and supplementary lighting components are used to detect the edge contour of the wire box, generate a standard comparison image, and calculate the offset angle. This solves the problem of low efficiency in wire box orientation recognition, realizes efficient automatic adjustment of wire box orientation, and improves production efficiency.

CN120318265BActive Publication Date: 2025-12-16SHANDONG FENGHANG PLASTIC IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510389356.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-12-16
Estimated Expiration
2045-03-31

AI Technical Summary

Technical Problem

In existing technologies, image processing techniques have poor cross-domain adaptation in the process of box orientation recognition, and deep recognition algorithms are computationally complex, resulting in low recognition efficiency.

Method used

An image processing-based approach is adopted, using the Canny algorithm to detect edge contours, generate a standard comparison image, calculate the offset angle and rotate the image under test, and combine a supplementary lighting component and preprocessing technology to achieve automatic adjustment of the wire box orientation.

Benefits of technology

It improves the accuracy and efficiency of wire box orientation recognition, simplifies the recognition process, ensures accurate positioning and adjustment of subsequent mechanical equipment, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318265B_ABST
    Figure CN120318265B_ABST
Patent Text Reader

Abstract

The application provides a kind of line box direction adjusting method based on image processing, it is related to image processing technical field, it is by establishing standard control image under different parameters, and the standard control image is carried out reverse color processing;Afterwards, the collected gray scale image is first determined vertex and offset angle, and the picture is corrected using offset angle;Using the corrected image and standard control image are compared, if comparison is successful, then the line box is adjusted according to the aforementioned picture adjustment angle;If comparison fails, then on the basis of the aforementioned picture adjustment, it is rotated 90° clockwise for secondary verification, if still comparison fails, then it is marked, and artificial processing is carried out, the reason of identifying problem is recorded and log is recorded;Through picture adjustment comparison method, the position of line box can be verified before mechanical equipment adjusts the position, to improve the accuracy of subsequent mechanical equipment adjustment position;Convenient for subsequent production step processing, improve production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method for adjusting the orientation of a wire box based on image processing. Background Technology

[0002] A junction box (also known as a recessed box, base box, or switch and socket box) is a plastic or metal enclosure used in household circuit installation to secure electrical equipment such as switches and sockets. It is typically embedded inside the wall (recessed installation) or installed on the wall surface (surface installation), and is an important auxiliary material for electrical wiring.

[0003] Common junction box models include type 86, type 120, type 146, explosion-proof junction boxes, etc.; such as Figure 1 As shown, taking the common 86-type concealed junction box as an example, its structure mainly includes the following parts: Outer shell: a square or rectangular plastic shell, approximately 1.2-1.5mm thick, hollow inside. The material is mostly flame-retardant PC or ABS, and some metal junction boxes use galvanized steel plates.

[0004] Fixing lugs: Flanges located on both sides of the junction box, fixed to the wall using expansion screws or plaster. Some junction boxes are designed with adjustable depth (such as telescopic fixing lugs) to adapt to different wall thicknesses.

[0005] Wiring hole: A round hole (approximately 20mm in diameter) is pre-drilled on the bottom or side of the box for the power supply cable to pass through. Some junction boxes have a removable baffle for easy sealing after the hole is made.

[0006] Screw holes: Symmetrically distributed threaded holes (approximately 60mm spacing) at the top and bottom for securing switch and socket panels. Some high-end junction boxes feature built-in copper nuts to enhance screw engagement strength.

[0007] Reinforcing ribs: The box is designed with crisscrossing reinforcing ribs inside to prevent deformation under pressure.

[0008] Moisture-proof structure: sealing ring or waterproof cover, suitable for damp environments such as bathrooms and balconies.

[0009] For the line box of plastic structure, after the molding of the injection molding equipment, the screw hole gasket needs to be installed in the slot of the line box in a secondary step; in the traditional processing mode, manual installation is usually adopted; with the progress of science and technology, the production is gradually changed from manual to automatic, so after the molding of the injection molding equipment, the molded line box needs to be sent to the subsequent processing equipment at a relatively fixed angle; therefore, the line box sent to the transmission line needs to be directionally recognized and adjusted to meet the processing needs; image processing refers to a technology of analyzing, enhancing, restoring or feature extraction of digital images through computer algorithms, which is widely applied in the process of industrial production; the traditional image processing technology depends on scene adaptation and has poor cross-field effect, and the image processing technology based on deep recognition algorithm has the problems of large model parameter quantity and complex calculation.

[0010] Therefore, how to combine the image processing technology with the line box direction recognition technology to simplify the recognition process and improve the recognition efficiency becomes a technical problem to be solved. SUMMARY

[0011] In order to solve the above technical problems, the present application is proposed. The present application provides a line box direction adjusting method based on image processing.

[0012] In a first aspect, the present application provides a line box direction adjusting method based on image processing, comprising the following specific steps:

[0013] S1: using a line box standard part to be placed in the alignment position of the recognition area, collecting image data under different light supplementing conditions, and pre-processing;

[0014] S2: performing edge contour detection based on the Canny algorithm, and performing reverse color processing on the detected edge contour to generate standard contrast images under different light supplementing conditions;

[0015] S3: collecting line box test image data using the steps of S1 and S2, pre-processing and edge contour detection;

[0016] S4: processing based on the extracted edge contour to determine four vertices;

[0017] S5: taking the lower left corner vertex as the coordinate origin, calculating the vector between the diagonal vertex and the origin, and calculating the offset angle;

[0018] S6: rotating the test image according to the offset angle, and matching the corresponding standard contrast image according to the original light supplementing information of the collected image;

[0019] S7: comparing the rotated test image with the standard contrast image, detecting whether there is a large area of image reverse color area, and adjusting the angle of the line box according to the detection result.

[0020] Further, in step S1, the image acquisition module and the light supplement assembly are installed at a specified position of the transmission line, and the line box moving on the transmission line is vertically photographed to acquire images.

[0021] Further, in step S1, data of the light supplement assembly are acquired while the images are acquired, and the data specifically include color temperature, color rendering index, lumens, and brightness.

[0022] Further, the preprocessing step in step S1 includes graying and noise removal.

[0023] Further, in step S2, the image after graying is inverted to green; and different data sets are set for different light supplement conditions to save standard control images corresponding to the light supplement conditions.

[0024] Further, in step S4, the shape of the contour is determined by using a polygon approximation method, the coordinates of four vertices are calculated, and the vertices are arranged in ascending order of polar angle according to the centroid method.

[0025] Further, in step S5, the vertex with the smallest sum of horizontal and vertical coordinates is taken as the origin, the vertex with the largest sum of horizontal and vertical coordinates is taken as the diagonal vertex, the vector between the diagonal vertex and the origin is calculated, and the offset angle is calculated.

[0026] Further, in step S6, the left lower corner vertex is taken as the rotation center point, and the measured image is rotated according to the offset angle.

[0027] Further, in step S7, a determination threshold is set, if the determination is lower than the threshold, the line box is adjusted according to the angle of image adjustment.

[0028] If there is an area with more than 2% of the pixel area inverting color, it is considered that the threshold is exceeded, and secondary rotation is needed; the image is rotated clockwise by 90° with the centroid point of the edge contour as the center point, and secondary verification is performed; if the threshold is met, the line box is adjusted according to the angle of the two image adjustments; if the threshold is still not met, marking is performed for manual processing.

[0029] The second aspect of the application provides a line box direction adjustment system based on image processing, which uses the above method for detection, and includes an image acquisition module, a light supplement assembly, a preprocessing module, a calculation module, a data labeling module, an angle adjustment module, and an interactive display module.

[0030] The image acquisition module is vertically installed above the identification area of the transmission line, and is used to acquire image data of the line box.

[0031] The light supplement assembly is installed on one side of the image acquisition module, and is used to provide a supplementary light source in cooperation with the image acquisition module to reduce the influence of environmental light when the image data is acquired.

[0032] The preprocessing module is used for performing a preprocessing step on the collected image to eliminate noise and improve contrast;

[0033] The calculation module is used for determining the contour and four vertices of the image, and adjusting and comparing the image according to the offset angle;

[0034] The data labeling module is used for labeling the line box that still fails to pass the verification after being rotated twice, and converting it to manual processing;

[0035] The angle adjustment module is used for adjusting the angle of the line box on the transmission line according to the technical angle output by the calculation module in steps;

[0036] The interactive display module is used for displaying the running state of the system and providing an interactive control interface; the user manually changes the standard contrast image and manually performs verification through the interactive control interface.

[0037] The third aspect of the application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the image processing-based line box direction adjustment method described above when executing the computer program.

[0038] The fourth aspect of the application provides a computer readable medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the image processing-based line box direction adjustment method described above.

[0039] Compared with the prior art, the image processing-based line box direction adjustment method provided by the application establishes a standard contrast image under different parameters and performs inverse color processing on the standard contrast image; then the collected gray-scale image is used to determine the vertices and offset angle, and the offset angle is used to correct the image; the corrected image is compared with the standard contrast image, if the comparison is successful, the line box is adjusted according to the aforementioned picture adjustment angle; if the comparison fails, the line box is rotated clockwise by 90° for secondary verification based on the aforementioned picture adjustment, if the comparison still fails, the line box is labeled and converted to manual processing, the causes of the problem are identified and logs are recorded; through the picture adjustment comparison method, the line box pose can be verified before the mechanical equipment adjusts the line box pose, so as to improve the accuracy of the subsequent mechanical equipment adjustment pose; the subsequent production steps are facilitated, and the production efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort. In the drawings:

[0041] Figure 1 It is a top view structural schematic diagram of the 86 type concealed wire box in the prior art.

[0042] Figure 2 It is a flow chart of the image processing based wire box direction adjusting method according to the embodiments of the present application.

[0043] Figure 3 It is a system structure block diagram of the image processing based wire box direction adjusting system according to the embodiments of the present application.

[0044] Figure 4 It shows the structural schematic diagram of the computer system of the electronic device suitable for realizing the embodiments of the present application. DETAILED DESCRIPTION

[0045] In the following, the example embodiments according to the present application will be described in detail with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described here.

[0046] Embodiment 1

[0047] As shown in the flow chart of the image processing based wire box direction adjusting method according to the embodiments of the present application. Figure 2

[0048] The present application provides an image processing based wire box direction adjusting method, comprising the following specific steps:

[0049] S1: using the wire box standard part to place in the alignment position of the identification area, collecting the image data under different light supplement conditions, and pre-processing; in this step, first, the external size of a certain general type wire box and the subsequent processing posture convenient for installation are determined; then, the identification area is set at the specified position of the transmission line and the corresponding image acquisition module and light supplement assembly are installed; the image acquisition module is vertically installed directly above the identification area, when the wire box follows the transmission line to move to the alignment position of the identification area, the image acquisition module and the light supplement assembly start to collect the image information.

[0050] ​The standard part of the model is first placed in the alignment position of the identification area, and then the light supplement assembly is controlled to collect multiple image information at different color temperatures, color rendering indices, brightness, and luminosity for the same line box.

[0051] Further, the data of the light supplement assembly, including color temperature, color rendering index, lumen, and brightness, are acquired while the image is collected in step S1. Folders are established for the images obtained under different parameters and saved in the database. The images obtained under the same light supplement parameter are saved in the same folder.

[0052] S2: edge contour detection is performed based on the Canny algorithm, and the detected edge contour is subjected to inverse color processing to generate standard contrast images under different light supplement conditions; in step S2, the gray-scale image is inversely colored to green; different data sets are set for different light supplement conditions to save the standard contrast images corresponding to the light supplement conditions.

[0053] In this step, the Canny algorithm is a relatively mature contour extraction scheme in the art, and therefore the detailed steps will not be described in detail in this text, but only the basic steps will be explained; specifically as follows: first, the threshold value is dynamically calculated based on the image gray-scale histogram for the image processed by the gray-scale processing in step S1; the morphological closing operation is performed on the edge image to fill the contour gap; then, all the outer contours are extracted and filtered to remove the interference contours with an area less than a set threshold, so that the image after the edge contour extraction is finally obtained;

[0054] The left lower corner vertex of the contour is determined as the identification point by using the manual annotation method for all the processed images, and the images with poor imaging effect and obvious defects in contour extraction are manually removed; for example, the contour has a large loss compared with the actual image, or the contour has a part that does not exist in the actual image; the final standard contrast image is obtained, ensuring that there is at least one standard contrast image under each typical light supplement parameter. In this step, after removing the abnormal data, the accuracy and processing speed of the subsequent steps are improved.

[0055] S3: the image data of the line box to be tested is collected using steps S1 and S2, and is pre-processed and subjected to edge contour detection; in this step, steps S1 and S2 are repeated, and the image data of the same type of line box produced is collected during the transportation of the line box on the transmission line; and pre-processing and edge contour detection are performed to obtain a contour map.

[0056] S4: based on the extracted edge contour, determine four vertices; in step S4, the shape of the contour is determined using the polygon approximation method, the coordinates of the four vertices are calculated, and the vertices are arranged in ascending order of polar angle according to the centroid method. In this step, the contour image is obtained according to the minimum circumscribed rectangle algorithm to obtain the rotating rectangle parameters, including the center point (x c ,y c ), size (w, h), and rotation angle θ; the four vertex coordinates (x i ,y i ), i = 1, 2, 3, 4 are derived according to the rotation matrix parameters; the centroid of the vertex set is calculated. The polar angle αi = arctan2 (yi-y0, xi-x0) of each vertex relative to the centroid is calculated, and the vertices are arranged in ascending order of polar angle.

[0057] S5: taking the lower left corner vertex as the coordinate origin, calculating the vector between the diagonal vertex and the origin, and calculating the offset angle; in step S5, the vertex with the smallest sum of horizontal and vertical coordinates is taken as the origin, and the vertex with the largest sum of horizontal and vertical coordinates is taken as the diagonal vertex. The vector between the diagonal vertex and the origin is calculated and the offset angle is calculated. In this step, in order to simplify the subsequent calculation amount, the lower left corner vertex is selected as the origin, and the coordinates of the diagonal vertex are corrected to reduce the data calculation amount.

[0058] S6: rotating the to-be-tested image according to the offset angle, and matching the corresponding standard control image according to the original light supplement information of the collected image; in step S6, the lower left corner vertex is taken as the rotation center point, and the to-be-tested image is rotated according to the offset angle.

[0059] S7: comparing the rotated to-be-tested image with the standard control image to detect whether there is a large area of image reverse color area, and adjusting the angle of the line box according to the detection result. When detecting, taking the standard control image as the base layer, moving the rotated to-be-tested image above the base layer, and corresponding the lower left corner vertex with the recognition point of the standard control image; detecting the area of the reverse color area in the image at this time;

[0060] Setting a judgment threshold, if the judgment is lower than the threshold, adjusting the line box according to the angle of the image adjustment;

[0061] If there is an area with more than 2% pixel area with reverse color phenomenon, it is considered to exceed the threshold, and secondary rotation is needed; taking the centroid point of the edge contour as the center point, rotating the image clockwise by 90°, and performing secondary verification; if it meets the threshold, adjust the line box according to the angle of the two image adjustments; if it still does not meet the threshold, mark it for manual processing.

[0062] The application establishes a standard control image library and uniformly takes the lower left corner vertex as the recognition point; after the collected to-be-tested image is preprocessed and edge contour detection, four vertices are determined; the picture is corrected by calculating the offset angle between the diagonal vertices; the corrected image is compared with the standard control image, if the comparison is successful, the line box is adjusted according to the aforementioned picture adjustment angle; if the comparison fails, the line box is rotated clockwise by 90 degrees for secondary verification based on the aforementioned picture adjustment, if the comparison still fails, the line box is marked and transferred to manual processing, the problem causes are identified and logs are recorded.

[0063] The scheme of the application is described in detail below using a specific case:

[0064] As shown in Figure 1 , it is a common 86 type concealed line box; after processing by the injection molding equipment, it is generally collected in a larger barrel; when a sufficient number of line boxes are accumulated, they are poured onto the conveying line to facilitate the subsequent step of installing the screw hole gasket; as shown in Figure 1 , the box body 2 is provided with symmetrical mounting positions 1 for installing the screw hole gasket; for a plastic structure line box, after molding by the injection molding equipment, the screw hole gasket needs to be installed in the slot of the line box through manual or automatic installation steps; therefore, the line box adjustment structure needs to be provided on the conveying line to make the mounting position of the screw hole gasket correspond to the to-be-processed position; since the 86 type line box is a square structure, the mounting positions of the screw hole gaskets are completely symmetrical, so it only needs to be aligned in the horizontal plane. The following is the specific identification and operation process:

[0065] (1): using the steps of S1 and S2 described above to collect the to-be-tested image data of the line box, obtaining an RGB image with a resolution of 1920x1200, converting it to a grayscale image; after preprocessing and edge contour detection; in this step, the image data of the same type of line box produced in the conveying process of the conveying line is collected; and preprocessed and edge contour detected to obtain a contour graph; the contour graph shows the rectangular frame structure of the entire box body 2 and the structure of the mounting position 1. In this step, after applying CLAHE enhancement, the Canny threshold is automatically calculated as T1=45, T2=135; 2 candidate contours are detected in the grayscale image, and the main contour (area ratio 82%) is retained after area filtering;

[0066] (2): based on the extracted edge contour, four vertices are determined; in step (2), the polygon approximation method is used to determine the shape of the contour, and then the coordinates of the four vertices are calculated, and the vertices are arranged in ascending order according to the centroid method. In this step, the contour graph is obtained by the minimum circumscribed rectangle algorithm to obtain the rotating rectangular parameters, including the center point (x c ,yc ), dimensions (w, h), and rotation angle Θ; derive four vertex coordinates (xi, yi), i = 1, 2, 3, 4 from the rotation matrix parameters; calculate the centroid of the vertex set Calculate the polar angle of each vertex relative to the centroid, ai = arctan2(yi-y0, xi-x0); arrange the vertices in ascending order of polar angle. Using polygon approximation, four vertices are obtained, and the width-to-height ratio r = 1.05 is calculated, so it is determined to be a square; the vertex coordinates are sorted by the centroid method and output: (512.3, 288.7), (1215.1, 290.2), (1210.4, 912.5), (509.8, 910.9) four vertex coordinates.

[0067] (3): Take the lower left corner vertex as the coordinate origin, calculate the vector between the diagonal vertex and the origin, and calculate the offset angle; In step (2), the vertex with the smallest sum of horizontal and vertical coordinates is taken as the origin, that is, A (512.3, 288.7), and the vertex with the largest sum of horizontal and vertical coordinates is taken as the diagonal vertex, that is, B (1210.4, 912.5). The vector between the diagonal vertex and the origin is calculated and the offset angle is calculated. In this step, in order to simplify the subsequent calculation amount, the vertex at the lower left corner is selected as the origin, and the coordinates of the diagonal vertex are modified to reduce the data calculation amount, that is, the coordinates of point A are (0, 0); the modified coordinates of point B are (698.1, 623.8); According to the angle calculation formula, the angle of the modified vector is 41.8°, and since the 86 type line box is a square, the angle between the diagonal vertices is 45°, and the modified offset angle is 3.2°.

[0068] (4): Rotate the test image counterclockwise by 3.2° according to the offset angle, and match the corresponding standard control image according to the original light supplement information of the collected image; In step (4), the lower left corner vertex is taken as the rotation center point, and the test image is rotated according to the offset angle.

[0069] (5): Compare the rotated test image with the standard control image to detect whether there is a large area of image reverse color area, and adjust the angle of the line box according to the detection result. When detecting, take the standard control image as the base layer, move the rotated test image above the base layer, and correspond the lower left corner vertex with the recognition point of the standard control image; Detect the area of the reverse color area in the image at this time; Since the standard control image has been subjected to reverse color processing, its background color is green; and the test image is still a gray image, so when the two images are overlapped, the unobstructed green area can be easily observed, and by calculating the pixel area of this part of the area The whole outline image can determine whether the test image is aligned after the current angle adjustment. Take Figure 1 , for example, the base layer is Figure 1The structure shown is green overall. If the position of mounting position 1 is the same as that of the standard reference image after one adjustment, the gray image will cover the green part. If the position of mounting position 1 is different from that of the standard reference image after one adjustment, the mounting position 1 in the standard reference image will not be covered, and the green pixel area will be very significant. By identifying the area of ​​green pixels, it is easy to identify whether the image has been adjusted properly.

[0070] Set a judgment threshold. If the judgment is below the threshold standard, adjust the wire box according to the angle of image adjustment.

[0071] If an area exceeding 2% of the pixel area exhibits color inversion, it is considered to exceed the threshold standard and requires a second rotation. The image is rotated 90° clockwise around the centroid of the edge contour for a second verification. If it meets the threshold standard, the wirebox is adjusted according to the angles of the two image adjustments. If it still does not meet the threshold standard, it is marked for manual processing.

[0072] Example 2

[0073] like Figure 3 The diagram shown is a system structure block diagram of a wire box orientation adjustment system based on image processing according to an embodiment of this application. This invention provides a wire box orientation adjustment system based on image processing, which uses the steps of the method described in Embodiment 1 to detect wire boxes on a transmission line. Specifically, it includes an image acquisition module, a supplementary lighting component, a preprocessing module, a calculation module, a data annotation module, an angle adjustment module, and an interactive display module.

[0074] The image acquisition module is vertically installed directly above the transmission line identification area to acquire image data of the cable box.

[0075] The supplementary lighting component is installed on one side of the image acquisition module and is used to work in conjunction with the image acquisition module to provide supplementary light source when acquiring image data, so as to reduce the influence of ambient light.

[0076] The preprocessing module is used to perform preprocessing steps on the acquired images to eliminate noise and improve contrast;

[0077] The calculation module is used to determine the outline and four vertices of the image, and to adjust and compare the image based on the offset angle.

[0078] The data labeling module is used to mark wire boxes that fail verification after two rotations and then transfer them to manual processing.

[0079] The angle adjustment module is used to adjust the angle of the junction box on the transmission line step by step according to the technical angle output by the calculation module;

[0080] The interactive display module is used for displaying the running state of the system and providing an interactive control interface; a user manually changes the standard contrast image through the interactive control interface and manually performs verification.

[0081] In this embodiment, the image acquisition module first acquires the standard contrast image of the line box of this model under different light supplement conditions, and performs inverse color processing on the standard contrast image; in an indoor environment with good light illumination conditions, relatively fixed light supplement conditions can be used for image acquisition, so as to reduce the problem of large imaging effect difference caused by environmental light factors; and for scenes with large environmental light changes, the environmental light intensity can be acquired through an algorithm, and the parameters of the light supplement assembly are adaptively adjusted, so as to ensure stable imaging effect. Here, those skilled in the art can understand that the specific operations of each step in the above image processing-based line box direction adjustment method have been described in detail in the description of the image processing-based line box direction adjustment method in the above embodiment, and therefore, repeated description will be omitted. Figures 2 to 3

[0082] Embodiment 3

[0083] Figure 4 A structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.

[0084] It should be noted that the computer system of the electronic device in this embodiment is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0085] The computer system in this embodiment includes a central processing unit 401, which can perform various appropriate actions and processes according to programs stored in a read-only memory 402 or programs loaded into a random access memory 403 from a storage part 408, such as the image processing-based line box direction adjustment method described in the above embodiments. In the random access memory 403, various programs and data required for system operation are also stored. The central processing unit 401, the read-only memory 402, and the random access memory 403 are connected to each other through a bus 404. An input / output interface 405 is also connected to the bus 404.

[0086] ​The following components are connected to the input / output interface 405: an input portion 406 including a keyboard, a mouse, etc.; an output portion 407 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 408 including a hard disk, etc.; and a communication portion 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication portion 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the input / output interface 405 as necessary. A removable media 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 410 as necessary, so that a computer program read out therefrom is installed in the storage portion 408 as necessary.

[0087] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program in accordance with embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing computer programs for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication portion 409, and / or installed from the removable media 411. When the computer program is executed by the central processing unit 401, various functions defined in the system of the present application are executed.

[0088] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable computer programs. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, device or apparatus. The computer programs contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.

[0089] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0090] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described can also be located in a single processor. In some cases, the names of the units do not limit the units themselves.

[0091] According to an aspect of the present application, there is provided a computer program product or computer program, comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various optional implementation manners described above.

[0092] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the image processing based line box direction adjustment method described in the above embodiments.

[0093] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, the division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into several modules or units.

[0094] From the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) execute the methods according to the embodiments of the present application.

[0095] To sum up, the image processing-based line box direction adjustment method based on the embodiments of the present application is illustrated, which establishes standard control images under different parameters and performs inverse color processing on the standard control images. Then, the collected gray-scale images are first determined for the vertex and the offset angle, and the offset angle is used to correct the images. The corrected images are compared with the standard control images. If the comparison is successful, the line box is adjusted according to the aforementioned image adjustment angle. If the comparison fails, the image is further rotated clockwise by 90° for secondary verification based on the aforementioned image adjustment. If the comparison still fails, the image is labeled and transferred to manual processing to identify the cause of the problem and record the log. Through the image adjustment comparison method, the position and pose of the line box can be verified before the mechanical equipment adjusts the position and pose, thereby improving the accuracy of the subsequent mechanical equipment adjustment. This facilitates the subsequent production steps and improves the production efficiency.

Claims

1. A method for adjusting the orientation of a wire box based on image processing, characterized in that, The specific steps include the following: S1: Use standard wire box components to align the identification area, collect image data under different lighting conditions, and perform preprocessing; S2: Edge contour detection is performed based on the Canny algorithm, and the grayscale image is inverted to generate standard comparison images under different lighting conditions; S3: Use steps S1 and S2 to acquire the image data of the wire box to be tested, perform preprocessing and edge contour detection; S4: Based on the extracted edge contour, process it to determine the four vertices; in step S4, use the polygon approximation method to determine the shape of the contour, then calculate the coordinates of the four vertices, and arrange the vertices in ascending polar angle order according to the centroid method; in this step, obtain the rotation rectangle parameters, including the center point, from the contour map using the minimum bounding rectangle algorithm. ,size And the rotation angle θ; derive the coordinates of the four vertices based on the rotation matrix parameters. ,i=1,2,3,4; Calculate the centroid of the vertex set. ; Calculate the polar angle of each vertex relative to the centroid. Arrange the vertices in ascending order of polar angle; S5: Using the bottom left corner as the origin, calculate the vector between the diagonal vertices and the origin, and calculate the offset angle; S6: Rotate the image to be tested according to the offset angle, and match the corresponding standard control image according to the original supplementary lighting information of the acquired image; in step S6, the image to be tested is rotated according to the offset angle with the lower left corner vertex as the rotation center point. S7: Compare the rotated image to be tested with the standard reference image to detect whether there is a large area of ​​inverted color in the image. Adjust the angle of the wire box according to the detection result. When performing the detection, use the standard reference image as the base layer, move the rotated image to be tested above the base layer, and align the lower left vertex with the recognition point of the standard reference image; detect the area of ​​the inverted color region in the image at this time. Set a judgment threshold. If the judgment is below the threshold standard, adjust the wire box according to the angle of image adjustment. If an area exceeding 2% of the pixel area exhibits color inversion, it is considered to exceed the threshold standard and requires a second rotation. The image is rotated 90° clockwise around the centroid of the edge contour for a second verification. If it meets the threshold standard, the wirebox is adjusted according to the angles of the two image adjustments. If it still does not meet the threshold standard, it is marked and manually processed.

2. The method for adjusting the orientation of a wire box based on image processing according to claim 1, characterized in that, In step S1, an image acquisition module and a supplementary lighting component are installed at a designated location on the transmission line to capture images of the box moving on the transmission line vertically.

3. The wire box orientation adjustment method based on image processing according to claim 2, characterized in that, In step S1, while acquiring the image, the data of the supplementary lighting component is also obtained, specifically including color temperature, color rendering index, lumens and brightness.

4. The image processing-based wire box orientation adjustment method according to any one of claims 1-3, characterized in that, The preprocessing steps in step S1 include: grayscale conversion and noise removal.

5. The method for adjusting the orientation of a wire box based on image processing according to claim 1, characterized in that, In step S2, the grayscale image is inverted to green; different datasets are set up for different lighting conditions, and standard control images corresponding to those lighting conditions are saved respectively.

6. A wire box orientation adjustment system based on image processing, wherein the detection is performed using the method described in any one of claims 1-5, characterized in that, It includes an image acquisition module, a supplementary lighting component, a preprocessing module, a calculation module, a data annotation module, an angle adjustment module, and an interactive display module; The image acquisition module is vertically installed directly above the transmission line identification area to acquire image data of the cable box. The supplementary lighting component is installed on one side of the image acquisition module and is used to work in conjunction with the image acquisition module to provide supplementary light source when acquiring image data, so as to reduce the influence of ambient light. The preprocessing module is used to perform preprocessing steps on the acquired images to eliminate noise and improve contrast; The calculation module is used to determine the outline and four vertices of the image, and to adjust and compare the image based on the offset angle. The data labeling module is used to mark wire boxes that fail verification after two rotations and then transfer them to manual processing. The angle adjustment module is used to adjust the angle of the junction box on the transmission line step by step according to the technical angle output by the calculation module; The interactive display module is used to display the system's operating status and provides an interactive control interface; users can manually change the standard comparison image through the interactive control interface to perform manual verification.

Citation Information

Patent Citations

  • Visual inspection system and method for liquid crystal display machine of electric energy meter

    CN114236885A

  • Visual inspection-based wobble plate adjustment method and wobble plate equipment

    CN118514089A