Rescue People — Practice Report
Objective
The objective of this project is to implement and test a drone navigation and face detection algorithm to develop a rescue people system capable of taking off a boat and searching for faces in the sea until the battery is over or the 6 persons have been detected.
Implementation Steps
1. Location format changed:
At first, the location of the boat and the survivors are given to us in latitude and longitude format. We have to change it to UTM coordinates and then I use the difference to take the position my drone is going to use.
2. Face detection:
In this project the drone has two cameras: a frontal camera and a ventral one. The frontal camera is mainly used for visualization, while the ventral camera is the one used for face detection.
The face detection function is based on OpenCV and uses a Haar Cascade classifier. Before applying the classifier, the algorithm preprocesses the image to remove the blue color of the sea. This is important not to get false positives due to the water reflections or movement. Then, we rotate in different angles every frame we detect. This is because the person we want to detect can be orientated in different angles in the sea.
We draw an ellipse in the face detected just to let us know it has detected it correctly.
By using the pixel coordinates of the detected face in the ventral camera, together with the drone’s current position and the camera’s field of view, we can calculate the face’s exact position in XY coordinates.
Finally, we check the face captured isn't in the same location as any other face detected before or a minimum meters near. This is necessary because of the noise and the angle and wrong detections.
3. State machine:
• TAKEOFF:
At the beginning, the drone receives a takeoff command until it reaches a fixed altitude. Once this stable height is achieved, the state changes automatically to APPROACH.
• APPROACH:
In this phase the drone flies directly to the search area, calculated from the relative UTM positions of the boat and the survivors. The drone continuously adjusts its heading to face the target. When it is close enough to the initial search point, it switches to the SEARCH state.
• SEARCH:
This is the most important state. The drone performs a spiral movement pattern to explore the sea surface under it. At the same time, the ventral camera is constantly checked for faces. When a new face is confirmed, its location is saved and the number of detected survivors increases.
If six faces are detected or the battery falls below a safety threshold, the search ends and the state transitions to BACK.
• BACK:
In this phase, the drone navigates back to the starting position where the boat was located. It flies until it reaches almost exactly the initial coordinates. After stabilizing for a moment, the system moves to the final state.
• LAND:
The drone lands carefully at the boat. If all survivors have been detected, the mission ends successfully. Otherwise, the system can repeat another flight if enough battery is available.
At the beginning, the drone receives a takeoff command until it reaches a fixed altitude. Once this stable height is achieved, the state changes automatically to APPROACH.
• APPROACH:
In this phase the drone flies directly to the search area, calculated from the relative UTM positions of the boat and the survivors. The drone continuously adjusts its heading to face the target. When it is close enough to the initial search point, it switches to the SEARCH state.
• SEARCH:
This is the most important state. The drone performs a spiral movement pattern to explore the sea surface under it. At the same time, the ventral camera is constantly checked for faces. When a new face is confirmed, its location is saved and the number of detected survivors increases.
If six faces are detected or the battery falls below a safety threshold, the search ends and the state transitions to BACK.
• BACK:
In this phase, the drone navigates back to the starting position where the boat was located. It flies until it reaches almost exactly the initial coordinates. After stabilizing for a moment, the system moves to the final state.
• LAND:
The drone lands carefully at the boat. If all survivors have been detected, the mission ends successfully. Otherwise, the system can repeat another flight if enough battery is available.
Problems Encountered
Distance between persons: I had to adjust just by trying the minimum distance necessary not to detect the same face twice. Even though theoretically the location of the person should be exact. Because of the drone movement and the sensitivity of the location due to the calculations, the minimum distance was necessary.
Spiral and height coordination: The drone height had to be high enough not to be in danger because of the waves but low enough to detect the faces. After this, the spiral width had to be adjusted to detect all the faces but not to be much time flying over the same area.
Land position: The drone used to land out of the boat because when it reached the boat started landing instantly. Because of the drone velocity it continued moving and it landed in the sea. The solution to this was to stay in the boat position some seconds once it reached it.
Face detection: At first the face detection algorithm detected a lot of faces in the water and the real faces weren't even detected. The solution was to create a mask without the blue color in the drone ventral camera and to rotate every frame captured to detect every person.
No hay comentarios:
Publicar un comentario