A transformer automatic laser coding method and system based on visual positioning

Through visual positioning and image processing technology, the problems of low coding quality and low sorting efficiency in transformer laser coding are solved, and high-quality coding and accurate sorting of transformers are achieved.

CN118898421BActive Publication Date: 2025-01-10ZHUHAI DINGHAO ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411364554.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-10
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In the prior art, transformer laser coding has problems such as low coding quality, difficulty in achieving accurate sorting and low sorting efficiency, especially the non-standard placement of the transformer leads to deviation of the coding position and low manual sorting efficiency.

Method used

Using automatic laser coding method based on visual positioning, generate coding data by obtaining transformer production parameters, positioning and adjusting coding positions in real time, image acquisition and preprocessing, identify text area and position information, judge coding quality, and pass Visual significance model and wavelet transform improve sorting accuracy.

Benefits of technology

Improve coding quality, avoid coding position deviation and character loss, enhance the accuracy and efficiency of sorting, and ensure accurate sorting of transformers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898421B_ABST
    Figure CN118898421B_ABST
Patent Text Reader

Abstract

The present invention discloses a transformer automatic laser coding method and system based on visual positioning, comprising the following steps: obtaining the production parameters of the transformer, automatically generating transformer coding data according to preset rules; when arriving at the coding area, laser coding the transformer based on visual positioning to obtain a coding transformer; when arriving at the quality inspection area, image acquisition is performed on the coding transformer to obtain a coding transformer image, and preprocessing and text detection are performed to obtain a text area and its position information; the text in the text area is identified to obtain a corresponding text string, and the coding quality is judged according to the text string and the text area position information, and unqualified coding transformers are eliminated. The present invention achieves the purpose of improving coding quality and sorting efficiency, and realizing accurate sorting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual positioning processing, and in particular to a transformer automatic laser coding method and system based on visual positioning. Background Art

[0002] Laser coding is one of the important fields of laser application technology. It features outstanding coding effect and coding speed, and has gradually become one of the main methods in the coding industry. Today, laser coding has become an effective coding tool for a variety of materials such as plastics, paper, quartz, ceramics, and metals. It is pollution-free, non-contact, and wear-free, and has become an emerging laser processing technology developed after laser welding, laser heat treatment, laser cutting, and laser drilling.

[0003] In recent years, with the improvement of laser reliability and practicality, coupled with the rapid development of computer technology and the improvement of optical devices, the development of laser coding technology has been promoted.

[0004] Laser coding is a technology that uses laser beams to permanently encode on the surface of various materials. It has become the most vital technology in various packaging application fields. Laser is a device that generates and outputs lasers. The principle of laser coding is to emit lasers through lasers to burn or etch the surface of the printed object, thereby reflecting the coding effect. The key to this technology is the effective use of laser energy, thereby improving the economy of the process. Etching refers to the use of an appropriate amount of laser energy to melt or etch a fine groove on materials such as PET (such as soda bottles), PS and PP. The effect of coding is to expose the deeper material through the evaporation of the surface material, or to engrave a trace through the chemical and physical changes of the surface material caused by light energy, or to burn part of the material through light energy to show the graphics and text to be etched. The codes obtained by burning and etching technology are high-quality, permanent and instantaneous.

[0005] At present, in the last process of transformer production and preparation, it is necessary to mark the transformer's specifications, models, batch numbers, parameters, certification symbols, etc. on the tape of the transformer shell through laser coding. The specific process is: the transformer is placed on the conveying mechanism, and is conveyed to the bottom of the laser coding equipment through the conveying mechanism for laser coding. After the coding is completed, it is manually sorted to select transformers with unqualified coding quality.

[0006] From the above process, it can be seen that the existing laser coding method for transformers has the following problems:

[0007] (1) When placing the transformer on the conveying mechanism, it is difficult to fully standardize the placement of the transformer. During laser coding, the laser coding equipment will not automatically adjust the coding position according to the placement of the transformer, resulting in low coding quality. It is easy to have obvious deviations from the preset coding position, character tilt, character missing and other problems;

[0008] (2) After the transformers are coded, they are sorted manually, which makes it difficult to achieve accurate sorting and has low sorting efficiency. Summary of the invention

[0009] In order to overcome the shortcomings of the prior art, the present invention provides a transformer automatic laser coding method and system based on visual positioning, which is used to solve the technical problems of low coding quality, difficulty in accurate sorting and low sorting efficiency in the existing laser coding method for transformers, thereby improving the coding quality and sorting efficiency and achieving accurate sorting.

[0010] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0011] A transformer automatic laser coding method based on visual positioning includes the following steps:

[0012] Obtain the production parameters of the transformer and automatically generate transformer coding data according to preset rules;

[0013] When the transformer reaches the coding area, laser coding is performed on the transformer based on visual positioning to obtain a coding transformer;

[0014] When arriving at the quality inspection area, the coding transformer is imaged to obtain a coding transformer image, and preprocessed and text detected to obtain the text area and its position information;

[0015] Identify the text in the text area to obtain a corresponding text string, judge the coding quality according to the text string and the text area position information, and remove unqualified coding transformers;

[0016] Wherein, when laser coding is performed, it includes: performing image acquisition and preprocessing on the transformer on the coding area to obtain a grayscale image of the transformer, and performing segmentation and edge detection to obtain the outer contour edge features of the transformer;

[0017] When performing segmentation, the method includes: dividing the transformer grayscale image into the first and second sub-blocks, and obtaining the grayscale value variance of the first and second sub-blocks; determining the first and second category intervals, and obtaining the pixel points located in the first and second category intervals in each sub-block, marking them as the first and second category pixel points respectively, and defining background pixel points in the first and second category pixel points; defining each sub-block as a foreground block or a background block according to the grayscale value variance and the background pixel points, and performing smoothing to obtain the segmented transformer image.

[0018] As a preferred embodiment of the present invention, when laser coding is performed, it also includes:

[0019] The transformer is identified, the corresponding template image is extracted, the transformer is positioned based on the outer contour edge feature and the template image, positioning information is obtained, and the initial coding position is adjusted according to the positioning information.

[0020] As a preferred implementation manner of the present invention, when obtaining the gray value variance of the first and second sub-blocks, it includes:

[0021] Get the grayscale average of the first sub-block and the second sub-block, as shown in Formula 1:

[0022] (1);

[0023] In the formula, , is the length and width of the sub-block, is the first sub-block or the second sub-block, is the grayscale average value of the first sub-block or the second sub-block;

[0024] According to the grayscale average value, the grayscale value variance of the first sub-block and the second sub-block is obtained, as shown in Formula 2:

[0025] (2);

[0026] In the formula, Pixel The grayscale level, is the gray value variance;

[0027] When marking the first and second types of pixels, it includes:

[0028] Obtain the central grayscale of the first-class line and the second-class line in the transformer grayscale image, and determine the first-class interval and the second-class interval according to the central grayscale;

[0029] Pixel points in each sub-block that are located in the first category interval are obtained and marked as first category pixel points, and pixel points in each sub-block that are located in the second category interval are obtained and marked as second category pixel points.

[0030] As a preferred embodiment of the present invention, when edge detection is performed, it includes:

[0031] Perform wavelet decomposition on the segmented transformer image to obtain a low-frequency transformer sub-image and a high-frequency transformer sub-image;

[0032] Performing edge detection on the low-frequency transformer sub-image based on optimized morphology to obtain the edge of the low-frequency transformer sub-image;

[0033] Among them, when edge detection is performed based on optimized morphology, it includes:

[0034] Based on the structural element, negative noise is suppressed by closing operation, positive noise is suppressed by opening operation, and edge information is extracted by using the difference between dilation operation and erosion operation.

[0035] As a preferred embodiment of the present invention, when edge detection is performed, it also includes:

[0036] Performing edge detection on the high-frequency transformer sub-image based on the wavelet modulus maximum, and performing fast binary wavelet transform to obtain the edge of the high-frequency transformer sub-image;

[0037] The edge of the low-frequency transformer sub-image and the edge of the high-frequency transformer sub-image are fused through inverse wavelet transform to obtain a transformer image with clear edges.

[0038] As a preferred embodiment of the present invention, when obtaining the positioning information of the transformer, it includes: obtaining position information and obtaining angle information;

[0039] The acquisition of the position information includes: obtaining the minimum circumscribed rectangle of the transformer according to the outer contour edge features, and obtaining the coordinates of the center point as the position information of the transformer;

[0040] The angle information acquisition includes: acquiring the direction vectors of the transformer grayscale image and the template image, and obtaining the angle between the transformer grayscale image and the template image according to the direction vector as the angle information of the transformer.

[0041] As a preferred embodiment of the present invention, when performing preprocessing and text detection, it includes:

[0042] Bilateral filtering is used to highlight the edges of text areas and suppress noise;

[0043] The visual saliency model is used to extract the salient regions of the image at different scales, and weighted average is performed to obtain the final saliency map containing the final salient regions.

[0044] An initial region whose edge density is greater than a threshold and is regular in the final salient region is obtained, morphological processing is performed, a connected domain is constructed, a candidate region is obtained, and a connected domain analysis is performed to obtain a text region and its position information.

[0045] As a preferred implementation of the present invention, when obtaining the corresponding text string, it includes:

[0046] Performing expansion processing on the text area, using a search function to obtain column information and row information of characters, and obtaining the boundary of each character;

[0047] The height and width of the character string are obtained according to the boundaries of each character, the text area is segmented to obtain a plurality of first character images, and pixel expansion is performed to obtain a plurality of second character images;

[0048] The plurality of second character images are stored in an array one by one in order to obtain a character array set.

[0049] As a preferred embodiment of the present invention, when judging the coding quality, it includes:

[0050] Performing template matching according to the height and width of the character string, and retrieving corresponding text area position information and character comparison table;

[0051] Compare the retrieved text area position information with the detected text area position information, and compare the character images in the character array set with the character comparison table one by one in order;

[0052] When both the position comparison and the character comparison are passed, the coding quality is considered qualified.

[0053] A transformer automatic laser coding system based on visual positioning, comprising:

[0054] Coding data generation unit: used to obtain the production parameters of the transformer and automatically generate transformer coding data according to preset rules;

[0055] Coding unit: used for laser coding the transformer based on visual positioning when reaching the coding area to obtain a coded transformer;

[0056] Text detection unit: used to collect images of the coding transformer when it arrives at the quality inspection area, obtain the coding transformer image, and perform preprocessing and text detection to obtain the text area and its position information;

[0057] A coding quality judgment unit: used to identify the text in the text area, obtain the corresponding text string, judge the coding quality according to the text string and the text area position information, and remove unqualified coding transformers;

[0058] Wherein, when laser coding is performed, it includes: performing image acquisition and preprocessing on the transformer on the coding area to obtain a grayscale image of the transformer, and performing segmentation and edge detection to obtain the outer contour edge features of the transformer;

[0059] When performing segmentation, the method includes: dividing the transformer grayscale image into the first and second sub-blocks, and obtaining the grayscale value variance of the first and second sub-blocks; determining the first and second category intervals, and obtaining the pixel points located in the first and second category intervals in each sub-block, marking them as the first and second category pixel points respectively, and defining background pixel points in the first and second category pixel points; defining each sub-block as a foreground block or a background block according to the grayscale value variance and the background pixel points, and performing smoothing to obtain the segmented transformer image.

[0060] Compared with the prior art, the present invention has the following beneficial effects:

[0061] (1) After the transformer reaches the coding area, the method provided by the present invention can obtain the real-time positioning information of the transformer through visual positioning, so as to adjust the initial coding position of the laser coding device in real time according to the real-time positioning information, effectively avoiding obvious deviation from the preset coding position, character tilt, character missing, etc., and greatly improving the coding quality;

[0062] (2) The segmentation method provided by the present invention effectively suppresses image noise by combining pixel clustering with grayscale characteristics, and accurately separates the background area from the transformer grayscale image, thereby effectively improving the accuracy of subsequent edge detection;

[0063] (3) When the invention performs edge detection on a low-frequency transformer sub-image, the method used can smooth the low-frequency transformer sub-image and obtain the details in the edge image, which can better detect the edge of the low-frequency transformer sub-image and improve the morphological anti-noise ability;

[0064] (4) The present invention performs a fast binary wavelet transform so that the number of wavelet coefficients at different scales is the same as the number of pixels in the original image, thereby facilitating fusion processing between scales;

[0065] (5) The present invention uses a visual saliency model to perform saliency detection at multiple scales, obtains saliency maps at different scales, and then fuses the saliency maps at different scales to obtain a final saliency map, thereby eliminating the defects of edge blur and internal hollowing existing in the saliency map at a single scale, and facilitates the subsequent accurate extraction of text areas and their location information;

[0066] (6) The present invention considers the correctness of the characters, the correctness of the character size, the correctness of the character sequence, and the correctness of the text area position when judging the coding quality, thereby greatly improving the sorting accuracy while ensuring the sorting efficiency.

[0067] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 This is a step diagram of the transformer automatic laser coding method based on visual positioning provided by the present invention;

[0069] Figure 2 It is a schematic diagram of the transformer coding process provided by the present invention;

[0070] Figure 3 This is a physical picture of the coding transformer provided by the present invention.

[0071] Explanation of the accompanying drawings: 1. Transformer; 2. C02 laser; 3. Beam expander; 4. First reflector; 5. Second reflector; 6. X-axis scanning galvanometer; 7. Y-axis scanning galvanometer; 8. Flat-field focusing mirror; 9. Conveying mechanism. DETAILED DESCRIPTION

[0072] The automatic laser coding method for transformers based on visual positioning provided by the present invention is as follows: Figure 1 As shown, the following steps are included:

[0073] Step S1: Obtain the production parameters of the transformer 1 from the preset production plan, and automatically generate transformer coding data according to preset rules through the PLC system;

[0074] Step S2: Start the conveying mechanism 9 to convey the transformer 1, and when the transformer 1 reaches the coding area in real time, stop conveying, start the laser coding device, and perform laser coding on the transformer 1 based on visual positioning to obtain a coded transformer;

[0075] Step S3: Start the conveying mechanism 9 to convey the coding transformer, and when the coding transformer reaches the quality inspection area in real time, stop the conveying, start the image acquisition device to acquire an image of the coding transformer, and obtain an image of the coding transformer;

[0076] Step S4: preprocessing the coding transformer image to obtain a preprocessed coding transformer image, performing text detection on the preprocessed coding transformer image to obtain text area and position information thereof;

[0077] Step S5: Identify the text in the text area and obtain the corresponding text string, and judge the coding quality of the coding transformer according to the text string and the text area position information;

[0078] Step S6: According to the judgment result, the unqualified coding transformers are removed by driving the motion mechanism through the PLC system.

[0079] Specifically, the production parameters include: specification model, batch number, parameters, certification symbol, etc. of the transformer 1.

[0080] Specifically, the laser coding equipment used in the present invention includes: a galvanometer-type C02 laser coding machine, such as Figure 2 As shown, it includes: a CO2 laser 2, a beam expander 3, a first reflector 4, a second reflector 5, an X-direction scanning galvanometer 6, a Y-direction scanning galvanometer 7 and a flat-field focusing mirror 8.

[0081] The light beam emitted by the CO2 laser 2 is first expanded and collimated by the beam expander 3. The expanded light beam is incident on the first reflector 4 and the second reflector 5. The direction of the light beam is adjusted by the first reflector 4 and the second reflector 5. The light beam is incident on the scanning system composed of the X-direction scanning galvanometer 6 and the Y-direction scanning galvanometer 7 to control the movement of the light beam along the X direction and the Y direction. The light beam is focused on the transformer to be coded by the flat-field focusing mirror 8, and finally a coding transformer is obtained, as shown in FIG. Figure 3 shown.

[0082] In the above step S2, when laser coding is performed on the transformer 1 based on visual positioning, it includes:

[0083] Capture an image of the transformer 1 on the coding area to obtain a transformer image;

[0084] Preprocess the transformer image to obtain a transformer grayscale image;

[0085] Segment and detect the edge of the transformer grayscale image to obtain the outer contour edge features of the transformer 1;

[0086] Identify the transformer 1, extract the corresponding template image, and locate the transformer 1 based on the outer contour edge features and the template image to obtain the location information of the transformer 1;

[0087] Adjust the initial marking position of the laser marking device according to the positioning information.

[0088] Specifically, after the transformer 1 reaches the coding area, the method provided by the present invention can obtain the real-time positioning information of the transformer 1 through visual positioning, so as to adjust the initial coding position of the laser coding equipment in real time according to the real-time positioning information, effectively avoiding obvious deviation from the preset coding position, character tilt, character missing, etc., and greatly improving the coding quality.

[0089] Furthermore, when performing the segmentation, it includes:

[0090] Dividing the transformer grayscale image into a first sub-block and a second sub-block;

[0091] Get the grayscale average of the first sub-block and the second sub-block, as shown in Formula 1:

[0092] (1);

[0093] In the formula, , is the length and width of the sub-block, is the first sub-block or the second sub-block, is the grayscale average value of the first sub-block or the second sub-block;

[0094] According to the grayscale average value, the grayscale value variance of the first sub-block and the second sub-block is obtained, as shown in Formula 2:

[0095] (2);

[0096] In the formula, Pixel The grayscale level, is the gray value variance;

[0097] Obtain the central grayscale of the first-class line and the second-class line in the transformer grayscale image, and determine the first-class interval and the second-class interval according to the central grayscale;

[0098] Obtaining pixel points in each sub-block that are located in the first category interval and marking them as first category pixel points, and obtaining pixel points in each sub-block that are located in the second category interval and marking them as second category pixel points;

[0099] The first type of pixel is defined as a background pixel; the variance of the second type of pixel and the gray value average value of the sub-block to which it belongs is obtained, and it is determined whether the variance is less than the gray value variance of the sub-block to which it belongs. If so, the corresponding second type of pixel is defined as a background pixel;

[0100] Determine whether the gray value variance of each sub-block is greater than the preset threshold If yes, then determine whether the percentage of the number of background pixels in each sub-block to the total number of pixels in the entire sub-block is less than a preset first percentage. If yes, define the corresponding sub-block as a foreground block; if it is less than a preset threshold , it is determined whether the percentage of the number of background pixels in each sub-block to the total number of pixels in the entire sub-block is less than a preset second percentage, and if so, the corresponding sub-block is defined as a foreground block; and the remaining sub-blocks are defined as background blocks;

[0101] Smoothing the defined sub-blocks to obtain the segmented transformer image;

[0102] The first sub-blocks are non-overlapping sub-blocks, the second sub-blocks are overlapping sub-blocks, the first type of lines are straight lines, and the second type of lines are non-straight lines.

[0103] Specifically, the first type of interval is ,in, is the preset threshold, is the center grayscale of the second type of line. The second type interval is ,in, is the center grayscale of the first type of line.

[0104] Specifically, the segmentation method provided by the present invention suppresses image noise well through pixel clustering combined with grayscale characteristics, and accurately separates the background area from the transformer grayscale image, thereby effectively improving the accuracy of subsequent edge detection.

[0105] Furthermore, when performing edge detection, it includes:

[0106] Perform wavelet decomposition on the segmented transformer image to obtain a low-frequency transformer sub-image and a high-frequency transformer sub-image;

[0107] Perform edge detection on the low-frequency transformer sub-image based on optimized morphology to obtain the edge of the low-frequency transformer sub-image;

[0108] Among them, when edge detection is performed based on optimized morphology, it includes:

[0109] Based on the first structural element, the second structural element and the third structural element, the negative noise in the low-frequency transformer sub-image is suppressed by a closing operation to obtain the first low-frequency transformer sub-image, as shown in Formula 3:

[0110] (3);

[0111] In the formula, is the low frequency transformer sub-image; is the first structural element, is the second structural element, the third structural element , is the corrosion operation, is the dilation operation, is the closing operation;

[0112] Based on the first structural element, the second structural element and the third structural element, the positive noise in the first low-frequency transformer sub-image is suppressed by an open operation to obtain a second low-frequency transformer sub-image, as shown in Formula 4:

[0113] (4);

[0114] In the formula, is the opening operation;

[0115] The edge information of the second low-frequency transformer sub-image is extracted using the difference between the dilation operation and the erosion operation, as shown in Formula 5:

[0116] (5).

[0117] Specifically, the first structural element , as shown below: ;

[0118] The second structural element , as shown below: ;

[0119] The third structural element , as shown below: ;

[0120] Specifically, when performing edge detection on a low-frequency transformer sub-image, the method adopted by the present invention can smooth the low-frequency transformer sub-image and obtain the details in the edge image, so as to better detect the edge of the low-frequency transformer sub-image and improve the morphological anti-noise capability.

[0121] Furthermore, when edge detection is performed, it also includes:

[0122] Perform edge detection on the high-frequency transformer sub-image based on the wavelet modulus maximum to obtain an initial high-frequency transformer sub-image containing multi-scale edge points, and perform fast binary wavelet transform on the initial high-frequency transformer sub-image to obtain the edge of the high-frequency transformer sub-image;

[0123] The low-frequency transformer sub-image edge and the high-frequency transformer sub-image edge are fused through inverse wavelet transform to obtain a transformer image with clear edges.

[0124] Wherein, when performing fast binary wavelet transform on the initial high-frequency transformer sub-image, it includes:

[0125] The low-frequency information of the image is used, and the initial high-frequency transformer sub-image is processed by the first decomposition filter and the second decomposition filter, as shown in Formula 6:

[0126] (6);

[0127] In the formula, is the first analysis filter, is the second analysis filter, is convolution, is the corresponding scale, For scale The low-frequency information of the image below, is the initial high-frequency transformer sub-image, for The wavelet coefficients in the direction, for Wavelet coefficients in the direction;

[0128] in, To interpolate between adjacent coefficients of the low-pass filter 0 is obtained, To interpolate between adjacent coefficients of the high-pass filter 0 is obtained.

[0129] Specifically, the present invention makes the number of wavelet coefficients at different scales the same as the number of pixels of the original image by performing fast binary wavelet transform, thereby facilitating the fusion processing between different scales.

[0130] Furthermore, when the positioning information of the transformer 1 is obtained, it includes: obtaining the position information and obtaining the angle information;

[0131] Among them, location information acquisition includes:

[0132] The minimum bounding rectangle of transformer 1 is obtained according to the outer contour edge features, and the center point coordinates of the minimum bounding rectangle are obtained, and the center point coordinates are used as the position information of transformer 1, as shown in Formula 7:

[0133] (7);

[0134] In the formula, For the The horizontal coordinates of the vertices, For the The vertical coordinates of the vertices;

[0135] Angle information acquisition, including:

[0136] The contour point information in the outer contour edge feature is obtained, and the segmentation points are extracted based on the contour point information. The segmentation points are shown in Formula 8:

[0137] (8);

[0138] In the formula, For the Split points, is the number of segmentation points extracted;

[0139] Get the length of the contour segment, as shown in Formula 9 and Formula 10:

[0140] (9);

[0141] (10);

[0142] In the formula, , is the coordinate of the split point;

[0143] Get the Euclidean distance between the segmentation points, as shown in Formula 11:

[0144] (11);

[0145] In the formula, For the The coordinates of the split points, For the The coordinates of the split points;

[0146] According to the length of the contour segment and the Euclidean distance, the distance ratio of the length of the contour segment to the spacing between the segmentation points is obtained, as shown in Formula 12:

[0147] (12);

[0148] Get the distance from the segmentation point to the center point of the minimum circumscribed rectangle, as shown in Formula 13:

[0149] (13);

[0150] In the formula, is the coordinate of the center point of the minimum circumscribed rectangle;

[0151] According to the length and distance of the contour segment , we get the ratio between the length of the contour segment and the distance from the segmentation point to the center point of the minimum circumscribed rectangle, as shown in Formula 14:

[0152] (14);

[0153] The ratio of the length of the contour segment to the distance between the segmentation points and the ratio of the length of the contour segment to the distance from the segmentation point to the center point of the minimum circumscribed rectangle are used as the feature values ​​of the segmentation points, and the feature matching between the template image and the segmentation points on the transformer grayscale image is performed based on the feature values ​​to obtain the segmentation point with the highest matching degree;

[0154] The coordinates of the segmentation point with the highest matching degree in the transformer grayscale image and the template image are obtained, and the first direction vector and the second direction vector are obtained according to the coordinates, as shown in Formula 15 and Formula 16 respectively:

[0155] (15);

[0156] (16);

[0157] In the formula, is the first direction vector, representing the direction vector of the transformer grayscale image; is the second direction vector, representing the direction vector of the template image; is the coordinate of the segmentation point with the highest matching degree on the transformer grayscale image, is the coordinate of the segmentation point with the highest matching degree on the template image, is the coordinate of the center point of the minimum circumscribed rectangle of the transformer grayscale image, is the coordinate of the center point of the minimum circumscribed rectangle of the template image;

[0158] According to the first direction vector and the second direction vector, the angle between the transformer grayscale image and the template image is obtained, and the angle is used as the angle information of transformer 1, as shown in formula 17:

[0159] (17).

[0160] Specifically, the method provided by the present invention obtains the position information of the transformer 1 on the conveying mechanism 9 in real time, and adjusts the initial coding point of the laser coding device in real time according to the position information, thereby preventing the situation of obvious deviation from the preset coding position and missing characters; obtains the angle information of the transformer 1 on the conveying mechanism 9 in real time, and adjusts the initial coding angle of the laser coding device in real time according to the position information, thereby preventing the characters from being tilted.

[0161] In the above step S4, when performing preprocessing and text detection, it includes:

[0162] Bilateral filtering is used to preprocess the coding transformer image to highlight the edge of the text area and suppress noise, and the preprocessed coding transformer image is obtained;

[0163] A visual saliency model is provided, and salient regions of the preprocessed coded transformer image at different scales are extracted by the visual saliency model to obtain a saliency map containing different saliency regions;

[0164] Taking a weighted average of the saliency maps containing different saliency regions, a final saliency map containing the final saliency region is obtained;

[0165] Obtain the initial region in the final salient region whose edge density is greater than the threshold and regular, perform morphological processing on the initial region, construct a connected domain, and obtain the candidate region;

[0166] Based on the prior knowledge of text arrangement rules, the candidate regions are analyzed for connected domains to obtain the text region and its location information.

[0167] Specifically, the visual saliency model includes: a visual saliency model based on spectral residual, which performs a convolution mean filtering operation on the Fourier amplitude log spectrum of the preprocessed coding transformer image, and subtracts the mean filtering result from the Fourier amplitude log spectrum to obtain a saliency map containing a saliency area, as shown in the following formula:

[0168] ;

[0169] In the formula, is the Fourier amplitude spectrum, is the Fourier amplitude log spectrum, It is convolution mean filter.

[0170] Among them, when obtaining the edge density, it is as shown in the following formula:

[0171] ;

[0172] In the formula, is the window height, is the window width, is the weighting coefficient in the row direction, is the weighting coefficient in the column direction.

[0173] Specifically, the present invention uses a visual saliency model to perform saliency detection at multiple scales to obtain saliency maps at different scales, and then fuses the saliency maps at different scales to obtain a final saliency map, thereby eliminating the defects of edge blur and internal hollowing existing in the saliency map at a single scale, thereby facilitating the subsequent accurate extraction of text areas and their location information.

[0174] In the above step S5, when the corresponding text string is obtained, it includes:

[0175] Dilate the text area and use the search function to get the character column information;

[0176] Obtaining a preset character spacing threshold, when the interval between two adjacent columns is greater than the preset character spacing threshold, determining that the corresponding columns are left and right boundaries of the characters;

[0177] Use the search function to get the row information of the characters, and combine the column information to get the boundaries of each character;

[0178] The height and width of the character string are obtained according to the boundaries of each character, and the text area is segmented according to the boundaries of each character to obtain a plurality of first character images, and the plurality of first character images are pixel-expanded to obtain a plurality of second character images;

[0179] The plurality of second character images are stored in an array one by one in order to obtain a character array set.

[0180] Specifically, the search function includes a find function.

[0181] In the above step S5, when judging the coding quality of the coding transformer, it includes:

[0182] Perform template matching based on the height and width of the string to obtain the corresponding coding template;

[0183] Retrieve the corresponding text area position information and character comparison table according to the coding template;

[0184] Compare the retrieved text area position information with the detected text area position information, and compare the character images in the character array set with the character comparison table one by one in order;

[0185] When both the position comparison and the character comparison are passed, the coding quality of the coding transformer is considered to be qualified.

[0186] Specifically, the present invention includes the correctness of the characters themselves, the correctness of the character sizes, the correctness of the character order, and the correctness of the text area position when judging the coding quality, thereby greatly improving the sorting accuracy while ensuring the sorting efficiency.

[0187] The automatic transformer laser coding system based on visual positioning provided by the present invention comprises: a coding data generating unit, a coding unit, a text detecting unit, and a coding quality judging unit.

[0188] Coding data generation unit: used to obtain the production parameters of the transformer and automatically generate transformer coding data according to preset rules.

[0189] Coding unit: used to perform laser coding on the transformer based on visual positioning when reaching the coding area to obtain a coded transformer.

[0190] Text detection unit: used to collect images of the coding transformer when arriving at the quality inspection area, obtain the coding transformer image, and perform preprocessing and text detection to obtain the text area and its location information.

[0191] Coding quality judgment unit: used to identify the text in the text area, obtain the corresponding text string, judge the coding quality according to the text string and the text area position information, and remove unqualified coding transformers;

[0192] When laser coding is performed, the steps include: collecting and preprocessing the image of the transformer on the coding area to obtain a grayscale image of the transformer, and performing segmentation and edge detection to obtain the outer contour edge features of the transformer;

[0193] When performing segmentation, the method includes: dividing the transformer grayscale image into the first and second sub-blocks, and obtaining the grayscale value variance of the first and second sub-blocks; determining the first and second category intervals, and obtaining the pixel points located in the first and second category intervals in each sub-block, marking them as the first and second category pixel points respectively, and defining the background pixel points in the first and second category pixel points; defining each sub-block as a foreground block or a background block according to the grayscale value variance and the background pixel points, and performing smoothing to obtain the segmented transformer image.

[0194] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A transformer automatic laser coding method based on visual positioning, characterized in that: The following steps are involved: Obtain the production parameters of the transformer and automatically generate transformer coding data according to preset rules; When the transformer reaches the coding area, laser coding is performed on the transformer based on visual positioning to obtain a coding transformer; When arriving at the quality inspection area, the coding transformer is imaged to obtain a coding transformer image, and preprocessed and text detected to obtain the text area and its position information; Identify the text in the text area to obtain the corresponding text string, judge the coding quality according to the text string and the text area position information, and remove unqualified coding transformers; Wherein, when laser coding is performed, it includes: performing image acquisition and preprocessing on the transformer on the coding area to obtain a grayscale image of the transformer, and performing segmentation and edge detection to obtain the outer contour edge features of the transformer; When performing segmentation, the method includes: dividing the transformer grayscale image into the first and second sub-blocks, and obtaining the grayscale value variance of the first and second sub-blocks; determining the first and second category intervals, and obtaining the pixel points located in the first and second category intervals in each sub-block, marking them as the first and second category pixel points respectively, and defining the background pixel points in the first and second category pixel points; defining each sub-block as a foreground block or a background block according to the grayscale value variance and the background pixel points, and performing smoothing to obtain the segmented transformer image; When laser coding is performed, it also includes: Identify the transformer, extract the corresponding template image, locate the transformer based on the outer contour edge feature and the template image, obtain positioning information, and adjust the initial coding position according to the positioning information; When obtaining the gray value variance of the first and second sub-blocks, it includes: Get the grayscale average of the first sub-block and the second sub-block, as shown in Formula 1: (1); In the formula, , is the length and width of the sub-block, is the grayscale value of the first sub-block or the second sub-block, is the grayscale average value of the first sub-block or the second sub-block; According to the grayscale average value, the grayscale value variance of the first sub-block and the second sub-block is obtained, as shown in Formula 2: (2); In the formula, Pixel The grayscale level, is the gray value variance; When marking the first and second types of pixels, it includes: Obtain the central grayscale of the first-class line and the second-class line in the transformer grayscale image, and determine the first-class interval and the second-class interval according to the central grayscale; Pixel points in each sub-block that are located in the first category interval are obtained and marked as first category pixel points, and pixel points in each sub-block that are located in the second category interval are obtained and marked as second category pixel points.

2. The automatic laser coding method for transformers based on visual positioning according to claim 1 is characterized in that: When performing edge detection, it includes: Perform wavelet decomposition on the segmented transformer image to obtain a low-frequency transformer sub-image and a high-frequency transformer sub-image; Performing edge detection on the low-frequency transformer sub-image based on optimized morphology to obtain the edge of the low-frequency transformer sub-image; Among them, when edge detection is performed based on optimized morphology, it includes: Based on the structural element, negative noise is suppressed by closing operation, positive noise is suppressed by opening operation, and edge information is extracted by using the difference between dilation operation and erosion operation.

3. The automatic laser coding method for transformers based on visual positioning according to claim 2 is characterized in that: When performing edge detection, it also includes: Performing edge detection on the high-frequency transformer sub-image based on the wavelet modulus maximum, and performing fast binary wavelet transform to obtain the edge of the high-frequency transformer sub-image; The edge of the low-frequency transformer sub-image and the edge of the high-frequency transformer sub-image are fused through inverse wavelet transform to obtain a transformer image with clear edges.

4. The automatic laser coding method for transformers based on visual positioning according to any one of claims 1 to 3, characterized in that: When obtaining the positioning information of the transformer, it includes: obtaining the position information and obtaining the angle information; The acquisition of the position information includes: obtaining the minimum circumscribed rectangle of the transformer according to the outer contour edge features, and obtaining the coordinates of the center point as the position information of the transformer; The angle information acquisition includes: acquiring the direction vectors of the transformer grayscale image and the template image, and obtaining the angle between the transformer grayscale image and the template image according to the direction vector as the angle information of the transformer.

5. The automatic laser coding method for transformers based on visual positioning according to claim 4 is characterized in that: When performing preprocessing and text detection, it includes: Bilateral filtering is used to highlight the edges of text areas and suppress noise; The visual saliency model is used to extract the salient regions of the image at different scales, and weighted average is performed to obtain the final saliency map containing the final salient regions. An initial region whose edge density is greater than a threshold and is regular in the final salient region is obtained, morphological processing is performed, a connected domain is constructed, a candidate region is obtained, and a connected domain analysis is performed to obtain a text region and its position information.

6. The automatic laser coding method for transformers based on visual positioning according to claim 5 is characterized in that: When the corresponding text string is obtained, it includes: Performing expansion processing on the text area, using a search function to obtain column information and row information of characters, and obtaining the boundary of each character; The height and width of the character string are obtained according to the boundaries of each character, the text area is segmented to obtain a plurality of first character images, and pixel expansion is performed to obtain a plurality of second character images; The plurality of second character images are stored in an array one by one in order to obtain a character array set.

7. The automatic laser coding method for transformers based on visual positioning according to claim 6 is characterized in that: When judging the quality of coding, include: Performing template matching according to the height and width of the character string, and retrieving corresponding text area position information and character comparison table; Compare the retrieved text area position information with the detected text area position information, and compare the character images in the character array set with the character comparison table one by one in order; When both the position comparison and the character comparison are passed, the coding quality is considered qualified.

8. A transformer automatic laser coding system based on visual positioning, characterized in that: include: Coding data generation unit: used to obtain the production parameters of the transformer and automatically generate transformer coding data according to preset rules; Coding unit: used for laser coding the transformer based on visual positioning when reaching the coding area to obtain a coded transformer; Text detection unit: used to collect images of the coding transformer when it arrives at the quality inspection area, obtain the coding transformer image, and perform preprocessing and text detection to obtain the text area and its position information; A coding quality judgment unit: used to identify the text in the text area, obtain the corresponding text string, judge the coding quality according to the text string and the text area position information, and remove unqualified coding transformers; Wherein, when laser coding is performed, it includes: performing image acquisition and preprocessing on the transformer on the coding area to obtain a grayscale image of the transformer, and performing segmentation and edge detection to obtain the outer contour edge features of the transformer; When performing segmentation, the method includes: dividing the transformer grayscale image into the first and second sub-blocks, and obtaining the grayscale value variance of the first and second sub-blocks; determining the first and second category intervals, and obtaining the pixel points located in the first and second category intervals in each sub-block, marking them as the first and second category pixel points respectively, and defining the background pixel points in the first and second category pixel points; defining each sub-block as a foreground block or a background block according to the grayscale value variance and the background pixel points, and performing smoothing to obtain the segmented transformer image; When laser coding is performed, it also includes: Identify the transformer, extract the corresponding template image, locate the transformer based on the outer contour edge feature and the template image, obtain positioning information, and adjust the initial coding position according to the positioning information; When obtaining the gray value variance of the first and second sub-blocks, it includes: Get the grayscale average of the first sub-block and the second sub-block, as shown in Formula 1: (1); In the formula, , is the length and width of the sub-block, is the grayscale value of the first sub-block or the second sub-block, is the grayscale average value of the first sub-block or the second sub-block; According to the grayscale average value, the grayscale value variance of the first sub-block and the second sub-block is obtained, as shown in Formula 2: (2); In the formula, Pixel The grayscale level, is the gray value variance; When marking the first and second types of pixels, it includes: Obtain the central grayscale of the first-class line and the second-class line in the transformer grayscale image, and determine the first-class interval and the second-class interval according to the central grayscale; Pixel points in each sub-block that are located in the first category interval are obtained and marked as first category pixel points, and pixel points in each sub-block that are located in the second category interval are obtained and marked as second category pixel points.

Citation Information

Patent Citations

  • Image segmentation method and device for cervical exfoliated cell image

    CN109064475A

  • Coding auxiliary positioning detection equipment and method based on visual processing

    CN116198235A