Laser scanning-based online stone sorting method for conveyor belt
Technical Field
The invention relates to the technical field of image processing and automatic monitoring, in particular to a laser scanning-based online stone sorting method for a conveyor belt.
Background
Under the new trend of the current scientific and technological economic development and the requirement of local development, the reform of the mining technology must face the economic construction main battlefield, and the real problems in the mining industry are solved by the necessary technical reserves of the mining development strategy in China. At present, the working environment of mining industry is severe, the health of workers is greatly influenced by environments such as high temperature, high pressure, dustiness and the like, a large number of casualties can be caused by sudden accidents, and a large amount of economic loss is brought to companies. At present, in actual production, the method mainly depends on manual intervention, the abnormal samples in the conveyer belt are always kept, the conveyer belt is manually removed, the requirement on manual work is high, the conveyer belt needs to be shut down under special conditions, and the production efficiency is greatly reduced.
Disclosure of Invention
The invention aims to solve the technical problem of providing an online stone sorting method based on laser scanning for a conveyor belt, aiming at the defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows:
the invention provides a laser scanning-based online stone sorting method for a conveyor belt, which comprises the following steps:
s1, adjusting camera parameters including acquired contrast, camera exposure and gain, and acquiring images of laser rays irradiated on a transmission belt stone in real time; recording time information corresponding to the image and the fixed movement speed of the conveying belt;
s2, carrying out color space model conversion on the acquired image by adopting multithreading, and converting the RGB color space into an LAB color space;
s3, performing channel stretching transformation processing on the image converted into the LAB color space, stretching the L component to 0-100, stretching the A component to 0-255 and stretching the B component to 0-255;
s4, performing different processing according to the color of laser emitted by the laser, wherein the color of the laser comprises red, green and blue, and extracting the result of the channel enhancement through a weighting coefficient on the image after the channel stretching transformation;
s5, calculating the center position of the laser through template difference and curvature feature extraction on the image subjected to channel enhancement processing to obtain a single-pixel result graph of the laser;
s6, carrying out projection transformation on the single-pixel result image and removing noise;
s7, traversing the denoised single-pixel result image to obtain two-dimensional coordinates (X, Y) of the image of the laser line;
s8, calculating the distance between frames according to the time information corresponding to the image acquired in the step S1 and the fixed movement speed of the transmission belt, wherein the distance is the distance in the movement direction;
s9, converting the point (X, Y) corresponding to the two-dimensional coordinate of each image in the step S7 into a three-dimensional space coordinate (X, Y, Z) through a laser line deformation rule and the distance in the movement direction;
s10, performing three-dimensional point cloud management by adopting a PCL point cloud library according to the three-dimensional space coordinates of all the points to form a three-dimensional space model;
s11, carrying out spatial point cloud filtering on the three-dimensional point cloud in the three-dimensional space model to remove impurities;
and S12, extracting height and area information of the stone according to the three-dimensional space model, comparing the height and area information with a set threshold value, judging whether the stone is a target-shaped stone, and outputting coordinate information of the target stone.
Further, the method for performing the channel enhancement processing in step S4 of the present invention is:
according to different laser colors, the coefficients of enhanced channel extraction are: m is0、m1And m is0+m1=1;
Enhancing a point P in the processed image(i,j)Corresponding to LAB channelsThe values are l, a, b, respectively; then the processing enhancement channel results in: p'(i,j)=m1*a+m2*b。
Further, the method of performing template difference processing in step S5 of the present invention is:
s51, carrying out template difference on m columns of the image after channel enhancement processing, carrying out three-order backward difference on the pixels of the columns, adopting templates (3, -1, -1, -1) to carry out template difference on the current point P
(i,m)The starting processing formula is as follows:
s52, for all f on the row(i,m)Forming a one-dimensional array F in the direction of increasing imI.e. the difference curve;
s53, pair difference curve FmCarrying out curvature transformation to find the maximum peak value fmaxAnd maximum valley peak fmin,Two points are at FmThe middle subscripts are p and q respectively;
s54, the center position of the laser is Indexm=(p+q)/2;
S55, using the center position (Index) of each columnmM) single pixel extraction result map of the constituent lasers.
Further, the method for performing projective transformation in step S6 of the present invention is:
s61, projecting the M multiplied by N single-pixel result graph in the Y direction, and calculating a formula:
wherein f (i, j) represents the ith column and the jth row of the single-pixel result diagram;
s62, finding out the left and right boundaries Y of the area where the laser line is located by searching the projected gray value curveminAnd Ymax;
S63, setting the ordinate in the image between 0 and YminAnd YmaxAnd setting all gray values of the region between N to be zero, and removing noise points.
Further, the method for traversing the single-pixel result image to obtain the two-dimensional coordinates of the image in step S7 of the present invention is as follows:
s71, traversing the single-pixel result graph according to columns, wherein each column only has at most one non-zero value;
s72, when the ith column is traversed, recording a row number j corresponding to a value which is not zero;
and S73, storing the (i, j) into an array, and continuing traversing the next column until the whole image is searched, and acquiring the two-dimensional coordinates of the image is completed.
Further, the method for calculating the distance between frames in step S8 of the present invention is as follows:
s81, the time of the last frame of image collected by the system is T0The moment of acquiring the current frame image is T1The fixed moving speed of the transmission belt shaft is V0(ii) a The distance in the direction of motion is then: deltad=(T1-T0)*V0。
Further, the method for converting the two-dimensional coordinates into the three-dimensional space coordinates in step S9 of the present invention is:
s91, the laser is installed to form an angle theta with the camera, and the calibration value of the current laser line is HbaseThe Pixel resolution of the camera is Pixel, and the two-dimensional coordinate of the current conversion point is (x)0,y0) The coordinates after the conversion is successful are (X, Y, Z);
s92, the coordinate of the current point in the moving direction is X ═ Δd;
S93, the coordinate Y of the current point is x0;
S94, height Z of current point is ((H)base-y0)*Pixel)/tanθ;
S95、(x0,y0) The coordinates after the conversion are (X, Y, Z).
Further, the method for extracting the height and area information of the stone and setting the threshold value for comparison and judgment in step S12 of the present invention is:
s121, setting a height threshold value HtScreening the whole point cloud space dataThe current point A coordinate is (x)0,y0,z0);
S122, if z0Greater than HtThen x of point A is added0,y0Stored in the depth map M with the corresponding gray value z0(ii) a If z is0Is less than HtIf yes, no treatment is carried out;
s123, detecting a connected domain in the depth map M, and enabling the area of the connected domain to be larger than a threshold value StArea block mark of (1);
and S124, outputting the center position of the marked area block, and displaying the corresponding point on the three-dimensional point cloud in a pseudo color mode.
The invention has the following beneficial effects: according to the laser scanning-based online stone sorting method for the conveyor belt, the stone area information can be detected online in real time while the conveyor belt runs at a high speed; the area information of the stone passing through the laser line and the high-speed camera at high speed can be detected; the invention has simple hardware, does not need manual operation and is very simple and convenient; the measured target ore information can be fed back to the target stone grabbing machine in real time, so that the target stone can be grabbed in real time, and the production line can be guaranteed to be smoothly carried out; the problem that personnel cannot watch for a long time under a severe environment is solved; the casualty problem caused by sudden accidents is solved; the problem that the follow-up process cannot continue to operate after different samples are met is solved, and the problem of low production efficiency is solved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of an on-line stone sorting algorithm based on laser scanning according to an embodiment of the present invention;
FIG. 2 is a laser imaging image acquired by a camera in real time according to an embodiment of the present invention;
FIG. 3 is a LAB color space conversion diagram according to an embodiment of the present invention;
FIG. 4 is a graph illustrating the results of channel stretching and strengthening processes performed on FIG. 3 according to an embodiment of the present invention;
FIG. 5 is a graph of a row of difference curves calculated based on FIG. 4 according to an embodiment of the present invention;
FIG. 6 shows the result of single-pixel laser extraction based on FIG. 5 according to an embodiment of the present invention;
FIG. 7 is a diagram of convex hull detection input in accordance with an embodiment of the present invention;
fig. 8 is a diagram of the result of the detection algorithm identifying the target stone on the basis of fig. 7.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, the method for sorting stones on line by using a conveyor belt based on laser scanning according to an embodiment of the present invention includes: the system comprises a laser transmitter, an industrial high-speed camera, a computer and an acquisition system bracket; the camera is vertically installed downwards, and the laser and the camera are installed at an angle beta; the laser irradiates the surface of the transmission belt, and the camera acquires an imaging result in real time through callback and transmits the imaging result to a computer application program through a serial port line; the application adopts multiple threads to process data in real time; and analyzing and comparing the processing result, and outputting a detection result at the terminal.
The method comprises the following steps:
s1, adjusting camera parameters, improving the acquired contrast, reducing the exposure and gain of the camera, and acquiring images of laser rays irradiated on a transmission belt stone in real time; recording time information corresponding to the image and the fixed movement speed of the conveying belt;
s2, carrying out color space model conversion on the acquired image by adopting multithreading, and converting the RGB color space into an LAB color space;
s3, performing channel stretching transformation processing on the image converted into the LAB color space, stretching the L component to 0-100, stretching the A component to 0-255 and stretching the B component to 0-255;
s4, performing different processing according to the color of laser emitted by the laser, wherein the color of the laser comprises red, green and blue, and extracting the result of the channel enhancement through a weighting coefficient on the image after the channel stretching transformation;
the method for performing the channel enhancement processing in step S4 includes:
according to different laser colors, the coefficients of enhanced channel extraction are: m is0、m1And m is0+m1=1;
Enhancing a point P in the processed image(i,j)The values corresponding to the LAB channel are 1, a, b, respectively; then the processing enhancement channel results in: p'(i,j)=m1*a+m2*b。
S5, calculating the center position of the laser through template difference and curvature feature extraction on the image subjected to channel enhancement processing to obtain a single-pixel result graph of the laser;
the method of performing template difference processing in step S5 is:
s51, carrying out template difference on m columns of the image after channel enhancement processing, carrying out three-order backward difference on the pixels of the columns, adopting templates (3, -1, -1, -1) to carry out template difference on the current point P
(i,m)The starting processing formula is as follows:
s52, for all f on the row(i,m)Forming a one-dimensional array F in the direction of increasing imI.e. the difference curve;
s53, pair difference curve FmCarrying out curvature transformation to find the maximum peak value fmaxAnd maximum valley peak fmin,Two points are at FmThe middle subscripts are p and q respectively;
s54, the center position of the laser is Indexm=(p+q)/2;
S55, using the center position (Index) of each columnmM) single pixel extraction result map of the constituent lasers.
S6, carrying out projection transformation on the single-pixel result image to remove noise;
the method for performing projective transformation in step S6 includes:
s61, projecting the M multiplied by N single-pixel result graph in the Y direction, and calculating a formula:
wherein f (i, j) represents the ith column and the jth row of the single-pixel result diagram;
s62, finding out the left and right boundaries Y of the area where the laser line is located by searching the projected gray value curveminAnd Ymax;
S63, setting the ordinate in the image between 0 and YminAnd YmaxAnd setting all gray values of the region between N to be zero, and removing noise points.
S7, traversing the denoised single-pixel result image to obtain two-dimensional coordinates (X, Y) of the image of the laser line;
the method for traversing the single-pixel result image to acquire the two-dimensional coordinates of the image in the step S7 includes:
s71, traversing the single-pixel result graph according to columns, wherein each column only has at most one non-zero value;
s72, when the ith column is traversed, recording a row number j corresponding to a value which is not zero;
and S73, storing the (i, j) into an array, and continuing traversing the next column until the whole image is searched, and acquiring the two-dimensional coordinates of the image is completed.
S8, calculating the distance between frames according to the time information corresponding to the image acquired in the step S1 and the fixed movement speed of the transmission belt, wherein the distance is the distance in the movement direction;
the method for calculating the distance between frames in step S8 includes:
s81, the time of the last frame of image collected by the system is T0The moment of acquiring the current frame image is T1The fixed moving speed of the transmission belt shaft is V0(ii) a The distance in the direction of motion is then: deltad=(T1-T0)*V0。
S9, converting the point (X, Y) corresponding to the two-dimensional coordinate of each image in the step S7 into a three-dimensional space coordinate (X, Y, Z) through a laser line deformation rule and the distance in the movement direction;
the method for converting the two-dimensional coordinates into the three-dimensional space coordinates in step S9 includes:
s91, the laser is installed to form an angle theta with the camera, and the calibration value of the current laser line is HbaseThe Pixel resolution of the camera is Pixel, and the two-dimensional coordinate of the current conversion point is (x)0,y0) The coordinates after the conversion is successful are (X, Y, Z);
s92, the coordinate of the current point in the moving direction is X ═ Δd;
S93, the coordinate Y of the current point is x0;
S94, height Z of current point is ((H)base-y0)*Pixel)/tanθ;
S95、(x0,y0) The coordinates after the conversion are (X, Y, Z).
S10, performing three-dimensional point cloud management by adopting a PCL point cloud library according to the three-dimensional space coordinates of all the points to form a three-dimensional space model;
s11, carrying out spatial point cloud filtering on the three-dimensional point cloud in the three-dimensional space model to remove impurities;
and S12, extracting height and area information of the stone according to the three-dimensional space model, comparing the height and area information with a set threshold value, judging whether the stone is a target-shaped stone, and outputting coordinate information of the target stone.
The method for extracting the height and area information of the stone and setting the threshold value for comparison and judgment in the step S12 is as follows:
s121, setting a height threshold value HtScreening the whole point cloud space data, wherein the coordinate of the current point A is (x)0,y0,z0);
S122, if z0Greater than HtThen x of point A is added0,y0Stored in the depth map M with the corresponding gray value z0(ii) a If z is0Is less than HtIf yes, no treatment is carried out;
s123, detecting a connected domain in the depth map M, and enabling the area of the connected domain to be larger than a threshold value StArea block mark of (1);
and S124, outputting the center position of the marked area block, and displaying the corresponding point on the three-dimensional point cloud in a pseudo color mode.
The laser scanning-based online stone sorting method for the conveyor belt has the following advantages:
1. the ore area information can be detected on line in real time while the conveyor belt runs at a high speed;
2. the area information of ore passing through a laser line and a high-speed camera at high speed can be detected; the hardware is simple, manual operation is not needed, and the operation is very simple and convenient;
3. can give the target ore machine of snatching with the target ore information real-time feedback of measurement to this snatchs target ore in real time, guarantees going on smoothly of production line.
4. The problem that personnel cannot watch for a long time under a severe environment is solved;
5. the casualty problem caused by sudden accidents is solved;
6. the problem that the follow-up process cannot continue to operate after different samples are met is solved, and the problem of low production efficiency is solved.
It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.