CN113421265A - Generation method and generation device for circuit board cutting path and board separator - Google Patents

Generation method and generation device for circuit board cutting path and board separator Download PDF

Info

Publication number
CN113421265A
CN113421265A CN202110978136.XA CN202110978136A CN113421265A CN 113421265 A CN113421265 A CN 113421265A CN 202110978136 A CN202110978136 A CN 202110978136A CN 113421265 A CN113421265 A CN 113421265A
Authority
CN
China
Prior art keywords
cutting
cut
target
image
boundary line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110978136.XA
Other languages
Chinese (zh)
Other versions
CN113421265B (en
Inventor
管凌乾
钱建轩
刘朋飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Vega Technology Co Ltd
Original Assignee
Suzhou Vega Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Vega Technology Co Ltd filed Critical Suzhou Vega Technology Co Ltd
Priority to CN202110978136.XA priority Critical patent/CN113421265B/en
Publication of CN113421265A publication Critical patent/CN113421265A/en
Application granted granted Critical
Publication of CN113421265B publication Critical patent/CN113421265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Abstract

The invention discloses a method and a device for generating a circuit board cutting path and a board separator, wherein the method comprises the following steps: acquiring a finished product circuit board image, and determining position information of a target to be cut of the finished product circuit board image, wherein the position information of the target to be cut comprises a central point and a main shaft angle; extracting an interesting area of the target to be cut according to the position information of the target to be cut; carrying out image processing on the region of interest of the target to be cut so as to obtain a gradient image; determining a cutting boundary line according to the gradient image, and generating a cutting path according to the cutting boundary line, wherein the cutter stroke and the cutter radius of the cutting cutter are obtained; determining key point coordinates on a cutting boundary line according to the central point of the target to be cut, the spindle angle and the cutter stroke; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the radius of the cutter; and generating a cutting path according to the cutting point coordinates, so that the cutting path can be automatically generated, and the cutting efficiency and precision are improved.

Description

Generation method and generation device for circuit board cutting path and board separator
Technical Field
The present invention relates to the technical field of board dividers, and in particular, to a method and an apparatus for generating a cutting path of a circuit board, a board divider, and a computer-readable storage medium.
Background
The Board dividing machine needs to manually make a Board dividing program before cutting a Board of a Printed Circuit Board Assembly (PCBA). The operator needs to control the camera to move over each cutting target to capture an image of the cutting target of the knife and to manually generate a cutting path for each cutting target. Because a PCBA board which is not cut generally contains hundreds of targets to be cut, operators need to make cutting paths one by one, the workload is large, the requirement on the professional quality of the operators is high, the cutting precision cannot be guaranteed, and the production efficiency is seriously influenced.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. Therefore, a first object of the present invention is to provide a method for generating a cutting path of a circuit board, which extracts an interesting region of a target to be cut according to position information of the target to be cut, processes an image to obtain a cutting boundary line of the processed image, and can automatically generate the cutting path according to the cutting boundary line, thereby improving cutting efficiency and precision.
The second purpose of the invention is to provide a generating device of the circuit board cutting path.
The third purpose of the invention is to provide a plate separator.
A fourth object of the invention is to propose a computer-readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for generating a cutting path of a circuit board, including: acquiring a finished product circuit board image, and determining position information of a target to be cut of the finished product circuit board image, wherein the position information of the target to be cut comprises a central point and a main shaft angle; extracting an interested area of the cut target according to the position information of the target to be cut; carrying out image processing on the region of interest of the target to be cut so as to obtain a gradient image; determining a cutting boundary line according to the gradient image, and generating a cutting path according to the cutting boundary line, wherein the cutting path is generated according to the cutting boundary line, and the method comprises the following steps: acquiring the cutter stroke and the cutter radius of a cutting cutter; determining the coordinates of key points on the cutting boundary line according to the central point of the target to be cut, the angle of the main shaft and the stroke of the cutter; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the cutter radius; and generating the cutting path according to the cutting point coordinates.
According to the method for generating the circuit board cutting path, the finished product circuit board image is obtained, the position information of the target to be cut of the finished product circuit board image is determined, the region of interest of the target to be cut is extracted according to the position information of the target to be cut, image processing is carried out on the region of interest of the target to be cut so as to obtain a gradient image, the cutting boundary line is determined according to the gradient image, and the cutting path is generated according to the cutting boundary line. Therefore, the method can automatically generate the cutting path, and improves the cutting efficiency and precision.
The method for generating the circuit board cutting path according to the above embodiment of the present invention may further have the following additional technical features:
according to an embodiment of the present invention, determining the position information of the target to be cut of the finished circuit board image includes: and acquiring a template image, and positioning the position information of the target to be cut from the finished product circuit board image by adopting a template matching algorithm according to the template image.
According to an embodiment of the present invention, the positioning the position information of the target to be cut from the finished circuit board image by using a template matching algorithm includes: acquiring a central point and an angle offset of the target to be cut by adopting a template matching algorithm based on shape characteristics; performing image processing on the template image to obtain a main shaft angle of the template image; and determining the main shaft angle of the target to be cut according to the offset of the target to be cut and the main shaft angle of the template image.
According to an embodiment of the present invention, the determining the main axis angle of the target to be cut by the offset of the target to be cut and the main axis angle of the template image includes: and taking the sum of the offset of the target to be cut and the main shaft angle of the template image as the main shaft angle of the target to be cut.
According to an embodiment of the present invention, the cutting boundary line includes a horizontal cutting boundary line and a vertical cutting boundary line, wherein determining the cutting boundary line according to the gradient image includes: when the angle of the main shaft of the target to be cut is smaller than a first preset angle threshold value, processing the gradient image by adopting a first edge search algorithm to obtain the horizontal cutting boundary line; and when the angle of the main shaft of the target to be cut is greater than or equal to the first preset angle threshold value, processing the gradient image by adopting a second edge search algorithm to obtain the vertical cutting boundary line.
According to one embodiment of the invention, the gradient image is processed by a first edge search algorithm, comprising: when the horizontal edge search is carried out on the gradient image, the gradient value of each column is detected in sequence; and when the gradient value is determined to be larger than a first gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the horizontal cutting boundary line.
According to one embodiment of the invention, processing the gradient image using a second edge search algorithm comprises: when vertical edge searching is carried out on the gradient image, the gradient value of each row is detected in sequence;
and when the gradient value is determined to be larger than a second gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the vertical cutting boundary line.
According to an embodiment of the present invention, the processing the gradient image by using the first edge search algorithm further includes: and stopping horizontal edge search when the number of the edge points of the horizontal cutting boundary line is determined to be larger than a first preset value.
According to an embodiment of the present invention, the processing the gradient image by using the second edge search algorithm further includes: and stopping the vertical edge search when the number of the edge points of the vertical cutting boundary line is determined to be larger than a second preset value.
According to an embodiment of the present invention, the determining the coordinates of the cutting point according to the coordinates of the key point on the cutting boundary line and the radius of the cutter, wherein the determining the coordinates of the cutting point includes: acquiring the groove width of the target to be cut; when the groove width of the target to be cut is smaller than the diameter of the cutter, acquiring a midpoint coordinate according to the coordinates of key points on the cutting boundary line to determine a cutting point coordinate; and generating the cutting path according to the cutting point coordinates.
According to one embodiment of the invention, when the groove width of the target to be cut is greater than or equal to the diameter of the cutter, translating the distance of the radius of the cutter in the direction away from the cutting boundary line according to the coordinates of the key points on the cutting boundary line to determine the coordinates of the cutting points; and generating the cutting path according to the cutting point coordinates.
According to an embodiment of the present invention, the image processing of the region of interest of the target to be cut includes: and filtering the region of interest by adopting a Sobel operator to obtain the gradient image.
In order to achieve the above object, an embodiment of a second aspect of the present invention provides an apparatus for generating a cutting path of a circuit board, including: the image acquisition module is used for acquiring finished circuit board images; the determining module is used for determining the position information of a target to be cut of the finished product circuit board image, wherein the position information of the target to be cut comprises a central point and a main shaft angle; the image processing module is used for extracting the region of interest of the target to be cut according to the position information of the target to be cut and carrying out image processing on the region of interest of the target to be cut so as to obtain a gradient image; a generating module, configured to determine a cutting boundary line according to the gradient image, and generate a cutting path according to the cutting boundary line, where the generating module generates the cutting path according to the cutting boundary line, and is specifically configured to: acquiring the cutter stroke and the cutter radius of a cutting cutter; determining key point coordinates on a cutting boundary line according to the central point of the target to be cut, the spindle angle and the cutter stroke; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the radius of the cutter; and generating a cutting path according to the cutting point coordinates.
According to the circuit board cutting path generation device provided by the embodiment of the invention, the finished circuit board image is obtained through the image acquisition module, the position information of the target to be cut of the finished circuit board image is determined through the determination module, the region of interest of the target to be cut is extracted through the image processing module according to the position information of the target to be cut, the region of interest of the target to be cut is subjected to image processing to obtain the gradient image, the generation module determines the cutting boundary line according to the gradient image, and the cutting path is generated according to the cutting boundary line. Therefore, the device can automatically generate a cutting path, and the cutting efficiency and precision are improved.
In order to achieve the above object, a third aspect of the present invention provides a plate separator, including: the circuit board cutting path generation method comprises a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to realize the circuit board cutting path generation method.
According to the board separator provided by the embodiment of the invention, the cutting path can be automatically generated by executing the method for generating the circuit board cutting path, so that the cutting efficiency and precision are improved.
In order to achieve the above object, a computer-readable storage medium according to a fourth aspect of the present invention is a computer-readable storage medium, on which a program for generating a cutting path of a circuit board is stored, and the program for generating a cutting path of a circuit board realizes the above method for generating a cutting path of a circuit board when executed by a processor.
According to the computer-readable storage medium provided by the embodiment of the invention, the cutting path can be automatically generated by executing the generation method of the circuit board cutting path, so that the cutting efficiency and precision are improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
Fig. 1 is a flowchart of a method for generating a cutting path of a circuit board according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a finished circuit board image according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a template image according to one embodiment of the invention;
FIG. 4 is a schematic view of a region of interest of an object to be cut, according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of a gradient image according to one embodiment of the present invention;
FIG. 6 is a schematic diagram of the convolution kernel of the Sobel operator according to one embodiment of the invention;
FIG. 7 is a schematic view of an image of a target to be cut according to one embodiment of the present invention;
FIG. 8 is a schematic view of a horizontal cutting boundary line of an object to be cut according to one embodiment of the present invention;
FIG. 9 is a schematic view of a vertical cutting boundary line of an object to be cut according to one embodiment of the present invention;
FIG. 10 is a schematic view of cutting point coordinates of an object to be cut according to one embodiment of the present invention;
FIG. 11 is a schematic view of cutting point coordinates of an object to be cut according to another embodiment of the present invention;
FIG. 12 is a block diagram of an apparatus for generating a cutting path of a circuit board according to an embodiment of the present invention;
fig. 13 is a block diagram of a board separator according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
A method for generating a circuit board cutting path, an apparatus for generating a circuit board cutting path, a board separator, and a computer-readable storage medium according to an embodiment of the present invention will be described below with reference to the drawings.
Fig. 1 is a flowchart of a method for generating a cutting path of a circuit board according to an embodiment of the invention;
as shown in fig. 1, the method for generating a circuit board cutting path according to an embodiment of the present invention may include the following steps:
and S1, acquiring the finished product circuit board image, and determining the position information of the target to be cut of the finished product circuit board image. Under the backlight source condition, an area-array camera can be used for collecting images of the whole finished product circuit board, under the condition that the finished product circuit board is large, a plurality of shooting points are preset according to the shooting range of the area-array camera, in the shooting process, the area-array camera is controlled to move to the fixed shooting points for shooting, and the shot images are spliced into a complete finished product circuit board image, for example, as shown in fig. 2.
According to one embodiment of the invention, the determining the position information of the target to be cut of the finished circuit board image comprises the following steps: acquiring a template image; and positioning the position information of the target to be cut from the finished product circuit board image by adopting a template matching algorithm according to the template image.
Further, according to an embodiment of the present invention, the position information of the target to be cut may include a central point and a spindle angle, wherein the positioning the position information of the target to be cut from the finished circuit board image by using a template matching algorithm includes: acquiring a central point and an angle offset of a target to be cut by adopting a template matching algorithm based on shape characteristics; performing image processing on the template image to obtain a main shaft angle of the template image; and determining the main shaft angle of the target to be cut according to the offset of the target to be cut and the main shaft angle of the template image.
According to one embodiment of the invention, the principal axis angle of the target to be cut is the sum of the offset of the target to be cut and the principal axis angle of the template image.
Specifically, according to actual requirements, a target to be cut of a finished product circuit board image, namely a template image, is obtained, a grayscale binarization processing is performed on the template image, an angle of a main axis of the template image is an included angle between a minimum circumscribed rectangle (having an angle) of a bright region and an x axis, the included angle is in a range of [ -pi/2, pi/2 ], for example, as shown in fig. 3, the main axis of the template image in the figure is perpendicular to the x axis, and the main axis angle of the template image is 90 °. According to the template image and the finished product circuit board image, the center points and the angle offset of all targets to be cut matched with the template image are searched in the finished product circuit board image by utilizing a template matching algorithm of shape characteristics, wherein the angle offset of the targets to be cut refers to the offset of the main shaft angle relative to the template image, namely the main shaft angle of the targets to be cut is the sum of the angle offset of the targets to be cut and the main shaft angle of the template image.
It should be noted that the template image shown in fig. 3 is only one specific example of the present invention, and the template image may also be arranged in a horizontal direction, i.e., the angle between the main axis of the template image and the x-axis (main axis angle) is 0 °. The template image may also be arranged obliquely, i.e. the angle between the principal axis of the template image and the x-axis (principal axis angle) is (-pi/2, 0) or (0, pi/2), which is not limited herein.
And S2, extracting the region of interest of the target to be cut according to the position information of the target to be cut. In step S1, the central point and the spindle angle of the target to be cut can be obtained, and then the region of interest of the target to be cut can be extracted by using a corresponding algorithm according to the central point and the spindle angle of the target to be cut, as a focus of image analysis, for example, as shown in fig. 4.
And S3, performing image processing on the region of interest of the object to be cut to obtain a gradient image.
According to one embodiment of the invention, the image processing of the region of interest of the object to be cut comprises: and filtering the region of interest by using a Sobel operator to obtain a gradient image.
Specifically, after the region of interest of the target to be cut is extracted through step S2, the region of interest is also subjected to image processing to obtain a gradient image, as shown in fig. 5, for example, a sobel operator may be used to perform filtering processing to obtain a gradient image. Specifically, the principle of the sobel operator: convolution is performed on pixels in the region of interest, the essence of the convolution is to find gradient values, or to give a weighted average, wherein the weight is a so-called convolution kernel (Gx shown in fig. 6 is convolution on the x-axis direction of the region of interest, Gy is convolution on the y-axis direction), then threshold operation is performed on the gray value of the generated new pixel to determine edge information, and finally a gradient image of the region of interest is obtained.
And S4, determining a cutting boundary line according to the gradient image, and generating a cutting path according to the cutting boundary line.
According to one embodiment of the invention, the cutting boundary line can comprise a horizontal cutting boundary line and a vertical cutting boundary line, wherein when the angle of the main shaft of the target to be cut is smaller than a first preset angle threshold value, a first edge search algorithm is adopted to process the gradient image to obtain the horizontal cutting boundary line; and when the angle of the main shaft of the cutting target is greater than or equal to the first preset angle threshold value, processing the gradient image by adopting a second edge search algorithm to obtain a vertical cutting boundary line. The first preset angle threshold may be calibrated according to actual conditions, for example, the first preset angle threshold may be 45 °.
In other words, taking the target to be cut shown in fig. 7 as an example, the central point of the target to be cut and the main axis angle θ of the target to be cut can be obtained through the above steps. Judging whether the angle of the main shaft of the target to be cut is larger than 45 degrees or not, wherein when theta is larger than 45 degrees, the gradient image is rotated anticlockwise to obtain a gradient image with the main shaft angle of 90 degrees; when theta is less than 45 degrees, clockwise rotating the gradient image to obtain a gradient image with the angle perpendicular to the main shaft being 0 degree; when θ is 45 °, both clockwise rotation and counterclockwise rotation are possible. And then processing the rotated gradient image by adopting a corresponding edge searching algorithm to obtain a cutting boundary line.
How to obtain the cutting boundary line is described in detail below.
According to one embodiment of the invention, the gradient image is processed by adopting a first edge search algorithm, which comprises the following steps: when the horizontal edge search is carried out on the gradient image, the gradient value of each column is detected in sequence; and when the gradient value is determined to be larger than the first gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the horizontal cutting boundary line. The first gradient threshold value can be calibrated according to actual conditions.
Further, according to an embodiment of the present invention, the processing the gradient image by using the first edge search algorithm further includes: and stopping the horizontal edge search when the number of the edge points of the horizontal cutting boundary line is determined to be larger than a first preset value. The first preset value may be calibrated according to actual conditions, for example, the first preset value may be 100.
Specifically, still taking the image of the target to be cut shown in fig. 7 as an example, assuming that the main axis angle θ in fig. 7 is less than 45 °, the region of interest of the target to be cut is rotated clockwise to the position shown in fig. 8, and the horizontal cutting boundary line of the gradient image is searched by using the first edge search algorithm. Assuming that the width of the region of interest is w and the height is h, when searching for the upper left horizontal edge L1, x is changed from 0 to w/2 in an increasing manner, y is changed from the ordinate (h/2) of the main axis coordinate to 0 in a decreasing manner, the gradient value of the gradient image is searched, when the gradient value is larger than the first gradient threshold value, the coordinate corresponding to the gradient value is taken as the edge point of L1 and stored, and counting is started, the search of the column is stopped, the search of the next column is continued, and similarly, when the gradient value is larger than the first gradient threshold value when searching the next column, the coordinate corresponding to the gradient value is taken as the edge point of L1 and stored, when the counter is increased by 1, the search of the column is stopped, the search of the next column is performed, and thus the search is performed column by column until the value of the counter (the number of the edge points) is larger than the first preset value (such as 100), the search for the L1 horizontal cut edge line was stopped. The horizontal edges L2, L3 and L4 are searched in the same way, and are not described in detail here.
When the horizontal cutting edge line search is performed in the same coordinate system, x is decreased from w to w/2 and y is decreased from the ordinate (h/2) to the main axis coordinate to 0 when the L2 horizontal cutting edge line is searched; when searching for the L3 horizontal cutting edge line, x is changed from 0 to w/2 in an increasing way, and y is changed from the ordinate (h/2) of the main axis coordinate to h in an increasing way; when searching for the L4 horizontal cutting edge line, x is changed from w to w/2 in a decreasing manner, and y is changed from the ordinate (h/2) of the principal axis coordinate to h in an increasing and decreasing manner.
According to another embodiment of the present invention, processing the gradient image using a second edge search algorithm includes: when vertical edge searching is carried out on the gradient image, the gradient value of each line is detected in sequence; and when the gradient value is determined to be larger than the second gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the vertical cutting boundary line. And the second gradient threshold value can be calibrated according to the actual situation.
Further, according to an embodiment of the present invention, the processing the gradient image by using a second edge search algorithm further includes: and stopping the vertical edge search when the number of the edge points of the vertical cutting boundary line is determined to be larger than a second preset value. The second preset threshold may be calibrated according to actual conditions, for example, the second preset threshold may be 100.
Specifically, still taking the image of the target to be cut shown in fig. 7 as an example, assuming that the main axis angle θ in fig. 7 is greater than 45 °, the region of interest of the target to be cut is rotated counterclockwise to the position shown in fig. 9, and the vertical cutting edge line of the gradient image is searched by using the second edge search algorithm. Assuming that the width of the region of interest is w ', the height is h', when searching for the upper left vertical edge L1, y varies incrementally from 0 to h '/2 and x varies incrementally from w'/2 to 0, searching for gradient values of the gradient image, when the gradient value is larger than the second gradient threshold value, the coordinate corresponding to the gradient value is taken as the edge point of L1', and stores it, starts counting, stops searching for this line, continues searching for the next line, and similarly, when the searched gradient value is larger than the second gradient threshold value when searching the next row, the coordinate corresponding to the gradient value is taken as the edge point of L1', and stored, at this time, the counter is increased by 1, the search of the line is stopped, the search of the next line is performed, the search is performed line by line until the value of the counter (the number of the edge points) is greater than a second preset value (for example, 100), and the search of the L1' vertical cutting edge line is stopped. The search modes of the vertical cutting edge lines L2 ', L3 ' and L4 ' are the same, and are not described in detail herein.
It should be noted that when the vertical cutting edge line search is performed in the same coordinate system, y is changed from 0 to h '/2 and x is changed from w'/2 to w 'in an increasing manner when the vertical cutting edge line of L2' is searched; when the L3 'vertical cutting edge line is searched, y is changed from h' to h '/2 in a decreasing mode, and x is changed from w'/2 to 0 in a decreasing mode; when searching for the L4 ' perpendicular cutting edge line, y varies progressively from h ' to h '/2, and x varies progressively from w '/2 to w '.
According to one embodiment of the invention, the cutting boundary line generates a cutting path comprising: acquiring the cutter stroke and the cutter radius of a cutting cutter; determining key point coordinates on a cutting boundary line according to the central point of the target to be cut, the spindle angle and the cutter stroke; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the radius of the cutter; and generating a cutting path according to the cutting point coordinates.
According to one embodiment of the invention, the template image is a U-shaped image, and the coordinates of the cutting point are determined according to the coordinates of the key point on the cutting boundary line and the radius of the cutter, and the method comprises the following steps: acquiring the groove width of a target to be cut; when the groove width of the cut target is smaller than the diameter of the cutter, acquiring a midpoint coordinate according to a key point coordinate on a cutting boundary line to determine a cutting point coordinate; and generating a cutting path according to the cutting point coordinates.
According to one embodiment of the invention, when the groove width of the target to be cut is larger than or equal to the diameter of the cutter, the distance of the radius of the cutter is translated to the direction far away from the cutting boundary line according to the coordinates of key points on the cutting boundary line so as to determine the coordinates of the cutting points; and generating a cutting path according to the cutting point coordinates.
Specifically, the template image is a U-shaped image, and the vertical cutting boundary line shown in fig. 10 is taken as an example for explanation. Firstly, the groove width w' of a target to be cut is obtained, then different cutters have different running strokes and radiuses, the stroke d and the radius r of the working cutter are obtained, and the main shaft of the target to be cut is obtained according to the central point (x0, y0) and the angle of the main shaft and is recorded as L. And (3) making a passing point (x0, y0) as a vertical line L 'of L, and translating L' upwards and downwards by half of the travel d of the cutter to obtain 2 straight lines Lm and Ln, wherein the intersection points of the Lm and the upper half part of the target to be cut are P1 and P2 respectively, the intersection points of the Ln and the lower half part of the target to be cut are P3 and P4 respectively, and P1, P2, P3 and P4 are key point coordinates on the boundary line of the cutting edge. And then determining whether the cutting path is a 'U-shaped' cutting path or a '1-shaped' cutting path according to the groove width w 'of the target to be cut and the diameter of a cutter (the diameter of the cutter =2 × r), wherein when the groove width w' of the target to be cut is greater than or equal to the diameter of the cutter, the 'U-shaped' cutting path is determined to be adopted. At this time, the four key points are translated by a certain angle (horizontally moved in a direction away from the key points), and the translated distance is the tool radius r. Cutting point coordinates are obtained and are respectively marked as Pt0, Pt1, Pt2 and Pt3, cutting paths corresponding to targets to be cut are formed by the Pt0, the Pt1, the Pt2 and the Pt3, and the cutting paths of the whole circuit board can be obtained by sequentially operating each target to be cut as above. When the groove width w ' of the target to be cut is smaller than the diameter d of the cutter, determining to adopt a 1-type cutting path, as shown in fig. 11, acquiring midpoint coordinates Pt0 ' of key points P1 and P2, acquiring midpoint coordinates Pt1 ' of key points P3 and P4, taking Pt0 ' and Pt1 ' as cutting point coordinates, forming a cutting path corresponding to the target to be cut by Pt0 ' and Pt1 ', and sequentially operating each target to be cut as above to obtain the cutting path of the whole circuit board.
In summary, according to the method for generating a circuit board cutting path of the embodiment of the present invention, the finished circuit board image is obtained, the position information of the target to be cut of the finished circuit board image is determined, the region of interest of the target to be cut is extracted according to the position information of the target to be cut, image processing is performed on the region of interest of the target to be cut to obtain a gradient image, the cutting boundary line is determined according to the gradient image, and the cutting path is generated according to the cutting boundary line. Therefore, the method can automatically generate the cutting path, improve the cutting efficiency and precision, and improve the cutting efficiency compared with the traditional method for manufacturing the cutting program data.
Corresponding to the embodiment, the invention further provides a generating device of the circuit board cutting path.
As shown in fig. 11, the device for generating a circuit board cutting path according to an embodiment of the present invention includes: an image acquisition module 10, a determination module 20, an image processing module 30 and a generation module 40.
The image acquisition module 10 is used for acquiring an image of the finished circuit board. The determining module 20 is configured to determine position information of a target to be cut of the finished product circuit board image, where the position information of the target to be cut includes a central point and a spindle angle. The image processing module 30 is configured to extract an interesting region of the target to be cut according to the position information of the target to be cut, and perform image processing on the interesting region of the target to be cut to obtain a gradient image. The generating module 40 is configured to determine a cutting boundary line according to the gradient image, and generate a cutting path according to the cutting boundary line, where the generating module 40 generates the cutting path according to the cutting boundary line, and specifically is configured to: acquiring the cutter stroke and the cutter radius of a cutting cutter; determining key point coordinates on a cutting boundary line according to the central point of the target to be cut, the spindle angle and the cutter stroke; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the radius of the cutter; and generating a cutting path according to the cutting point coordinates.
According to an embodiment of the present invention, the determining module 20 determines the position information of the target to be cut of the finished circuit board image, and is specifically configured to: acquiring a template image; and positioning the position information of the target to be cut from the finished product circuit board image by adopting a template matching algorithm according to the template image.
According to an embodiment of the present invention, the determining module 20 uses a template matching algorithm to locate the position information of the target to be cut from the finished circuit board image, and is specifically configured to: acquiring a central point and an angle offset of a target to be cut by adopting a template matching algorithm based on shape characteristics; performing image processing on the template image to obtain a main shaft angle of the template image; and determining the main shaft angle of the target to be cut according to the offset of the target to be cut and the main shaft angle of the template image.
According to an embodiment of the present invention, the determining module 20 determines the main axis angle of the target to be cut according to the offset of the target to be cut and the main axis angle of the template image, and is specifically configured to: and taking the sum of the offset of the target to be cut and the main shaft angle of the template image as the main shaft angle of the target to be cut.
According to an embodiment of the invention, the cutting boundary lines comprise a horizontal cutting boundary line and a vertical cutting boundary line, wherein the generating module 40 determines the cutting boundary lines from the gradient image, in particular for: when the angle of the main shaft of the target to be cut is smaller than a first preset angle threshold value, processing the gradient image by adopting a first edge search algorithm to obtain a horizontal cutting boundary line; and when the angle of the main shaft of the target to be cut is greater than or equal to the first preset angle threshold value, processing the gradient image by adopting a second edge search algorithm to obtain a vertical cutting boundary line.
According to an embodiment of the present invention, the generating module 40 processes the gradient image by using a first edge search algorithm, specifically to: when the horizontal edge search is carried out on the gradient image, the gradient value of each column is detected in sequence; and when the gradient value is determined to be larger than the first gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the horizontal cutting boundary line.
According to an embodiment of the present invention, the generating module 40 processes the gradient image by using a second edge search algorithm, specifically, to: when vertical edge searching is carried out on the gradient image, the gradient value of each line is detected in sequence; and when the gradient value is determined to be larger than the second gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the vertical cutting boundary line.
According to an embodiment of the present invention, the generating module 40 processes the gradient image using a first edge search algorithm, and is further configured to: and stopping the horizontal edge search when the number of the edge points of the horizontal cutting boundary line is determined to be larger than a first preset value.
According to an embodiment of the present invention, the generating module 40 processes the gradient image by using a second edge search algorithm, and is further configured to: and stopping the vertical edge search when the number of the edge points of the vertical cutting boundary line is determined to be larger than a second preset value.
According to an embodiment of the present invention, the template image is a U-shaped image, and the generating module 40 determines the coordinates of the cutting point according to the coordinates of the key point on the cutting boundary line and the radius of the cutting tool, and is specifically configured to: acquiring the groove width of a target to be cut; when the groove width of the target to be cut is smaller than the diameter of the cutter, acquiring a midpoint coordinate according to the coordinates of key points on the cutting boundary line to determine a cutting point coordinate; and generating a cutting path according to the cutting point coordinates.
According to an embodiment of the present invention, the generating module 40 is further configured to, when the groove width of the target to be cut is greater than or equal to the diameter of the tool, translate the distance of the radius of the tool in a direction away from the cutting boundary line according to the coordinates of the key points on the cutting boundary line to determine the coordinates of the cutting point; and generating a cutting path according to the cutting point coordinates.
According to an embodiment of the present invention, the image processing module 30 performs image processing on the region of interest of the target to be cut, specifically, is configured to: and filtering the region of interest by using a Sobel operator to obtain a gradient image.
It should be noted that, for details not disclosed in the device for generating a circuit board cutting path according to the embodiment of the present invention, please refer to details disclosed in the method for generating a circuit board cutting path according to the embodiment of the present invention, and detailed descriptions thereof are omitted here.
According to the circuit board cutting path generation device provided by the embodiment of the invention, the finished circuit board image is obtained through the image acquisition module, the position information of the target to be cut of the finished circuit board image is determined through the determination module, the region of interest of the target to be cut is extracted through the image processing module according to the position information of the target to be cut, the region of interest of the target to be cut is subjected to image processing to obtain the gradient image, the generation module determines the cutting boundary line according to the gradient image, and the cutting path is generated according to the cutting boundary line. Therefore, the device can automatically generate a cutting path, and the cutting efficiency and precision are improved.
The invention further provides a board separator corresponding to the embodiment.
As shown in fig. 12, the plate separator 100 of the present invention may include: the memory 110, the processor 120 and the control program stored in the memory 110 and capable of running the circuit board cutting path on the processor 120 realize the method for generating the circuit board cutting path when the processor 120 executes the control program of the circuit board cutting path.
According to the board separator provided by the embodiment of the invention, the cutting path can be automatically generated by executing the method for generating the circuit board cutting path, so that the cutting efficiency and precision are improved.
The invention further provides a computer readable storage medium corresponding to the above embodiment.
The computer-readable storage medium of the present invention stores thereon a control program of a circuit board cutting path, which when executed by a processor, implements the above-described method of generating a circuit board cutting path.
According to the computer-readable storage medium provided by the embodiment of the invention, the cutting path can be automatically generated by executing the generation method of the circuit board cutting path, so that the cutting efficiency and precision are improved.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (15)

1. A method for generating a cutting path of a circuit board is characterized by comprising the following steps:
acquiring a finished product circuit board image, and determining position information of a target to be cut of the finished product circuit board image, wherein the position information of the target to be cut comprises a central point and a main shaft angle;
extracting the region of interest of the target to be cut according to the position information of the target to be cut;
carrying out image processing on the region of interest of the target to be cut so as to obtain a gradient image;
determining a cutting boundary line according to the gradient image, and generating a cutting path according to the cutting boundary line, wherein the generating of the cutting path according to the cutting boundary line comprises:
acquiring the cutter stroke and the cutter radius of a cutting cutter;
determining the coordinates of key points on the cutting boundary line according to the central point of the target to be cut, the angle of the main shaft and the stroke of the cutter;
determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the cutter radius;
and generating the cutting path according to the cutting point coordinates.
2. The method for generating a circuit board cutting path according to claim 1, wherein determining the position information of the target to be cut of the finished circuit board image comprises:
acquiring a template image;
and positioning the position information of the target to be cut from the finished product circuit board image by adopting a template matching algorithm according to the template image.
3. The method for generating a circuit board cutting path according to claim 2, wherein the positioning the position information of the target to be cut from the finished circuit board image by using a template matching algorithm comprises:
acquiring a central point and an angle offset of the target to be cut by adopting a template matching algorithm based on shape characteristics;
performing image processing on the template image to obtain a main shaft angle of the template image;
and determining the main shaft angle of the target to be cut according to the offset of the target to be cut and the main shaft angle of the template image.
4. The method for generating the circuit board cutting path according to claim 3, wherein the determining the main shaft angle of the target to be cut according to the offset of the target to be cut and the main shaft angle of the template image comprises:
and taking the sum of the offset of the target to be cut and the main shaft angle of the template image as the main shaft angle of the target to be cut.
5. The method for generating a circuit board cutting path according to claim 3, wherein the cutting boundary line comprises a horizontal cutting boundary line and a vertical cutting boundary line, and wherein determining the cutting boundary line according to the gradient image comprises:
when the angle of the main shaft of the target to be cut is smaller than a first preset angle threshold value, processing the gradient image by adopting a first edge search algorithm to obtain the horizontal cutting boundary line;
and when the angle of the main shaft of the target to be cut is greater than or equal to the first preset angle threshold value, processing the gradient image by adopting a second edge search algorithm to obtain the vertical cutting boundary line.
6. The method for generating a circuit board cutting path according to claim 5, wherein the processing the gradient image by using a first edge search algorithm comprises:
when the horizontal edge search is carried out on the gradient image, the gradient value of each column is detected in sequence;
and when the gradient value is determined to be larger than a first gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the horizontal cutting boundary line.
7. The method for generating a circuit board cutting path according to claim 5, wherein the processing the gradient image by using a second edge search algorithm comprises:
when vertical edge searching is carried out on the gradient image, the gradient value of each row is detected in sequence;
and when the gradient value is determined to be larger than a second gradient threshold value, taking the coordinate corresponding to the gradient value as an edge point of the vertical cutting boundary line.
8. The method for generating a circuit board cutting path according to claim 6, wherein the processing the gradient image by using a first edge search algorithm further comprises:
and stopping horizontal edge search when the number of the edge points of the horizontal cutting boundary line is determined to be larger than a first preset value.
9. The method for generating a circuit board cutting path according to claim 7, wherein the processing the gradient image by using a second edge search algorithm further comprises:
and stopping the vertical edge search when the number of the edge points of the vertical cutting boundary line is determined to be larger than a second preset value.
10. The method for generating a circuit board cutting path according to claim 1, wherein the template image is a U-shaped image, and the determining of the coordinates of the cutting point according to the coordinates of the key point on the cutting boundary line and the radius of the cutter comprises:
acquiring the groove width of the target to be cut;
when the groove width of the target to be cut is smaller than the diameter of the cutter, acquiring a midpoint coordinate according to the coordinates of key points on the cutting boundary line to determine a cutting point coordinate;
and generating the cutting path according to the cutting point coordinates.
11. The method for forming a cutting path of a circuit board according to claim 10,
when the groove width of the target to be cut is larger than or equal to the diameter of the cutter, translating the distance of the radius of the cutter in the direction far away from the cutting boundary line according to the coordinates of the key points on the cutting boundary line to determine the coordinates of the cutting points;
and generating the cutting path according to the cutting point coordinates.
12. The method for generating the circuit board cutting path according to any one of claims 1 to 11, wherein the image processing of the region of interest of the target to be cut comprises:
and filtering the region of interest by adopting a Sobel operator to obtain the gradient image.
13. A circuit board cutting path generating apparatus, comprising:
the image acquisition module is used for acquiring an image of the finished product circuit board;
the determining module is used for determining the position information of a target to be cut of the finished product circuit board image, wherein the position information of the target to be cut comprises a central point and a main shaft angle;
the image processing module is used for extracting the region of interest of the target to be cut according to the position information of the target to be cut and carrying out image processing on the region of interest of the target to be cut so as to obtain a gradient image;
a generating module, configured to determine a cutting boundary line according to the gradient image, and generate a cutting path according to the cutting boundary line, where the generating module generates the cutting path according to the cutting boundary line, and is specifically configured to: acquiring the cutter stroke and the cutter radius of a cutting cutter; determining key point coordinates on a cutting boundary line according to the central point of the target to be cut, the spindle angle and the cutter stroke; determining a cutting point coordinate according to the key point coordinate on the cutting boundary line and the radius of the cutter; and generating a cutting path according to the cutting point coordinates.
14. A board cutting machine comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the board cutting machine implements the method for generating a circuit board cutting path according to any one of claims 1 to 12.
15. A computer-readable storage medium, on which a program for generating a cut path of a wiring board is stored, the program for generating a cut path of a wiring board, when executed by a processor, implementing the method for generating a cut path of a wiring board according to any one of claims 1 to 12.
CN202110978136.XA 2021-08-25 2021-08-25 Generation method and generation device for circuit board cutting path and board separator Active CN113421265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110978136.XA CN113421265B (en) 2021-08-25 2021-08-25 Generation method and generation device for circuit board cutting path and board separator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110978136.XA CN113421265B (en) 2021-08-25 2021-08-25 Generation method and generation device for circuit board cutting path and board separator

Publications (2)

Publication Number Publication Date
CN113421265A true CN113421265A (en) 2021-09-21
CN113421265B CN113421265B (en) 2021-11-16

Family

ID=77719334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110978136.XA Active CN113421265B (en) 2021-08-25 2021-08-25 Generation method and generation device for circuit board cutting path and board separator

Country Status (1)

Country Link
CN (1) CN113421265B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114882032A (en) * 2022-07-11 2022-08-09 苏州镭明激光科技有限公司 Grooving detection and intelligent sensing processing method and system for semiconductor

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335973A (en) * 2015-10-20 2016-02-17 上海交通大学 Visual processing method for strip steel processing production line
CN109509197A (en) * 2018-09-26 2019-03-22 沈阳东软医疗系统有限公司 A kind of method, apparatus, equipment and storage medium for dividing area-of-interest
CN110599465A (en) * 2019-08-28 2019-12-20 上海联影智能医疗科技有限公司 Image positioning method and device, computer equipment and storage medium
CN110757555A (en) * 2018-07-27 2020-02-07 维嘉数控科技(苏州)有限公司 Control method and device for cutting PCB (printed Circuit Board) by board separator
US20200269458A1 (en) * 2019-02-26 2020-08-27 National University Corporation Nagoya University Cutting apparatus and contact position specifying program
CN112388710A (en) * 2019-08-19 2021-02-23 维嘉数控科技(苏州)有限公司 Method and device for cutting edges of board separator, storage medium and board separator

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335973A (en) * 2015-10-20 2016-02-17 上海交通大学 Visual processing method for strip steel processing production line
CN110757555A (en) * 2018-07-27 2020-02-07 维嘉数控科技(苏州)有限公司 Control method and device for cutting PCB (printed Circuit Board) by board separator
CN109509197A (en) * 2018-09-26 2019-03-22 沈阳东软医疗系统有限公司 A kind of method, apparatus, equipment and storage medium for dividing area-of-interest
US20200269458A1 (en) * 2019-02-26 2020-08-27 National University Corporation Nagoya University Cutting apparatus and contact position specifying program
CN112388710A (en) * 2019-08-19 2021-02-23 维嘉数控科技(苏州)有限公司 Method and device for cutting edges of board separator, storage medium and board separator
CN110599465A (en) * 2019-08-28 2019-12-20 上海联影智能医疗科技有限公司 Image positioning method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
仵桂学等: ""基于机器视觉的快速切割路径生成系统"", 《应用技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114882032A (en) * 2022-07-11 2022-08-09 苏州镭明激光科技有限公司 Grooving detection and intelligent sensing processing method and system for semiconductor
CN114882032B (en) * 2022-07-11 2022-10-18 苏州镭明激光科技有限公司 Grooving detection and intelligent sensing processing method and system for semiconductor

Also Published As

Publication number Publication date
CN113421265B (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN108364311B (en) Automatic positioning method for metal part and terminal equipment
EP2370935B1 (en) System and method for three-dimensional alignment of objects using machine vision
KR102073468B1 (en) System and method for scoring color candidate poses against a color image in a vision system
JPH05749B2 (en)
CN107192716A (en) A kind of workpiece, defect quick determination method based on contour feature
CN113421265B (en) Generation method and generation device for circuit board cutting path and board separator
CN114240845B (en) Light cutting method surface roughness measurement method applied to cutting workpiece
Buch et al. Local Point Pair Feature Histogram for Accurate 3D Matching.
CN114047123A (en) Method and system for detecting production defects of integrated board
CN115861351A (en) Edge detection method, defect detection method and detection device
CN116452644A (en) Three-dimensional point cloud registration method and device based on feature descriptors and storage medium
CN112329880A (en) Template fast matching method based on similarity measurement and geometric features
CN114976338A (en) Automatic disassembling method and system for lithium battery and readable storage medium
CN112288724B (en) Defect detection method and device, electronic equipment and storage medium
DE102020121396A1 (en) Object detection apparatus and object detection computer programs
US11645827B2 (en) Detection method and device for assembly body multi-view change based on feature matching
CN114705824B (en) Method and system for detecting defects of metal element product
CN108564571A (en) Image-region choosing method and terminal device
CN113284158B (en) Image edge extraction method and system based on structural constraint clustering
CN112991284B (en) Temperature controller guide frame defect detection method and system
Lugo et al. Semi-supervised learning approach for localization and pose estimation of texture-less objects in cluttered scenes
CN113065501A (en) Seedling line identification method and device and agricultural machine
Mollo Development and testing of an industrial vision application for robot guidance using OpenCV library
CN114742791A (en) Auxiliary defect detection method and device for printed circuit board assembly and computer equipment
Said et al. Non-wet solder joint detection in processor sockets and BGA assemblies

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant