A hydraulic frame recognition and positioning method based on Hough transform
By using a hydraulic frame identification and positioning method based on Hough transform, the problem of high-precision identification and positioning of hydraulic frames in complex environments was solved, enabling automatic gripping and sandblasting loading, and improving identification accuracy and work efficiency.
Patent Information
- Application Number
- CN202210381841.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-04-13
AI Technical Summary
During the production and sandblasting loading of hydraulic frames, existing technologies struggle to achieve high-precision identification and positioning of hydraulic frames in complex environments, especially in stacked situations where features are easily obscured or interfered with, increasing the difficulty of identification.
A method based on Hough transform is adopted, which calculates the intersection coordinates to locate the center point of the hydraulic frame through image preprocessing, edge detection, line deduplication and grouping, and combined with robot control to achieve automatic grasping.
It achieves high-precision identification and center positioning of hydraulic vehicle frames, improves identification accuracy, is suitable for complex environments, saves labor costs, and improves work efficiency and safety performance.
Smart Images

Figure CN116012441B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image-based object recognition technology, and in particular to a hydraulic vehicle frame recognition and positioning method based on Hough transform. Background Technology
[0002] In the production of hydraulic frames and the sandblasting loading process, these tasks are highly repetitive, require high precision, and involve heavy loads. Furthermore, the work often takes place in complex environments with high noise levels and harmful gases. Compared to manual labor, robots offer higher precision, efficiency, and safety.
[0003] The identification and positioning of the hydraulic frame is fundamental for the robot control system to enable the robotic arm to automatically grasp and load the hydraulic frame. During image recognition, because the hydraulic frames are stacked and placed within a frame, the exposed features of the lower frames can easily cause interference when recognizing the upper frames (e.g., ...). Figure 2 As shown), when identifying the lower frame, the most prominent protruding part of the hydraulic frame is easily obscured by the frame frame (e.g., Figure 3 As shown in the figure, the surface of the upper and lower frame has oxidation and rust, uneven lighting, reflection, and uneven stacking, which increases the difficulty of edge recognition and segmentation.
[0004] Image processing-based recognition and positioning technology is being used more and more widely in industrial automation inspection, but its application to hydraulic frames is relatively limited. It is difficult to achieve automated recognition and positioning in complex real-world scenarios. Therefore, choosing a reasonable recognition feature and detection method is particularly important. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a hydraulic frame identification and positioning method based on Hough transform, which enables the identification and positioning of stacked hydraulic frames of different models under complex conditions, thereby achieving automatic gripping of hydraulic frames.
[0006] To achieve the above objectives, the present invention provides a hydraulic vehicle frame identification and positioning method based on Hough transform, comprising:
[0007] Acquire the original image of the hydraulic frame and preprocess the original image;
[0008] The edges of the original image are extracted to obtain an edge image, and straight lines in the edge image are detected based on Hough transform.
[0009] The detected straight lines in the edge image are subjected to deduplication and extension operations.
[0010] Grouping rules are established for the extended straight lines, and pairs of lines are formed so that each pair consists of two straight lines of the same hydraulic frame. The coordinates of the intersection point of the two straight lines are then calculated.
[0011] The center point pixel coordinates of the hydraulic frame are obtained based on the intersection coordinates and the dimensions of the hydraulic frame, thus completing the positioning of the hydraulic frame.
[0012] As a further improvement of the present invention
[0013] Initially, raw images of the hydraulic frame were acquired using a camera;
[0014] After obtaining the center point pixel coordinates, the center point pixel coordinates are converted into camera coordinates according to the camera parameters;
[0015] The camera coordinates are then converted into robot coordinates. The robot controls the movement of the end effector of the robotic arm according to the robot coordinates to complete the gripping of the hydraulic frame and deliver the hydraulic frame to the roller line of the sandblasting equipment.
[0016] As a further improvement of the present invention, the original image is preprocessed, including: performing grayscale processing, image enhancement processing and filtering processing in sequence.
[0017] As a further improvement of the present invention, the edges of the original image are extracted using the Canny edge detection method to obtain an edge image;
[0018] The Canny edge detection method uses a Gaussian smoothing filter to convolve with the original image for noise reduction.
[0019] As a further improvement of the present invention, the detection of straight lines in the edge image based on Hough transform includes:
[0020] Calculate all pixels (x, y) on the edge image using the polar coordinate equation ρ = xcos(θ) + ysin(θ) based on the Hough transform. I ,y i The ρ value of )
[0021] Accumulate the number of times the ρ value occurs, and set a threshold T;
[0022] When the number of times the value of ρ appears is greater than the set threshold T, the values of ρ and θ are obtained to obtain a line segment in the edge image.
[0023] As a further improvement of the present invention, the detected straight lines in the edge image are subjected to deduplication filtering and extension operations, including:
[0024] Detect the x and y coordinates of the two endpoints of all straight lines and calculate the angle of inclination;
[0025] Filter all lines to obtain lines whose tilt angles conform to the preset tilt angle range;
[0026] Lines that meet the preset tilt angle range are sorted in descending order of tilt angle. Lines with a tilt angle difference of less than 3° are considered to be the same line. The line with the larger tilt angle is removed to complete the deduplication filtering.
[0027] Extend all the straight lines after deduplication and filtering.
[0028] As a further improvement of the present invention
[0029] Calculate the slope k and intercept b of each line based on the x and y coordinates of its two endpoints.
[0030] The inclination angle α of the line can be obtained using the arctangent formula α = arctan(-k) * π.
[0031] As a further improvement of the present invention, the step of grouping the extended straight lines into pairs, such that each pair consists of two straight lines of the same hydraulic frame, and determining the coordinates of the intersection point of the two straight lines, includes:
[0032] Based on the slopes k>0 and k<0, the extended straight line is divided into the left and right straight lines of the hydraulic frame;
[0033] Based on the ordinate of the right endpoint of the left straight line and the ordinate of the left endpoint of the right straight line, the two closest straight lines are grouped together, and each group consists of two straight lines of the same hydraulic frame.
[0034] Find the coordinates of the intersection point of two lines in the same group.
[0035] As a further improvement of the present invention, based on the coordinates of the intersection point and the fixed length and width of the hydraulic frame, the distance from the intersection point of the two straight lines in the same group to the longitudinal center point of the hydraulic frame is obtained as Δy.
[0036] The formula for calculating the pixel coordinates of the center point of the hydraulic frame is:
[0037] x′0=x0
[0038] y′0=y0+Δy
[0039] in,
[0040] x0, y0 represent the coordinates of the intersection point of two lines in the same group;
[0041] x′0, y′0 represent the pixel coordinates of the center point of the hydraulic frame.
[0042] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0043] This invention relates to a hydraulic frame identification and positioning method based on Hough transform. The method preprocesses acquired images using a computer, performs line detection based on an improved Hough transform, then filters and removes duplicates, establishes line grouping rules, and calculates the intersection points of lines in each hydraulic frame. Finally, it obtains the center point of the hydraulic frame, achieving high-precision line detection and center positioning of the hydraulic frame. This method is applicable to hydraulic frame production and sandblasting loading processes, enabling robots to transfer hydraulic frames from the frame to the roller line, saving labor costs and improving work efficiency and safety.
[0044] This invention overcomes the complex environment of the production site and the adverse conditions of regeneration such as uneven lighting and color of the hydraulic frame, thereby improving the accuracy of hydraulic frame identification and achieving precise positioning of the center point of the hydraulic frame. Attached Figure Description
[0045] Figure 1 This is a flowchart of a hydraulic vehicle frame identification and positioning method based on Hough transform, as disclosed in one embodiment of the present invention.
[0046] Figure 2 This is a schematic diagram of the stacking of the upper hydraulic frame in the production workshop frame disclosed in the background technology of this invention;
[0047] Figure 3 This is a schematic diagram of the stacking of the lower hydraulic frame in the production workshop frame disclosed in the background technology of this invention;
[0048] Figure 4 This is a top view of a hydraulic frame disclosed in one embodiment of the present invention;
[0049] Figure 5 This is a schematic diagram of a hydraulic frame inside a frame, as shown in an embodiment of the present invention;
[0050] Figure 6 This is a visual algorithm for hydraulic vehicle frame identification and positioning based on Hough transform disclosed in one embodiment of the present invention;
[0051] Figure 7 This is a preprocessed edge image disclosed in one embodiment of the present invention;
[0052] Figure 8 This is an image obtained by denoising an edge image using a Gaussian filter, as disclosed in one embodiment of the present invention.
[0053] Figure 9 This is a schematic diagram of a hydraulic vehicle frame linear coordinate system analysis model disclosed in one embodiment of the present invention;
[0054] Figure 10 This is a schematic diagram of a method for detecting straight lines in an image of a hydraulic frame edge based on Hough transform, as disclosed in an embodiment of the present invention.
[0055] Figure 11 for Figure 10 Based on limiting the range of tilt angles, a schematic diagram of the obtained straight lines is selected;
[0056] Figure 12 for Figure 11 A schematic diagram of the straight line obtained after removing duplicates based on the original data;
[0057] Figure 13 for Figure 12 A schematic diagram of a straight line obtained by extending and supplementing the original straight line;
[0058] Figure 14 for Figure 13 A schematic diagram showing the pairwise grouping of the center line;
[0059] Figure 15 This is a schematic diagram of a robot's four-legged magnetic suction cup gripping a hydraulic frame according to the center point of the hydraulic frame, as disclosed in one embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] The present invention will now be described in further detail with reference to the accompanying drawings:
[0062] To address the challenge of identifying the upper and lower stacked hydraulic frames separately, as mentioned in the background art, this application analyzes the hydraulic frame model, such as... Figure 4 , 5 As shown, based on the characteristic straight lines A and B on both sides of the hydraulic frame, there is a universality and ease of implementation for identifying the upper and lower frames; these are used as the unique feature points for identification. Figure 4 As shown, O′ is the center point of the hydraulic frame, which is the final target point.
[0063] In reality, by stacking hydraulic frames and adjusting the installation position and angle of the camera, the A and B lines in the captured image can be made to exhibit a tilted characteristic, as shown in the image model. Figure 5As shown, based on the fact that there is an angle greater than 0 between the inclined straight line and the horizontal line, this paper proposes a straight line detection method based on the improved angle-constrained probabilistic Hough Transform (PPHT). By identifying edge lines A and B, the coordinates O of the intersection point of the two lines are obtained. Then, combined with the known dimensions of the hydraulic frame, the center point O′ of the hydraulic frame is obtained. Finally, in conjunction with a sandblasting loading robot, it can automatically adjust its four-foot suction cups to complete the gripping work. Figure 15 As shown.
[0064] like Figure 1 , 6 As shown, the present invention provides a hydraulic vehicle frame identification and positioning method based on Hough transform, comprising:
[0065] (1) Obtain the original image of the hydraulic frame, and preprocess the original image. The preprocessed image is as follows: Figure 7 As shown;
[0066] in,
[0067] The original image of the hydraulic frame is acquired by a camera, and the original image is then processed sequentially with grayscale, image enhancement and filtering.
[0068] Furthermore,
[0069] Image enhancement is achieved by performing histogram equalization on the grayscale image; Gaussian filtering is used to suppress noise and smooth the image; specifically, this includes:
[0070] 1) Calculate the pixel probability distribution of the grayscale processed image, obtain the cumulative distribution function based on the pixel probability distribution, and then obtain the transformed image based on the mapping function. The cumulative distribution function is a single-increasing function with a range of 0 to 1. The mapping method during histogram equalization is:
[0071]
[0072] Where n is the sum of the number of pixels in the image, n k L is the number of pixels at the current gray level, and L is the total number of possible gray levels in the image.
[0073] 2) Use a Gaussian smoothing filter for convolutional noise reduction. The images before and after filtering are as follows: Figure 7 , 8 As shown, the filter equation is as follows:
[0074]
[0075] Where G represents the element value of the Gaussian filter template, σ is the standard deviation, k is a positive integer, and i and j are the coordinates of the template elements.
[0076] (2) Extract the edges of the original image to obtain the edge image, and detect straight lines in the edge image based on Hough transform;
[0077] in,
[0078] The Canny edge detection method is used, and Gaussian filters are used to convolve the image for noise reduction to extract the edges of the original image.
[0079] Pre-create an accumulator for a two-dimensional matrix M, where M(ρ,θ) represents a Hough space with dimension M, and initialize all units to zero.
[0080] Calculate all pixels (x, y) on the edge image using the polar coordinate equation ρ = xcos(θ) + ysin(θ) based on the Hough transform. I ,y i The ρ value of )
[0081] The number of times the ρ value appears is accumulated by an accumulator, and a threshold T is set to indicate that T curves intersect in the polar coordinate plane.
[0082] The algorithm iterates through all pairs of accumulators M. When the value of M(ρ,θ) is greater than a set threshold T (i.e., the number of times ρ appears is greater than the set threshold T), the values of ρ and θ are obtained, resulting in a line segment in the edge image. This process is repeated until all lines are obtained. The result is as follows: Figure 10 As shown.
[0083] (3) Perform deduplication and extension operations on the lines detected in the edge image;
[0084] in,
[0085] 1) Linear coordinate analysis and statistical coordinate analysis
[0086] Transform the linear coordinates back to the form y = kx + b, and store the x and y coordinates of all endpoints of the line in the form [x1, y1, x2, y2] in the linear matrix Ls for subsequent line filtering and grouping. Here, X1 and y1 represent the x and y coordinates of the left end of the line, respectively, and X2 and y2 represent the x and y coordinates of the right end of the line, respectively. The linear coordinate system analysis model of the hydraulic frame is as follows: Figure 9 As shown.
[0087] 2) Calculate the tilt angle
[0088] Calculate the slope k and intercept b of the line based on the x and y coordinates of the two endpoints of each line, and obtain the inclination angle α of the line using the arctangent formula α = arctan(-k) * π.
[0089] 3) Limit the range of tilt angles and filter straight lines.
[0090] Based on a large number of stacked hydraulic frame images, the straight line tilt angle α is adjusted to filter straight lines. That is, as shown... Figure 10 The image shown is a stacked hydraulic frame diagram. There are four stacked hydraulic frames. Only when four hydraulic frames are identified as having tilted straight lines on both sides is the image considered qualified, and the number of images is incremented by 1. If fewer than four hydraulic frames are identified as having tilted straight lines on both sides, or if interfering straight lines such as frames or the ground are identified, the image is considered unqualified and is not counted. Based on a large amount of statistical data, the tilt angle range was finally determined to be 3 < α < 30 and -30 < α < -6.
[0091] Using this tilt angle range as the preset tilt angle range, filter all lines to obtain lines whose tilt angles conform to the preset tilt angle range. The result is as follows. Figure 11 As shown.
[0092] 4) Remove duplicates
[0093] Straight lines that fall within the preset tilt angle range are sorted in descending order of tilt angle. Lines with a tilt angle difference of less than 3° are considered the same line, and the line with the larger tilt angle is removed. This completes the deduplication process, as shown in the image. Figure 12 As shown;
[0094] 5) Finally, obtain the unique straight lines on both sides of the diagonal of each hydraulic frame, and extend all the deduplicated straight lines as follows: Figure 13 As shown.
[0095] (4) Formulate the rules for grouping lines, as shown in the diagram. Figure 14 As shown, the extended straight lines are grouped into pairs, with each pair consisting of two straight lines on the same hydraulic frame, and the coordinates of the intersection point of the two straight lines are obtained.
[0096] Among them, the filtered straight lines are the characteristic straight lines that need to be identified from multiple stacked hydraulic frames. In mathematical space, all non-parallel straight lines have intersection points. For the hydraulic frame positioning method in this application, the goal is to find the intersection points of the straight lines on the left and right sides of the same hydraulic frame. The specified straight line grouping rule is as follows:
[0097] Based on the slopes k>0 and k<0, the extended straight line is divided into the left and right straight lines of the hydraulic frame, namely L. l and L r ;
[0098] Based on the ordinate of the right endpoint of the left straight line and the ordinate of the left endpoint of the right straight line, the two closest straight lines are grouped together, and each group consists of two straight lines of the same hydraulic frame.
[0099] Find the coordinates of the intersection point of two lines in the same group.
[0100] (5) Obtain the center point pixel coordinates of the hydraulic frame based on the intersection coordinates and the dimensions of the hydraulic frame, and complete the positioning of the hydraulic frame.
[0101] in,
[0102] Based on the coordinates of the intersection point and the fixed length and width of the hydraulic frame, the distance from the intersection point of the two straight lines in the same group to the longitudinal center point of the hydraulic frame is Δy.
[0103] The formula for calculating the pixel coordinates of the center point of the hydraulic frame is:
[0104] x′0=x0
[0105] y′0=y0+Δy
[0106] in,
[0107] x0, y0 represent the coordinates of the intersection point of two lines in the same group;
[0108] x′0, y′0 represent the pixel coordinates of the center point of the hydraulic frame.
[0109] Furthermore,
[0110] Convert the center point pixel coordinates into camera coordinates based on the camera parameters;
[0111] The camera coordinates are then converted into robot coordinates. The robot controls the movement of the robotic arm end effector based on the robot coordinates to grasp the hydraulic frame and deliver it to the roller line of the sandblasting equipment.
[0112] Advantages of this invention:
[0113] (1) The hydraulic frame identification and positioning method based on Hough transform preprocesses the acquired images by computer, performs line detection based on the improved Hough transform, then performs line filtering and deduplication, formulates line grouping rules, finds the intersection points of lines in each hydraulic frame, and finally obtains the center point of the hydraulic frame, realizing high-precision line detection and center positioning of the hydraulic frame. It is applicable to the production of hydraulic frames and the sandblasting loading process, realizes the transfer of hydraulic frames from frame to roller line by robot, saves labor costs, and improves work efficiency and safety performance.
[0114] (2) This invention overcomes the complex environment of the production site, overcomes the poor conditions of regeneration such as uneven lighting and color of hydraulic frames, improves the accuracy of hydraulic frame identification, and achieves precise positioning of the center point of the hydraulic frame.
[0115] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for identifying and locating hydraulic vehicle frames based on Hough transform, characterized in that, include: The original image of the hydraulic frame is acquired, and the original image is preprocessed, including grayscale processing, image enhancement processing and filtering processing in sequence. The edges of the original image are extracted to obtain an edge image, and straight lines in the edge image are detected based on Hough transform. The detected straight lines in the edge image are subjected to deduplication filtering and extension operations; wherein, the horizontal and vertical coordinates of the two ends of all straight lines are detected and the tilt angle is calculated; all straight lines are filtered to obtain the straight lines whose tilt angles conform to the preset tilt angle range; the straight lines that conform to the preset tilt angle range are arranged in descending order of tilt angle size, and the tilt angle difference between any two straight lines is less than 3°, which is determined to be the same straight line, and the one with the larger tilt angle is removed to complete the deduplication filtering; all the deduplicated straight lines are extended. Grouping rules are established for the extended straight lines, and they are grouped in pairs, so that each group consists of two straight lines of the same hydraulic frame, and the coordinates of the intersection point of the two straight lines are obtained; wherein, according to the slope k>0 and k<0, the extended straight lines are divided into left and right straight lines of the hydraulic frame; according to the ordinate of the right endpoint of the left straight line and the ordinate of the left endpoint of the right straight line, the two closest straight lines are grouped together, and each group consists of two straight lines of the same hydraulic frame; the coordinates of the intersection point of the two straight lines in the same group are obtained; The center point pixel coordinates of the hydraulic frame are obtained based on the intersection coordinates and the dimensions of the hydraulic frame, thus completing the positioning of the hydraulic frame.
2. The hydraulic vehicle frame identification and positioning method according to claim 1, characterized in that: Initially, raw images of the hydraulic frame were acquired using a camera; After obtaining the center point pixel coordinates, the center point pixel coordinates are converted into camera coordinates according to the camera parameters; The camera coordinates are then converted into robot coordinates. The robot controls the movement of the end effector of the robotic arm according to the robot coordinates to complete the gripping of the hydraulic frame and deliver the hydraulic frame to the roller line of the sandblasting equipment.
3. The hydraulic vehicle frame identification and positioning method according to claim 1, characterized in that: The edges of the original image are extracted using the Canny edge detection method to obtain an edge image. The Canny edge detection method uses a Gaussian smoothing filter to convolve with the original image for noise reduction.
4. The hydraulic vehicle frame identification and positioning method according to claim 1, characterized in that: The method of detecting straight lines in the edge image based on Hough transform includes: Calculate all pixels (x, y) on the edge image using the polar coordinate equation ρ = xcos(θ) + ysin(θ) based on the Hough transform. i ,y i The ρ value of ) Accumulate the number of times the ρ value occurs, and set a threshold T; When the number of times the value of ρ appears is greater than the set threshold T, the values of ρ and θ are obtained to obtain a line segment in the edge image.
5. The hydraulic vehicle frame identification and positioning method according to claim 1, characterized in that: Calculate the slope k and intercept b of each line based on the x and y coordinates of its two endpoints. The inclination angle α of the line can be obtained using the arctangent formula α = arctan(-k) * π.
6. The hydraulic vehicle frame identification and positioning method according to claim 1, characterized in that: Based on the coordinates of the intersection point and the fixed length and width of the hydraulic frame, the distance from the intersection point of the two straight lines in the same group to the longitudinal center point of the hydraulic frame is Δy. The formula for calculating the pixel coordinates of the center point of the hydraulic frame is: x′0=x0 y′0=y0+Δy in, x0, y0 represent the coordinates of the intersection point of two lines in the same group; x′0, y′0 represent the pixel coordinates of the center point of the hydraulic frame.
Citation Information
Patent Citations
A rectangular document image cutting method and device
CN109949211A
Identification apparatus and identification method
JP2011248758A