CN113298834A - Visual edge finding image processing method and device for metal plate - Google Patents

Visual edge finding image processing method and device for metal plate Download PDF

Info

Publication number
CN113298834A
CN113298834A CN202110476015.5A CN202110476015A CN113298834A CN 113298834 A CN113298834 A CN 113298834A CN 202110476015 A CN202110476015 A CN 202110476015A CN 113298834 A CN113298834 A CN 113298834A
Authority
CN
China
Prior art keywords
angle
image
template
binary image
vertex
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
CN202110476015.5A
Other languages
Chinese (zh)
Other versions
CN113298834B (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.)
Huagong Farley Cutting and Welding System Engineering Co Ltd
Original Assignee
Huagong Farley Cutting and Welding System Engineering 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 Huagong Farley Cutting and Welding System Engineering Co Ltd filed Critical Huagong Farley Cutting and Welding System Engineering Co Ltd
Priority to CN202110476015.5A priority Critical patent/CN113298834B/en
Publication of CN113298834A publication Critical patent/CN113298834A/en
Application granted granted Critical
Publication of CN113298834B publication Critical patent/CN113298834B/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/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • 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/30136Metal

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a visual edge-finding image processing method and device for a metal plate, which are used for preprocessing an acquired vertex angle image of the metal plate to obtain a binary image; extracting outline information of all characteristic regions in the binary image, performing polygon fitting, and screening out vertex angle characteristics of the plate; performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing right-angle binary images with different rotation angles as templates, and performing template matching by using a template matching algorithm to obtain the position and the angle of the vertex angle coarse positioning of the plate; selecting areas where the two right-angle sides are located in a binary image only containing vertex angle characteristics, and fitting straight lines where the two right-angle sides are located; and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate. The invention can realize the visual automatic edge searching of the metal plate with high efficiency and high precision.

Description

Visual edge finding image processing method and device for metal plate
Technical Field
The invention relates to the field of automatic edge searching of a plane laser cutting machine, in particular to a method and a device for processing a visual edge searching image of a metal plate.
Background
With the continuous development of the laser cutting industry, the development of the automatic edge searching function of the metal plate in the laser industry is more and more mature. The automatic edge searching method widely applied in the market at present mainly adopts two modes of capacitance edge searching and photoelectric edge searching. The two methods save labor cost and time cost to a certain extent, manual intervention is still not left, the edge searching precision is not high, the time required for edge searching is relatively long, and the working efficiency of the machine tool is influenced. Along with the increasingly intense market competition of the laser cutting industry, the edge searching efficiency of the plate is improved, and the realization of high-efficiency high-precision full-automatic edge searching is an urgent demand at present.
Machine vision is to use a machine to replace human eyes for measurement and judgment, is an important branch of automation and intelligent development, and is widely applied to various fields in production and life. In the industrial field, machine vision is mainly used for aspects such as part detection, feature recognition, dimension measurement and positioning guidance, and has the characteristics of high precision, strong flexibility, high efficiency, adaptability to special environments and the like.
The machine vision technology is applied to the plate edge searching, so that the edge searching efficiency can be greatly improved, the edge searching accuracy is ensured, manual intervention can be completely separated, and a stable and effective metal plate edge searching visual image processing method is found out as a core task of visual edge searching.
Disclosure of Invention
The invention aims to provide a method and a device for processing a visual edge finding image of a metal plate, so as to realize high-efficiency and high-precision visual automatic edge finding of the metal plate.
The invention is realized by the following steps:
in one aspect, the invention provides a visual edge finding image processing method for a metal plate, which comprises the following steps:
preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
extracting outline information of all feature areas in the binary image, then performing polygon fitting on the outline, further screening vertex angle features of the plate according to the fitted polygon information, and obtaining a binary image only containing the vertex angle features;
performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing a right-angle binary image with different rotation angles by using an opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning;
selecting areas where two right-angle sides are located in a binary image frame only containing the characteristics of the top angle according to the position and the angle of the top angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate.
Further, the preprocessing the collected metal plate vertex angle image specifically comprises:
and preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence.
Further, further screening out panel apex angle characteristics according to the information of the polygon of fitting specifically includes:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, and taking the corresponding characteristic as the vertex angle characteristic.
Further, the step of drawing the right-angle binary images with different rotation angles by using the opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of the right angle in the corresponding template image with the highest matching degree and the position matched with the template, namely the position and the angle for roughly positioning the top angle of the plate, specifically comprises the steps of:
setting Span as 45 degrees and step length as 2 degrees, drawing a right-angle binary image in real time by using opencv drawing functions, rotating right angles in the template once every 2 degrees within the range of-45-45 degrees to obtain a template image, and performing template matching operation on the template image and an image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
Further, according to the position and the angle of the vertex angle coarse positioning, selecting an area where two right-angle sides are located in a binary image containing only vertex angle features, performing morphological processing on the area, and removing interference points perpendicular to the direction of the right-angle sides specifically comprises:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
On the other hand, the invention also provides a visual edge finding image processing device for the metal plate, which comprises:
the image preprocessing module is used for preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
the contour analysis screening module is used for extracting contour information of all the characteristic regions in the binary image, then performing polygon fitting on the contour, further screening vertex angle characteristics of the plate according to the fitted polygon information, and obtaining the binary image only containing the vertex angle characteristics;
the template matching vertex angle coarse positioning module is used for performing down-sampling processing on the binary image only containing vertex angle features to obtain a binary image to be matched, drawing right-angle binary images of different rotation angles by using opencv drawing functions as templates, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position matched with the template, namely the position and the angle for coarsely positioning the vertex angle of the plate;
the straight line fitting module is used for selecting areas where two right-angle sides are located in a binary image only containing vertex angle characteristics according to the position and the angle of the vertex angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
the top angle fine positioning module is used for calculating the intersection point of two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate;
further, the preprocessing the collected metal plate vertex angle image by the image preprocessing module specifically comprises:
and preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence.
Further, the step of further screening the vertex angle characteristics of the plate according to the fitted polygonal information by the contour analysis screening module specifically comprises:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, and taking the corresponding characteristic as the vertex angle characteristic.
Further, the template matching vertex angle coarse positioning module utilizes opencv drawing functions to draw right-angle binary images with different rotation angles as templates, and utilizes a template matching algorithm to perform template matching, so that the rotation angle of the right angle in the corresponding template image when the matching degree is the highest and the position where the template is matched are obtained, namely, the position and the angle for the plate vertex angle coarse positioning specifically include:
setting Span as 45 degrees and step length as 2 degrees, drawing a right-angle binary image in real time by using opencv drawing functions, rotating right angles in the template once every 2 degrees within the range of-45-45 degrees to obtain a template image, and performing template matching operation on the template image and an image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
Further, the straight line fitting module selects the area where two right-angle sides are located in the binary image middle frame only containing the vertex angle characteristics according to the position and the angle of the vertex angle coarse positioning, the area is subjected to morphological processing, and the removal of the interference points in the direction perpendicular to the right-angle sides specifically comprises:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a method and a device for processing a visual edge-finding image of a metal plate, which are used for preprocessing an acquired vertex angle image of the metal plate, preliminarily filtering out interference characteristics, and separating a target and a background to obtain a binary image; extracting outline information of all feature areas in the binary image, then performing polygon fitting on the outline, further screening vertex angle features of the plate according to the fitted polygon information, and obtaining a binary image only containing the vertex angle features; performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing a right-angle binary image with different rotation angles by using an opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning; selecting areas where two right-angle sides are located in a binary image frame only containing the characteristics of the top angle according to the position and the angle of the top angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method; and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate. The method can effectively remove interference information in the image, quickly and accurately position the position and the deflection angle of the metal plate vertex angle in the image, and realize high-efficiency and high-precision visual automatic edge finding of the metal plate.
Drawings
Fig. 1 is a flowchart of a visual edge finding image processing method for a metal plate according to an embodiment of the present invention;
FIG. 2 is a flow chart of a profile analysis screening provided by an embodiment of the present invention;
fig. 3 is a flowchart of template matching vertex angle coarse positioning according to an embodiment of the present invention;
FIG. 4 is a template diagram drawn in template matching provided by an embodiment of the present invention;
fig. 5 is a block diagram of a visual edge finding image processing apparatus for a metal plate according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for processing a visual edge finding image of a metal plate, including the following steps:
s1, image preprocessing: preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
s2, contour analysis and screening: extracting outline information of all feature areas in the binary image, then performing polygon fitting on the outline, further screening vertex angle features of the plate according to the fitted polygon information, and obtaining a binary image only containing the vertex angle features;
s3, roughly positioning a template matching vertex angle: performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing a right-angle binary image with different rotation angles by using an opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning;
s4, fitting a straight line: selecting areas where two right-angle sides are located in a binary image frame only containing the characteristics of the top angle according to the position and the angle of the top angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
s5, top angle fine positioning: and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate.
By the method, the interference information in the image can be effectively removed, the position and the deflection angle of the metal plate vertex angle in the image can be quickly and accurately positioned, and the efficient and high-precision visual automatic edge finding of the metal plate is realized.
The above steps will be described in detail below.
The preprocessing of the collected metal plate vertex angle image in the step S1 specifically includes:
preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence, filtering out interference features preliminarily after preprocessing, separating out a target and a background, and obtaining a binary image.
As shown in fig. 2, the further screening of the vertex angle characteristics of the board according to the information of the fitted polygon in step S2 specifically includes:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, wherein the corresponding characteristic contour is a target contour, and the corresponding characteristic is a vertex angle characteristic.
As shown in fig. 3 and 4, in step S3, the binary image containing only corner features is downsampled, and the salient size is reduced to obtain a binary image to be matched. The method comprises the following steps of drawing right-angle binary images with different rotation angles by using opencv drawing functions as templates, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in a corresponding template image when the matching degree is the highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning, wherein the method specifically comprises the following steps:
setting Span to be 45 degrees, setting the rotation angle range of the right angle in the template to be-45 degrees, setting the step length to be 2 degrees, namely rotating the right angle in the template once every 2 degrees and performing template matching once, drawing a drawing function by using opencv, drawing a right angle binary image in real time, rotating the right angle in the template once every 2 degrees within the range of-45 degrees to obtain a template image, and performing template matching operation with the image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
In step S4, according to the position and angle of the vertex angle coarse positioning, selecting an area where two right-angle sides are located in the binary image containing only vertex angle features, performing morphological processing on the area, and removing the interference points in the direction perpendicular to the right-angle sides specifically includes:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
And finally, performing linear fitting on the filtered point set by adopting a least square method, and respectively fitting straight lines where a horizontal right-angle side and a numerical right-angle side are located. And calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate.
Based on the same inventive concept, the embodiment of the invention also provides a visual edge finding image processing device for a metal plate, and as the principle of the problem solved by the device is similar to the method of the embodiment, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
As shown in fig. 5, a visual edge finding image processing apparatus for a metal plate provided in an embodiment of the present invention may be used to perform the above method embodiment, and the apparatus includes:
the image preprocessing module is used for preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
the contour analysis screening module is used for extracting contour information of all the characteristic regions in the binary image, then performing polygon fitting on the contour, further screening vertex angle characteristics of the plate according to the fitted polygon information, and obtaining the binary image only containing the vertex angle characteristics;
the template matching vertex angle coarse positioning module is used for performing down-sampling processing on the binary image only containing vertex angle features to obtain a binary image to be matched, drawing right-angle binary images of different rotation angles by using opencv drawing functions as templates, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position matched with the template, namely the position and the angle for coarsely positioning the vertex angle of the plate;
the straight line fitting module is used for selecting areas where two right-angle sides are located in a binary image only containing vertex angle characteristics according to the position and the angle of the vertex angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
the top angle fine positioning module is used for calculating the intersection point of two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate;
further, the preprocessing the collected metal plate vertex angle image by the image preprocessing module specifically comprises:
and preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence.
Further, the step of further screening the vertex angle characteristics of the plate according to the fitted polygonal information by the contour analysis screening module specifically comprises:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, and taking the corresponding characteristic as the vertex angle characteristic.
Further, the template matching vertex angle coarse positioning module utilizes opencv drawing functions to draw right-angle binary images with different rotation angles as templates, and utilizes a template matching algorithm to perform template matching, so that the rotation angle of the right angle in the corresponding template image when the matching degree is the highest and the position where the template is matched are obtained, namely, the position and the angle for the plate vertex angle coarse positioning specifically include:
setting Span as 45 degrees and step length as 2 degrees, drawing a right-angle binary image in real time by using opencv drawing functions, rotating right angles in the template once every 2 degrees within the range of-45-45 degrees to obtain a template image, and performing template matching operation on the template image and an image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
Further, the straight line fitting module selects the area where two right-angle sides are located in the binary image middle frame only containing the vertex angle characteristics according to the position and the angle of the vertex angle coarse positioning, the area is subjected to morphological processing, and the removal of the interference points in the direction perpendicular to the right-angle sides specifically comprises:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
In summary, the method and the device for processing the visual edge-finding image of the metal plate provided by the invention preprocess the collected image of the top angle of the metal plate, preliminarily filter out interference characteristics, separate out a target and a background, and obtain a binary image; extracting outline information of all feature areas in the binary image, then performing polygon fitting on the outline, further screening vertex angle features of the plate according to the fitted polygon information, and obtaining a binary image only containing the vertex angle features; performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing a right-angle binary image with different rotation angles by using an opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning; selecting areas where two right-angle sides are located in a binary image frame only containing the characteristics of the top angle according to the position and the angle of the top angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method; and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate. The method can effectively remove interference information in the image, quickly and accurately position the position and the deflection angle of the metal plate vertex angle in the image, and realize high-efficiency and high-precision visual automatic edge finding of the metal plate.
Those of ordinary skill in the art will appreciate that all or part of the steps of the various methods of the embodiments may be implemented by associated hardware as instructed by a program, which may be stored on a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A visual edge finding image processing method for a metal plate is characterized by comprising the following steps:
preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
extracting outline information of all feature areas in the binary image, then performing polygon fitting on the outline, further screening vertex angle features of the plate according to the fitted polygon information, and obtaining a binary image only containing the vertex angle features;
performing down-sampling processing on the binary image only containing the vertex angle characteristics to obtain a binary image to be matched, drawing a right-angle binary image with different rotation angles by using an opencv drawing function as a template, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position of template matching, namely the position and the angle of the board vertex angle coarse positioning;
selecting areas where two right-angle sides are located in a binary image frame only containing the characteristics of the top angle according to the position and the angle of the top angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
and calculating the intersection point of the two straight lines according to a fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slopes of the two straight lines, namely the deflection angle of the plate.
2. The visual edge-finding image processing method of the metal plate as claimed in claim 1, wherein the preprocessing of the collected top angle image of the metal plate specifically comprises:
and preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence.
3. The visual edge-finding image processing method of the metal plate as claimed in claim 1, wherein the further screening of the plate vertex angle characteristics according to the fitted polygon information specifically comprises:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, and taking the corresponding characteristic as the vertex angle characteristic.
4. The visual edge-finding image processing method for the metal plate as claimed in claim 1, wherein the step of drawing the right-angle binary image with different rotation angles by using an opencv drawing function as a template and performing template matching by using a template matching algorithm to obtain the rotation angle of the right angle in the template image and the position of template matching corresponding to the highest matching degree, namely the position and the angle of the coarse positioning of the vertex angle of the plate, specifically comprises the steps of:
setting Span as 45 degrees and step length as 2 degrees, drawing a right-angle binary image in real time by using opencv drawing functions, rotating right angles in the template once every 2 degrees within the range of-45-45 degrees to obtain a template image, and performing template matching operation on the template image and an image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
5. The visual edge-finding image processing method of the metal plate as claimed in claim 1, wherein the area where the two right-angle sides are located is selected from the binary image only containing the vertex angle features according to the position and the angle of the vertex angle coarse positioning, the area is subjected to morphological processing, and the removing of the interference points in the direction perpendicular to the right-angle sides specifically comprises:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
6. The utility model provides a sheet metal vision seeks limit image processing apparatus which characterized in that includes:
the image preprocessing module is used for preprocessing the collected metal plate vertex angle image, preliminarily filtering out interference characteristics, and separating out a target and a background to obtain a binary image;
the contour analysis screening module is used for extracting contour information of all the characteristic regions in the binary image, then performing polygon fitting on the contour, further screening vertex angle characteristics of the plate according to the fitted polygon information, and obtaining the binary image only containing the vertex angle characteristics;
the template matching vertex angle coarse positioning module is used for performing down-sampling processing on the binary image only containing vertex angle features to obtain a binary image to be matched, drawing right-angle binary images of different rotation angles by using opencv drawing functions as templates, and performing template matching by using a template matching algorithm to obtain the rotation angle of a right angle in the corresponding template image when the matching degree is highest and the position matched with the template, namely the position and the angle for coarsely positioning the vertex angle of the plate;
the straight line fitting module is used for selecting areas where two right-angle sides are located in a binary image only containing vertex angle characteristics according to the position and the angle of the vertex angle coarse positioning, performing morphological processing on the areas, removing interference points in the direction perpendicular to the right-angle sides, and fitting straight lines where the two right-angle sides are located by using a least square method;
and the top angle fine positioning module is used for calculating the intersection point of the two straight lines according to the fitting linear equation of the two right-angle sides, namely the position of the top angle of the plate, and calculating the average deflection angle according to the slope of the two straight lines, namely the deflection angle of the plate.
7. The visual edge-finding image processing device of the metal plate as claimed in claim 6, wherein the image preprocessing module for preprocessing the collected top angle image of the metal plate specifically comprises:
and preprocessing the collected metal plate vertex angle image by a median filtering method, a threshold segmentation method and a morphological processing method in sequence.
8. The visual edge-finding image processing device for metal sheets as claimed in claim 6, wherein the contour analysis screening module further screens out the top corner features of the sheet according to the fitted polygon information specifically comprises:
calculating the area and the perimeter of each polygon and the width and the height of the minimum circumscribed rectangle, calculating the ratio K of the area to the perimeter and the width-height ratio K1 of the minimum circumscribed rectangle, setting an area-perimeter ratio threshold Kn and a minimum circumscribed rectangle width-height ratio threshold Kn1 according to the test result of the actual working condition, selecting the polygon with the largest area from all the polygons which meet K > Kn and K1< Kn1, and taking the corresponding characteristic as the vertex angle characteristic.
9. The visual edge-finding image processing device for metal plates as claimed in claim 6, wherein the template matching vertex angle coarse positioning module draws a right-angle binary image with different rotation angles by using opencv drawing functions as a template, and performs template matching by using a template matching algorithm, and obtaining the rotation angle of the right angle in the corresponding template image and the position where the template is matched when the matching degree is the highest, namely the position and the angle of the plate vertex angle coarse positioning specifically comprises:
setting Span as 45 degrees and step length as 2 degrees, drawing a right-angle binary image in real time by using opencv drawing functions, rotating right angles in the template once every 2 degrees within the range of-45-45 degrees to obtain a template image, and performing template matching operation on the template image and an image to be matched to obtain a group of correlation coefficients; and after completing all template matching operation, comparing all correlation coefficients, and selecting the global maximum correlation coefficient R, wherein the corresponding template matching position and the right-angle rotation angle in the template are the position and the angle for roughly positioning the top angle of the plate.
10. The sheet metal visual edge-seeking image processing device as claimed in claim 6, wherein the straight line fitting module selects an area where two right-angle edges are located in a binary image containing only the vertex angle features according to the position and angle of the vertex angle coarse positioning, performs morphological processing on the area, and removes interference points in the direction perpendicular to the right-angle edges specifically comprises:
according to the position and the angle of the vertex angle coarse positioning, selecting areas where a horizontal right-angle side and a vertical right-angle side are located in a binary image only containing vertex angle characteristics, counting effective point sets in the areas, performing corrosion-first expansion treatment on the point set of the fitting vertical right-angle side by adopting a 1 x n structural element, performing corrosion-first expansion treatment on the point set of the fitting horizontal right-angle side by adopting an n x 1 structural element, wherein n is 1/100 of the image size.
CN202110476015.5A 2021-04-29 2021-04-29 Visual edge finding image processing method and device for metal plate Active CN113298834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110476015.5A CN113298834B (en) 2021-04-29 2021-04-29 Visual edge finding image processing method and device for metal plate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110476015.5A CN113298834B (en) 2021-04-29 2021-04-29 Visual edge finding image processing method and device for metal plate

Publications (2)

Publication Number Publication Date
CN113298834A true CN113298834A (en) 2021-08-24
CN113298834B CN113298834B (en) 2022-07-05

Family

ID=77321787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110476015.5A Active CN113298834B (en) 2021-04-29 2021-04-29 Visual edge finding image processing method and device for metal plate

Country Status (1)

Country Link
CN (1) CN113298834B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113828948A (en) * 2021-11-23 2021-12-24 济南邦德激光股份有限公司 Plate edge searching method, calibration system and edge searching system of laser cutting machine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2061313A1 (en) * 1991-03-20 1992-09-21 Arthur F. Griffin Rectilinear object image matcher
CN102628682A (en) * 2012-04-24 2012-08-08 重庆大学 Volume measurement method based on industrial CT scanning technology
CN104981105A (en) * 2015-07-09 2015-10-14 广东工业大学 Detecting and error-correcting method capable of rapidly and accurately obtaining element center and deflection angle
CN110175621A (en) * 2019-03-18 2019-08-27 上海柏楚电子科技股份有限公司 One kind being based on the matched laser cutting vision positioning method of any template
CN112085033A (en) * 2020-08-19 2020-12-15 浙江华睿科技有限公司 Template matching method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2061313A1 (en) * 1991-03-20 1992-09-21 Arthur F. Griffin Rectilinear object image matcher
CN102628682A (en) * 2012-04-24 2012-08-08 重庆大学 Volume measurement method based on industrial CT scanning technology
CN104981105A (en) * 2015-07-09 2015-10-14 广东工业大学 Detecting and error-correcting method capable of rapidly and accurately obtaining element center and deflection angle
CN110175621A (en) * 2019-03-18 2019-08-27 上海柏楚电子科技股份有限公司 One kind being based on the matched laser cutting vision positioning method of any template
CN112085033A (en) * 2020-08-19 2020-12-15 浙江华睿科技有限公司 Template matching method and device, electronic equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
WCY LAM, ET AL.: "Efficient technique for circle detection using hypothesis filtering and hough transform", 《IEEE PROCEEDINGS:VISION,IMAGE AND SIGNAL PROCESSING》 *
WCY LAM, ET AL.: "Efficient technique for circle detection using hypothesis filtering and hough transform", 《IEEE PROCEEDINGS:VISION,IMAGE AND SIGNAL PROCESSING》, 31 October 1996 (1996-10-31), pages 292 - 299 *
赵亮亮: "全自动裁切机定位系统的设计与实现", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技辑》 *
赵亮亮: "全自动裁切机定位系统的设计与实现", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技辑》, 15 September 2019 (2019-09-15), pages 20 - 57 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113828948A (en) * 2021-11-23 2021-12-24 济南邦德激光股份有限公司 Plate edge searching method, calibration system and edge searching system of laser cutting machine

Also Published As

Publication number Publication date
CN113298834B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN108364311B (en) Automatic positioning method for metal part and terminal equipment
CN111179225B (en) Test paper surface texture defect detection method based on gray gradient clustering
CN105447512B (en) A kind of detection method and device for the beauty defect that essence slightly combines
CN109839385B (en) Self-adaptive PCB defect visual positioning detection and classification system
CN102999886B (en) Image Edge Detector and scale grating grid precision detection system
CN112465809B (en) Mold defect detection method based on image recognition, computer readable storage medium and device
CN105678213B (en) Dual-mode mask person event automatic detection method based on video feature statistics
CN110276759B (en) Mobile phone screen bad line defect diagnosis method based on machine vision
CN103175844A (en) Detection method for scratches and defects on surfaces of metal components
CN108564573B (en) Automatic fish head and tail image identification method for spanish mackerel cutting machine
CN113298834B (en) Visual edge finding image processing method and device for metal plate
CN110348461A (en) A kind of Surface Flaw feature extracting method
CN109101976A (en) A kind of detection method of arc extinguishing grid pieces surface defect
CN113588656A (en) Novel bolt appearance size detection method
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN114494226B (en) Method for detecting greasy dirt defect of spinning cake based on graph centroid tracking algorithm
Bodnár et al. A novel method for barcode localization in image domain
CN112528740A (en) Pressing plate state identification method
CN112288049B (en) Pointer meter reading method based on template matching and limitation of connected domain pointer positioning
CN111598901B (en) Method for estimating processing progress of dental restoration product based on depth image
AU2021368390B2 (en) Multi-target recognition system and method for follow-up robot based on coded thermal infrared mark
CN115393290A (en) Edge defect detection method, device and equipment
CN113554695A (en) Intelligent part hole site identification and positioning method
CN111652221B (en) ROI extraction method and system for USB plug surface defect detection
CN110276260B (en) Commodity detection method based on depth camera

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