CN115311350A - Method and device for determining position parameters of edge wave defects, electronic equipment and medium - Google Patents
Method and device for determining position parameters of edge wave defects, electronic equipment and medium Download PDFInfo
- Publication number
- CN115311350A CN115311350A CN202210945000.3A CN202210945000A CN115311350A CN 115311350 A CN115311350 A CN 115311350A CN 202210945000 A CN202210945000 A CN 202210945000A CN 115311350 A CN115311350 A CN 115311350A
- Authority
- CN
- China
- Prior art keywords
- determining
- abscissa
- pixel
- starting point
- ordinate
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30136—Metal
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
- Image Processing (AREA)
Abstract
The application provides a method, a device, electronic equipment and a medium for determining position parameters of a boundary wave defect, wherein the method comprises the following steps: establishing a rectangular coordinate system on the binary image of the edge wave defect image; counting the pixel sum of all pixel points under the ordinate or the abscissa for each ordinate or abscissa in the rectangular coordinate system; determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point. By the method, the position parameters of the edge wave defects can be accurately determined, and the economic loss of a steel mill is reduced.
Description
Technical Field
The invention relates to the technical field of steel plates, in particular to a method and a device for determining position parameters of edge wave defects, electronic equipment and a medium.
Background
Edge wave defects often occur in the process of producing steel plates by steel plate production enterprises. A boundary wave defect refers to a condition where one or both sides of the steel are uneven and the unevenness extends from near the starting position of the side to the middle of the side.
At present, a worker mainly cuts by naked eyes, the cutting position is determined manually, the cutting position of the worker is a position including and exceeding the edge wave defect, and the position exceeding the edge wave defect causes certain economic loss to a steel mill.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, an electronic device and a medium for determining a position parameter of a boundary wave defect, which can accurately determine the position parameter of the boundary wave defect and reduce economic loss of a steel mill.
In a first aspect, an embodiment of the present application provides a method for determining a location parameter of a boundary wave defect, where the method for determining a location parameter of a boundary wave defect includes:
acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image;
counting the pixel sum of all pixel points under the ordinate or the abscissa for each ordinate or abscissa in the rectangular coordinate system;
determining the position coordinates of the starting points of the edge wave defects according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image;
determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image;
and determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point.
In a possible implementation manner, determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image includes:
aiming at the pixel sums corresponding to all the vertical coordinates, determining the vertical coordinate of the pixel sum which is the maximum value as the horizontal coordinate of the starting point;
determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the starting point according to the abscissa of the starting point and the ordinate of the starting point.
In a possible implementation manner, determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all the pixel points in the binary image includes:
selecting initial pixel points with the same abscissa of the pixel points and the abscissa of the starting point in the binary image;
aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points;
and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
In a possible implementation manner, determining the position coordinates of the end point of the edge wave defect according to the pixel values of all pixels in the binary image and the pixel values corresponding to all abscissas, includes:
determining the abscissa of the pixel sum which is not 0 as an initial abscissa for the pixel sums corresponding to all abscissas;
aiming at all initial abscissas, determining the initial abscissas with the minimum value as the abscissas of the end point;
determining the ordinate of the end point according to the abscissa of the end point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the end point according to the abscissa of the end point and the ordinate of the end point.
In a possible implementation manner, determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point includes:
determining all initial abscissas between the abscissa in the position coordinates of the starting point and the abscissa in the position coordinates of the end point;
aiming at each initial abscissa, determining a vertical coordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image;
determining a target abscissa of the highest point according to the ordinate corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point;
determining the vertical coordinate of the highest point according to the target horizontal coordinate of the highest point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the highest point according to the target abscissa and the ordinate of the highest point.
In a possible implementation, determining the target abscissa of the highest point according to the ordinates corresponding to all the initial abscissas and the ordinate in the position coordinate of the starting point includes:
for the vertical coordinate corresponding to each initial horizontal coordinate, subtracting the value of the vertical coordinate in the position coordinate of the starting point from the value of the vertical coordinate to obtain a difference value corresponding to the initial horizontal coordinate;
and determining the initial abscissa with the maximum difference value as the target abscissa according to the difference values corresponding to all the initial abscissas.
In a second aspect, an embodiment of the present application further provides a device for determining a location parameter of a boundary wave defect, where the device for determining a location parameter of a boundary wave defect includes:
the acquisition module is used for acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image;
the determining module is used for counting the pixel sum of all pixel points under the ordinate or the abscissa aiming at each ordinate or abscissa in the rectangular coordinate system;
the determining module is further used for determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image;
the determining module is further used for determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image;
the determining module is further used for determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point.
In a possible embodiment, the determining module is specifically configured to determine, for pixel sums corresponding to all ordinates, an ordinate where the pixel sum is the maximum value as an abscissa of the starting point; determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the starting point according to the abscissa of the starting point and the ordinate of the starting point.
In a possible implementation manner, the determining module is specifically configured to select an initial pixel point in the binary image, where an abscissa of the pixel point is the same as an abscissa of the starting point; aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points; and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
In a possible embodiment, the determining module is specifically configured to determine, as the initial abscissa, the pixel sum that is not 0 for all pixel sums corresponding to the abscissas; aiming at all initial abscissas, determining the initial abscissas with the minimum value as the abscissas of the end point; determining the vertical coordinate of the end point according to the horizontal coordinate of the end point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the end point according to the abscissa of the end point and the ordinate of the end point.
In a possible embodiment, the determining module is specifically configured to determine all initial abscissas between an abscissa in the position coordinates of the starting point and an abscissa in the position coordinates of the end point; aiming at each initial abscissa, determining a vertical coordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image; determining a target abscissa of the highest point according to the ordinate corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point; determining the vertical coordinate of the highest point according to the target horizontal coordinate of the highest point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the highest point according to the target abscissa of the highest point and the ordinate of the highest point.
In a possible implementation manner, the determining module is specifically configured to subtract, for a vertical coordinate corresponding to each initial horizontal coordinate, a value of the vertical coordinate in the position coordinate of the starting point from a value of the vertical coordinate, to obtain a difference value corresponding to the initial horizontal coordinate; and aiming at the difference values corresponding to all the initial abscissas, determining the initial abscissas with the maximum difference value as the target abscissas.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the device comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the electronic device runs, the processor is communicated with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the steps of the method for determining the position parameters of the boundary wave defect according to any one of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for determining a location parameter of a boundary wave defect according to any one of the first aspect.
The embodiment of the application provides a method, a device, electronic equipment and a medium for determining position parameters of a boundary wave defect, wherein the method comprises the following steps: acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image; counting the pixel sum of all pixel points under the ordinate or the abscissa for each ordinate or abscissa in the rectangular coordinate system; determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point. The method comprises the steps of determining position coordinates of a starting point of the edge wave defect through pixels corresponding to all vertical coordinates and pixel values of all pixel points in a binary image; then, determining the position coordinates of the end point of the edge wave defect according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and finally, determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point, so that the position parameter of the edge wave defect can be accurately determined, and the economic loss of a steel mill is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a method for determining a position parameter of a wave defect according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for determining a location parameter of a boundary wave defect according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram illustrating a device for determining a position parameter of a wave defect according to an embodiment of the present application;
fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be reversed in order or performed concurrently. In addition, one skilled in the art, under the guidance of the present disclosure, may add one or more other operations to the flowchart, or may remove one or more operations from the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In order to enable a person skilled in the art to use the present disclosure, the following embodiments are given in connection with a specific application scenario "steel plate technology field". It will be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the application. Although the present application is described primarily in the context of "steel plate technology", it should be understood that this is merely one exemplary embodiment.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
The following describes a method for determining a location parameter of a boundary wave defect provided in an embodiment of the present application in detail.
Referring to fig. 1, a schematic flow chart of a method for determining a position parameter of a wave defect provided in an embodiment of the present application is shown, and exemplary steps in the embodiment of the present application are described below:
s101, acquiring a binary image of the edge wave defect image; and establishing a rectangular coordinate system on the binary image by taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis.
In the embodiment of the application, a three-dimensional laser profile sensor is used for collecting profile data of a wave defect to obtain a 2D depth image, the depth image is subjected to image graying to obtain a grayscale image, and then the grayscale image is subjected to filtering processing to obtain a filtering image. And carrying out binarization processing on the filtered image to obtain a binary image, and setting a threshold value to be 100 pixels to remove a small-area region to obtain a binary image of the edge wave defect image. And then establishing a rectangular coordinate system on the binary image by taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of the X axis.
The binary image is an image composed of two pixel values, namely 0 and 255, wherein the value of the pixel point without the edge wave defect is set to be 0, and the value of the speed limiting point with the edge wave defect is set to be 255.
S102, counting the pixel sum of all pixel points under the ordinate or the abscissa for each ordinate or abscissa in the rectangular coordinate system.
In the embodiment of the present application, the sum of the pixels of all the pixels in the ordinate or in the abscissa is counted for each ordinate or abscissa on the rectangular coordinate system, that is, for each ordinate or abscissa on the binary image, that is, the pixel statistics of all the pixels in the ordinate or in the abscissa is counted.
For example, if the abscissa has 1,2, and 3 and the ordinate has 1 and 2, then the sum of the pixel values of the pixel point (1, 1), the pixel point (2, 1), and the pixel point (3, 1) is counted for the ordinate 1, where the ordinate is 1. And (3) counting the sum of pixel values of the pixel points (1, 2), the pixel points (2, 2) and the pixel points (3, 2) under the condition that the ordinate is 2 aiming at the ordinate 2. For the abscissa 1, the sum of the pixel values of the pixel points (1, 1) and (1, 2) at the abscissa of 1 is counted. For the abscissa 2, the sum of the pixel values of the pixel points (2, 1) and (2, 2) at the abscissa of 2 is counted. For abscissa 3, the sum of pixel values of pixel points (3, 1) and (3, 2) at abscissa 3 is counted.
In one possible embodiment, the pixel sum may also be converted to a pixel mean, i.e. divided by the total number of pixels.
Optionally, in the embodiment of the present application, the following steps may also be performedBinary image passing formula And performing horizontal projection to obtain pixel sums of all pixel points under each longitudinal coordinate.
Wherein y represents the ordinate of the pixel, p h (y) represents the sum of pixels of all pixel points under the ordinate y, N represents the length of the binary image, x represents the abscissa of the pixel point, and B (x, y) represents the pixel value of the pixel point (x, y).
S103, determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image.
Specifically, for all the pixel sums corresponding to the ordinate, the ordinate at which the pixel sum is the maximum value is determined as the abscissa of the start point.
For example, the sum of the pixel values of the pixel point (1, 1), the pixel point (2, 1), and the pixel point (3, 1) is 765 when the ordinate is 1. For the ordinate 2, the sum of the pixel values of the pixel point (1, 2), the pixel point (2, 2) and the pixel point (3, 2) is calculated to be 510 when the ordinate is 2. 765 is greater than 510, so 1 is determined as the abscissa of the starting point.
Specifically, the ordinate of the starting point is determined according to the abscissa of the starting point and the pixel values of all the pixel points in the binary image.
Here, in the binary image, selecting an initial pixel point with the abscissa of the pixel point being the same as the abscissa of the starting point; aiming at all initial pixel points, determining the initial pixel points with the pixel value of 255 as target pixel points; and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
Firstly, selecting initial pixel points with the same abscissa of a pixel point and the same abscissa of a starting point in a binary image.
For example, the abscissa of the starting point is 1, and all pixel points in the binary image include (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), and (3, 3). If the abscissa of the pixel point is the same as the abscissa of the starting point, the pixel points are (1, 1), (1, 2) and (1, 3), and the pixel points are determined as initial pixel points according to the (1, 1), (1, 2) and (1, 3).
And then, determining the initial pixel point with the pixel value of 255 in the initial pixel points as a target pixel point.
For example, since the pixel value of the pixel (1, 1) is 255, the pixel value of the pixel (1, 2) is 255, and the pixel value of the pixel (1, 3) is 255, (1, 1), (1, 2), and (1, 3) are determined as target pixels.
And finally, aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
For example, (1, 1), (1, 2), and (1, 3) are determined as target pixels, the ordinate of the target pixel is 1,2, and 3, respectively, and the median is 2, so the ordinate having 2 as the starting point.
Specifically, the position coordinates of the start point are obtained from the abscissa of the start point and the ordinate of the start point.
For example, if the abscissa of the starting point is 1 and the ordinate is 2, the position coordinate of the starting point is (1, 2).
And S104, determining the position coordinates of the end point of the edge wave defect according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image.
Specifically, for all the pixel sums corresponding to the abscissa, the abscissa having the pixel sum other than 0 is determined as the initial abscissa.
Specifically, for all the initial abscissas, the initial abscissa whose value of the initial abscissa is the minimum value is determined as the abscissa of the end point.
For example, for abscissa 1, the sum of pixel values is 0. For abscissa 2, the sum of pixel values is 510. For abscissa 3, the sum of pixel values is 765. The pixel sum is abscissa 2 and abscissa 3 which are not 0, and thus abscissa 2 and abscissa 3 are determined as the initial abscissas. 2 is less than 3, so abscissa 2 is determined as the abscissa of the end point.
Specifically, the ordinate of the end point is determined according to the abscissa of the end point and the pixel values of all pixel points in the binary image.
In the embodiment of the application, in the binary image, selecting an initial pixel point with the abscissa of the pixel point being the same as the abscissa of the end point; aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points; and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the terminal point.
Here, specific contents refer to the description in step S103 of determining the ordinate of the starting point from the abscissa of the starting point and the pixel values of all the pixel points in the binary image.
Specifically, the position coordinates of the end point are obtained from the abscissa of the end point and the ordinate of the end point.
And S105, determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point.
The embodiment of the application provides a method for determining position parameters of a boundary wave defect, which comprises the following steps: acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image; counting the pixel sum of all pixel points under the ordinate or the abscissa for each ordinate or abscissa in the rectangular coordinate system; determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point. The position coordinates of the starting point of the edge wave defect are determined through the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; then determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and finally, determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point, so that the position parameter of the edge wave defect can be accurately determined, and the economic loss of a steel mill is reduced.
Referring to fig. 2, a schematic flow chart of another method for determining a position parameter of a wave defect provided in the embodiment of the present application is shown, and exemplary steps in the embodiment of the present application are described below:
s201, determining all initial abscissas between the abscissas in the position coordinates of the starting point and the abscissas in the position coordinates of the end point.
For example, the abscissa of the start point is 1, the abscissa of the end point is 5, and all the abscissas include 1,2, 3, 4, 5, 6, 7, 8, the abscissa 1 in the position coordinate of the start point and the abscissa intermediate to the abscissa 5 in the position coordinate of the end point include 2,3, 4, and thus the abscissas 2,3, 4 are determined as the initial abscissas.
S202, aiming at each initial abscissa, determining a vertical coordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image.
For example, the initial abscissa includes abscissas 2,3, and 4, and the ordinate corresponding to the initial abscissa 2 is determined according to the initial abscissa 2 and the pixel values of all the pixel points in the binary image. And determining a vertical coordinate corresponding to the initial abscissa 3 according to the initial abscissa 3 and the pixel values of all the pixel points in the binary image. And determining a vertical coordinate corresponding to the initial abscissa 4 according to the initial abscissa 4 and the pixel values of all pixel points in the binary image.
Here, in the binary image, selecting an initial pixel point of which the abscissa of the pixel point is the same as the initial abscissa; aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points; and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the initial horizontal coordinate.
Here, specific contents refer to the description in step S103 in which the ordinate of the starting point is determined from the abscissa of the starting point and the pixel values of all the pixel points in the binary image.
And S203, determining the target abscissa of the highest point according to the ordinates corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point.
Specifically, for the ordinate corresponding to each initial abscissa, the value of the ordinate in the position coordinate of the starting point is subtracted from the value of the ordinate to obtain a difference corresponding to the initial abscissa.
For example, if the ordinate in the position coordinate of the start point is 2, the ordinate corresponding to the initial abscissa 2 is 3, the ordinate corresponding to the initial abscissa 3 is 5, and the ordinate corresponding to the initial abscissa 4 is 2, the difference between the ordinate 3 corresponding to the initial abscissa 2 and the ordinate 2 in the position coordinate of the start point is 3-2=1. The value of ordinate 2 in the position coordinate of the starting point is subtracted from the ordinate 5 corresponding to the initial abscissa 3, and the difference corresponding to the initial abscissa 3 is 5-2=3. The ordinate 2 corresponding to the initial abscissa 4 is divided by the ordinate 2 value in the position coordinate of the starting point, and the difference value corresponding to the initial abscissa 4 is obtained to be 2-2=0.
Specifically, for the differences corresponding to all the initial abscissas, the initial abscissas with the differences being the maximum value are determined as the target abscissas.
For example, the initial abscissa 2 corresponds to a difference of 1, and the initial abscissa 3 corresponds to a difference of 3. The initial abscissa 4 corresponds to a difference of 0. The initial abscissa where the difference is the maximum value is the initial abscissa 3, and thus, the initial abscissa 3 is determined as the target abscissa.
S204, determining the vertical coordinate of the highest point according to the target horizontal coordinate of the highest point and the pixel values of all pixel points in the binary image.
In the embodiment of the application, in the binary image, selecting an initial pixel point with the abscissa of the pixel point being the same as the target abscissa of the highest point; aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points; and aiming at the vertical coordinates of all the target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the highest point.
Here, specific contents refer to the description in step S103 in which the ordinate of the starting point is determined from the abscissa of the starting point and the pixel values of all the pixel points in the binary image.
And S205, obtaining a position coordinate of the highest point according to the target abscissa of the highest point and the ordinate of the highest point.
The embodiment of the application provides another method for determining the position parameters of the edge wave defects, which comprises the following steps: determining all initial abscissas between the abscissa in the position coordinates of the starting point and the abscissa in the position coordinates of the end point; aiming at each initial abscissa, determining a vertical coordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image; determining a target abscissa of the highest point according to the ordinate corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point; determining the vertical coordinate of the highest point according to the target horizontal coordinate of the highest point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the highest point according to the target abscissa of the highest point and the ordinate of the highest point. By the method, the position coordinate of the highest point of the edge wave defect can be accurately determined.
Referring to fig. 3, a schematic structural diagram of a device for determining a position parameter of a wave defect provided in an embodiment of the present application is shown, where the device for determining a position parameter of a wave defect includes:
an obtaining module 301, configured to obtain a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image;
a determining module 302, configured to count a sum of pixels of all pixel points in the ordinate or in the abscissa with respect to each ordinate or abscissa in the rectangular coordinate system;
the determining module 302 is further configured to determine a position coordinate of a starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image;
the determining module 302 is further configured to determine a position coordinate of an end point of the edge wave defect according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image;
the determining module 302 is further configured to determine a position coordinate of a highest point of the edge wave defect according to the position coordinate of the starting point and an abscissa in the position coordinate of the end point.
In a possible implementation, the determining module 302 is specifically configured to determine, for all sums of pixels corresponding to the ordinate, the ordinate of the maximum value of the sum of pixels as the abscissa of the starting point; determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all pixel points in the binary image; and obtaining the position coordinates of the starting point according to the abscissa of the starting point and the ordinate of the starting point.
In a possible implementation manner, the determining module 302 is specifically configured to select, in the binary image, an initial pixel point whose abscissa of the pixel point is the same as that of the starting point; aiming at all initial pixel points, determining the initial pixel points with the pixel values of 255 as target pixel points; and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
In a possible implementation, the determining module 302 is specifically configured to determine, as the initial abscissa, the sum of pixels corresponding to all abscissas, and the abscissa that is not 0; aiming at all initial abscissas, determining the initial abscissas with the minimum value as the abscissas of the end point; determining the ordinate of the end point according to the abscissa of the end point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the end point according to the abscissa of the end point and the ordinate of the end point.
In a possible implementation, the determining module 302 is specifically configured to determine all initial abscissas between an abscissa in the position coordinate of the starting point and an abscissa in the position coordinate of the end point; aiming at each initial abscissa, determining a vertical coordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image; determining a target abscissa of the highest point according to the ordinate corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point; determining the vertical coordinate of the highest point according to the target horizontal coordinate of the highest point and the pixel values of all pixel points in the binary image; and obtaining the position coordinate of the highest point according to the target abscissa and the ordinate of the highest point.
In a possible implementation manner, the determining module 302 is specifically configured to, for each ordinate corresponding to the initial abscissa, subtract a value of the ordinate in the position coordinate of the starting point from a value of the ordinate to obtain a difference value corresponding to the initial abscissa; and aiming at the difference values corresponding to all the initial abscissas, determining the initial abscissas with the maximum difference value as the target abscissas.
The device for determining the position parameters of the edge wave defects provided by the embodiment of the application comprises: an obtaining module 301, configured to obtain a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image; a determining module 302, configured to count a sum of pixels of all pixel points in the ordinate or in the abscissa with respect to each ordinate or abscissa in the rectangular coordinate system; the determining module 302 is further configured to determine a position coordinate of a starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; the determining module 302 is further configured to determine a position coordinate of an end point of the edge wave defect according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; the determining module 302 is further configured to determine a position coordinate of a highest point of the edge wave defect according to the position coordinate of the starting point and an abscissa in the position coordinate of the end point. The position coordinates of the starting point of the edge wave defect are determined through the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image; then, determining the position coordinates of the end point of the edge wave defect according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image; and finally, determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point, so that the position parameter of the edge wave defect can be accurately determined, and the economic loss of a steel mill is reduced.
As shown in fig. 4, an electronic device 400 provided in an embodiment of the present application includes: a processor 401, a memory 402 and a bus, wherein the memory 402 stores machine-readable instructions executable by the processor 401, when the electronic device is running, the processor 401 communicates with the memory 402 via the bus, and the processor 401 executes the machine-readable instructions to execute the steps of the method for determining the position parameter of the edge wave defect as described above.
Specifically, the memory 402 and the processor 401 may be general-purpose memories and processors, which are not limited in particular, and when the processor 401 runs a computer program stored in the memory 402, the method for determining the location parameter of the edge wave defect may be performed.
Corresponding to the method for determining the position parameters of the edge wave defect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the method for determining the position parameters of the edge wave defect is performed.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the information processing method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. A method for determining the position parameters of the edge wave defects is characterized by comprising the following steps:
acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image;
for each ordinate or abscissa in the rectangular coordinate system, counting pixel sums of all pixel points under the ordinate or the abscissa;
determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image;
determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image;
and determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point.
2. The method for determining the position parameters of the edge wave defect according to claim 1, wherein the determining the position coordinates of the starting point of the edge wave defect according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image comprises:
for the pixel sums corresponding to all the vertical coordinates, determining the vertical coordinate with the pixel sum as the maximum value as the horizontal coordinate of the starting point;
determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the starting point according to the abscissa of the starting point and the ordinate of the starting point.
3. The method for determining the position parameters of the edge wave defect according to claim 2, wherein the determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all the pixel points in the binary image comprises:
selecting initial pixel points with the same abscissa of the pixel points as the abscissa of the starting point from the binary image;
aiming at all initial pixel points, determining the initial pixel points with the pixel value of 255 as target pixel points;
and aiming at the vertical coordinates of all target pixel points, determining the vertical coordinate with the value of the vertical coordinate as the middle value as the vertical coordinate of the starting point.
4. The method for determining the position parameters of the edge wave defect according to claim 1, wherein the determining the position coordinates of the end point of the edge wave defect according to the pixel values of all the pixels corresponding to all the abscissa and all the pixel points in the binary image comprises:
determining the abscissa of the pixel sum which is not 0 as an initial abscissa for the pixel sum corresponding to all abscissas;
for all the initial abscissas, determining the initial abscissas of which the initial abscissas have the minimum value as the abscissas of the end point;
determining the vertical coordinate of the end point according to the horizontal coordinate of the end point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the end point according to the abscissa of the end point and the ordinate of the end point.
5. The method for determining the position parameter of the edge wave defect according to claim 1, wherein the determining the position coordinate of the highest point of the edge wave defect according to the abscissa of the position coordinates of the starting point and the ending point comprises:
determining all initial abscissas between the abscissas in the position coordinates of the starting point and the abscissas in the position coordinates of the end point;
aiming at each initial abscissa, determining an ordinate corresponding to the initial abscissa according to the initial abscissa and pixel values of all pixel points in the binary image;
determining a target abscissa of the highest point according to the ordinates corresponding to all the initial abscissas and the ordinates in the position coordinates of the starting point;
determining the ordinate of the highest point according to the target abscissa of the highest point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the highest point according to the target abscissa of the highest point and the ordinate of the highest point.
6. The method for determining the position parameters of the edge wave defect according to claim 5, wherein the determining the target abscissa of the highest point according to the ordinates corresponding to all the initial abscissas and the ordinate in the position coordinates of the starting point comprises:
for the ordinate corresponding to each initial abscissa, subtracting the ordinate value in the position coordinate of the starting point from the ordinate value to obtain a difference value corresponding to the initial abscissa;
and aiming at the difference values corresponding to all the initial abscissas, determining the initial abscissas with the maximum difference value as the target abscissas.
7. A device for determining the position parameters of a boundary wave defect is characterized by comprising:
the acquisition module is used for acquiring a binary image of the edge wave defect image; taking the lower left corner of the binary image as an origin and the horizontal right corner as the positive direction of an X axis, and establishing a rectangular coordinate system on the binary image;
the determining module is used for counting the pixel sum of all pixel points under the ordinate or the abscissa aiming at each ordinate or abscissa in the rectangular coordinate system;
the determining module is further used for determining the position coordinates of the starting points of the edge wave defects according to the pixels corresponding to all the vertical coordinates and the pixel values of all the pixel points in the binary image;
the determining module is further used for determining the position coordinates of the end points of the edge wave defects according to the pixels corresponding to all the abscissa coordinates and the pixel values of all the pixel points in the binary image;
and the determining module is further used for determining the position coordinate of the highest point of the edge wave defect according to the position coordinate of the starting point and the abscissa in the position coordinate of the end point.
8. The device for determining the location parameter of the edge wave defect according to claim 7, wherein the determining module is specifically configured to:
for the pixel sums corresponding to all the vertical coordinates, determining the vertical coordinate with the pixel sum as the maximum value as the horizontal coordinate of the starting point;
determining the ordinate of the starting point according to the abscissa of the starting point and the pixel values of all pixel points in the binary image;
and obtaining the position coordinate of the starting point according to the abscissa of the starting point and the ordinate of the starting point.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method for determining a position parameter of a wave defect according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the method for determining a location parameter of a boundary wave defect according to any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210945000.3A CN115311350A (en) | 2022-08-08 | 2022-08-08 | Method and device for determining position parameters of edge wave defects, electronic equipment and medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210945000.3A CN115311350A (en) | 2022-08-08 | 2022-08-08 | Method and device for determining position parameters of edge wave defects, electronic equipment and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115311350A true CN115311350A (en) | 2022-11-08 |
Family
ID=83860294
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210945000.3A Pending CN115311350A (en) | 2022-08-08 | 2022-08-08 | Method and device for determining position parameters of edge wave defects, electronic equipment and medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115311350A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115719341A (en) * | 2022-11-21 | 2023-02-28 | 北京远舢智能科技有限公司 | Edge wave defect detection method and device, electronic equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009116689A (en) * | 2007-11-07 | 2009-05-28 | Canon Inc | Image processing apparatus, image processing method, image processing program, and program recording medium |
| CN103778445A (en) * | 2014-01-21 | 2014-05-07 | 武汉科技大学 | Cold-rolled strip steel surface defect reason analyzing method and system |
| CN106485207A (en) * | 2016-09-21 | 2017-03-08 | 清华大学 | A kind of Fingertip Detection based on binocular vision image and system |
| CN207907815U (en) * | 2018-02-23 | 2018-09-25 | 山东泰山钢铁集团有限公司 | Edge of Steel Strip wave on-line detector |
| CN113962997A (en) * | 2021-12-22 | 2022-01-21 | 武汉同顺源钢构钢模有限公司 | Strip steel edge crack defect detection method and system based on image processing |
-
2022
- 2022-08-08 CN CN202210945000.3A patent/CN115311350A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009116689A (en) * | 2007-11-07 | 2009-05-28 | Canon Inc | Image processing apparatus, image processing method, image processing program, and program recording medium |
| CN103778445A (en) * | 2014-01-21 | 2014-05-07 | 武汉科技大学 | Cold-rolled strip steel surface defect reason analyzing method and system |
| CN106485207A (en) * | 2016-09-21 | 2017-03-08 | 清华大学 | A kind of Fingertip Detection based on binocular vision image and system |
| CN207907815U (en) * | 2018-02-23 | 2018-09-25 | 山东泰山钢铁集团有限公司 | Edge of Steel Strip wave on-line detector |
| CN113962997A (en) * | 2021-12-22 | 2022-01-21 | 武汉同顺源钢构钢模有限公司 | Strip steel edge crack defect detection method and system based on image processing |
Non-Patent Citations (3)
| Title |
|---|
| LEI ZHAO ET.AL: "Vision-based edge wave detection for cold-rolled steel plate using 3D camera" * |
| 付维娜 等, 西安电子科技大学出版社 * |
| 吴晓君;唐婷;张林;蔡君义;: "基于机器视觉技术的表面缺陷在线检测系统设计" * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115719341A (en) * | 2022-11-21 | 2023-02-28 | 北京远舢智能科技有限公司 | Edge wave defect detection method and device, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106683075B (en) | A method for detecting bolt defects at the cross arm of a transmission line tower | |
| CN110443243B (en) | Water level monitoring method, storage medium, network device and water level monitoring system | |
| JP6570296B2 (en) | Image processing apparatus, image processing method, and program | |
| CN110660072B (en) | Method and device for identifying straight line edge, storage medium and electronic equipment | |
| US20240020846A1 (en) | Corner point detection method and apparatus | |
| CN110706229B (en) | Method and device for determining laser stripe center, electronic equipment and storage medium | |
| CN107909571A (en) | A kind of weld beam shape method, system, equipment and computer-readable storage medium | |
| CN111105452B (en) | Binocular vision-based high-low resolution fusion stereo matching method | |
| CN113362238B (en) | Test image processing method, device, electronic equipment and storage medium | |
| CN111985338A (en) | Binding point identification method, device, terminal and medium | |
| CN112669295A (en) | Lithium battery pole piece defect detection method based on secondary threshold segmentation theory | |
| CN107730521B (en) | Method for rapidly detecting ridge type edge in image | |
| CN111814673A (en) | Method, device and equipment for correcting text detection bounding box and storage medium | |
| CN113920073B (en) | Thin card counting method, device, electronic equipment and storage medium | |
| CN115311350A (en) | Method and device for determining position parameters of edge wave defects, electronic equipment and medium | |
| CN116152261B (en) | Visual inspection system for quality of printed product | |
| CN107977649B (en) | Obstacle identification method and device and terminal | |
| CN116071272A (en) | Image correction method and device, electronic equipment and storage medium thereof | |
| CN115482239A (en) | Image positioning method, system, device and medium | |
| CN118365643B (en) | Surface defect detection method and device, storage medium and electronic terminal | |
| CN115830049A (en) | Corner point detection method and device | |
| CN117173185B (en) | Method and device for detecting area of rolled plate, storage medium and computer equipment | |
| CN111160074B (en) | Method, device, computer equipment and storage medium for identifying foreign matter inside equipment | |
| CN112528741A (en) | State identification method and device for transformer substation pressure plate | |
| CN111768422A (en) | Edge detection processing method, device, equipment and storage medium |
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 | ||
| CB03 | Change of inventor or designer information | ||
| CB03 | Change of inventor or designer information |
Inventor after: Li Xiaolong Inventor before: Li Xiaolong Inventor before: Zhao Lei |
|
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20221108 |