In recent years, quadcopters have gained significant attention due to their agility, ease of control, and ability to perform vertical take-off and landing. Autonomous flight control, particularly path following along colored tracks, is a critical task in both military and civilian applications. Traditional methods often segment images to extract features, which can fail when obstacles occlude parts of the path. To address this, we propose an autonomous path-following system for quadcopters based on the Hough transform. This approach focuses on extracting boundary lines as the target trajectory, reducing data processing requirements and enhancing robustness against occlusions. Our system integrates image processing, control algorithms, and real-time decision-making to achieve efficient and stable path tracking. This paper details the design, implementation, and validation of our method through simulations and real-world experiments, demonstrating its high recognition rate and tracking accuracy.
The overall system comprises four main modules: flight commands, flight control systems, quadcopter simulation models, and visualization modules. Flight commands are generated based on image processing results and fed into the control system to manipulate the quadcopter’s motion. The simulation model, built using tools like Simulink 3D Visualization, allows for trajectory design and real-time path recognition. The image processing module converts images captured by the quadcopter’s onboard camera from Y1UY2V format to RGB, applies thresholding for binarization, performs edge detection, and uses morphological operations to refine the path. The Hough transform then detects lines and circles, converting these features into positional data for control. This modular design ensures scalability and adaptability to various environments.

Image recognition is the cornerstone of our autonomous path-following system for quadcopters. The onboard camera captures images in Y1UY2V format, which are converted to RGB for processing. We use a global threshold to binarize the image, isolating the path from the background. Specifically, the red component (R) is emphasized by subtracting half of the green (G) and blue (B) components, as given by:
$$ TH = R – \frac{G}{2} – \frac{B}{2} $$
If TH exceeds a threshold value (set to 80 in our system), the pixel is classified as part of the path. This simple yet effective method highlights red trajectories against darker backgrounds, such as gray or black, which improves edge detection accuracy. We found that using a dark background minimizes noise and enhances the contrast for reliable path extraction.
Edge detection is performed using the Canny algorithm, which involves multiple steps to identify precise edges in the grayscale image. First, Gaussian smoothing reduces noise by convolving the image with a Gaussian kernel:
$$ G(x,y) = \frac{1}{2\pi\sigma^2} \exp\left(-\frac{x^2 + y^2}{2\sigma^2}\right) $$
where $\sigma$ is the standard deviation, typically set to 1.0 in our implementation. Next, gradient magnitude and direction are computed using Sobel operators. The gradients in the x and y directions, $G_x$ and $G_y$, are combined to find the gradient magnitude $G$ and orientation $\theta$:
$$ G = \sqrt{G_x^2 + G_y^2} $$
$$ \theta = \arctan\left(\frac{G_y}{G_x}\right) $$
Non-maximum suppression then thins the edges by retaining only local maxima in the gradient direction. Finally, double thresholding with hysteresis tracks edges: pixels with gradient magnitudes above a high threshold are strong edges, those below a low threshold are suppressed, and intermediate pixels are connected to strong edges if adjacent. This process ensures that only significant edges are retained for further analysis.
To improve the quality of the edge-detected image, we apply binary morphological operations. Erosion and dilation are used to remove noise and fill gaps. Specifically, we use a thinning operation that iteratively removes pixels from the boundaries of objects, reducing them to minimal connected lines. For images with occlusions, this results in connected rings around holes, preserving the path structure. This step is crucial for preparing the image for Hough transform, as it simplifies the path to its skeletal form.
The Hough transform detects lines and circles in the processed image. For line detection, the standard Hough transform maps points in the image space to curves in the Hough parameter space $(\rho, \theta)$, where $\rho$ is the perpendicular distance from the origin to the line, and $\theta$ is the angle of the normal vector. The line equation is:
$$ x \cos(\theta) + y \sin(\theta) = \rho $$
Peaks in the Hough space correspond to lines in the image. We use the Houghpeaks function to identify these peaks and Houghlines to extract line segments. For circle detection, the circular Hough transform uses parameters $(a, b, r)$ for the center coordinates and radius. Accumulator arrays vote for potential circles, and peaks indicate detected circles. This method is robust to noise and partial occlusions, making it ideal for quadcopter applications where environmental factors can vary.
The flight control system for the quadcopter is designed to translate path features into motion commands. We use a linearized dynamic model of the quadcopter, constrained to maintain zero pitch and roll angles during path following. The kinematics in the horizontal plane are described by:
$$ \dot{x} = v \cos(\psi) $$
$$ \dot{y} = v \sin(\psi) $$
$$ \dot{\psi} = w $$
where $[x, y]^T$ represents the position in the body-fixed frame, $v$ is the linear velocity, $\psi$ is the yaw angle, and $w$ is the yaw rate. This model assumes slow speeds, where delays in direction changes are negligible. Control is achieved through a combination of position and velocity controllers. Position control uses a PID controller to adjust the yaw angle based on the desired trajectory, while velocity control independently manages x and y velocities to influence pitch and roll for movement. We employ a position-velocity-position cascade control strategy to reduce reliance on global positioning and minimize control efforts.
A state machine governs the quadcopter’s operational modes, ensuring seamless transitions between tasks. The states include take-off, hover, straight-line tracking, circle detection, and landing. Upon take-off, the quadcopter hovers at a fixed height of 1.1 meters. It then follows straight paths until a circular landing zone is detected, triggering the landing sequence. This state-based approach simplifies decision-making and enhances reliability in dynamic environments.
Landing is initiated when the Hough transform detects a circular target with a sufficient number of pixels (e.g., 1,350 pixels in our setup). The image processing pipeline applies Canny edge detection and Hough circle detection to estimate the circle’s center and radius. Radial histograms are used to verify the circle, and upon confirmation, the state machine commands the quadcopter to descend. This automated process ensures precise landing even in the presence of minor obstructions.
To validate our system, we conducted simulations and real-world experiments using a Parrot Mambo quadcopter. The simulation environment, built in Matlab/Simulink, featured a 3D world with an “Ω”-shaped path: red lines for the trajectory, gray background, and white noise points. The path width was 15 cm for straight segments and 10 cm radius for circles. The quadcopter’s initial position was set to $(P_x, P_y, P_z) = (0.5343, 0.3957, -0.0460)$. We observed that dark backgrounds (e.g., gray) yielded better edge detection compared to light backgrounds, due to higher contrast with the red path.
In simulation, the quadcopter successfully tracked the path over 39.23 seconds. The image processing steps—binarization, Canny edge detection, morphological thinning, and Hough transform—produced accurate line and circle detections. For instance, the Hough transform derived the yaw angle $\theta$ from line parameters, which was fed into the PID controller for position correction. The table below summarizes the tracking errors at key拐点 (inflection points) in the path:
| Direction | Inflection Point | Error (m) |
|---|---|---|
| X | 1 | 0.095 |
| X | 2 | 0.079 |
| X | 3 | 0.099 |
| Y | 1 | 0.051 |
| Y | 2 | 0.057 |
Overall, the X-direction error remained below 0.15 m, and the Y-direction error below 0.20 m throughout the flight. The quadcopter exhibited stable flight with a slight time delay of approximately 1 second due to image processing latency. The 3D trajectory plot showed close alignment between the desired and actual paths, with successful landing on the circular target.
For real-world testing, we used an “L”-shaped path (150 cm × 100 cm) with a Parrot Mambo quadcopter equipped with a 120×160 pixel camera, Bluetooth connectivity, and sensors including ultrasonic, pressure, and inertial measurement units. The Simulink model was configured for fixed-step simulation (0.005 s step size) and deployed via Bluetooth. The quadcopter completed the path in 19.64 seconds, with trajectory data indicating high fidelity to the desired path. The table below compares key parameters between simulation and real-world experiments:
| Parameter | Simulation | Real-World |
|---|---|---|
| Path Shape | Ω-shaped | L-shaped |
| Duration (s) | 39.23 | 19.64 |
| Max X Error (m) | 0.15 | 0.12 |
| Max Y Error (m) | 0.20 | 0.18 |
| Background | Gray | Gray |
The results confirm that our Hough transform-based method achieves reliable path following for quadcopters, with errors within acceptable limits. The use of morphological operations and Hough transform mitigates issues related to partial occlusions, outperforming segmentation-based approaches. The quadcopter’s ability to adapt to different path geometries, such as curves and straight lines, highlights the versatility of our system.
In conclusion, we have developed an autonomous path-following system for quadcopters that leverages Hough transform for robust image recognition. By converting camera images to binary formats, applying edge detection and morphological thinning, and detecting path features through Hough transform, our system translates visual data into precise control commands. The constrained dynamic model and state machine ensure stable and efficient flight. Simulations and real-world experiments on “Ω” and “L” shaped paths demonstrate high accuracy and reliability, with tracking errors below 0.20 m. This approach enhances the autonomy of quadcopters in complex environments, paving the way for applications in surveillance, delivery, and search-and-rescue. Future work will focus on optimizing processing speed and extending the system to handle dynamic obstacles and varying lighting conditions.
The integration of image processing and control algorithms in our quadcopter system represents a significant advancement in autonomous robotics. The Hough transform’s ability to detect geometric shapes under occlusions makes it particularly suitable for real-world scenarios where paths may be partially hidden. Our experiments validate the method’s effectiveness, and the use of PID controllers and state machines adds layers of reliability. As quadcopter technology evolves, such systems will become increasingly vital for autonomous operations, and our work provides a solid foundation for further innovation.
