How to use autopilot with raspberry pi4b and matek h743

Hello. I have a rov with Raspberry pi 4b and Matek h743 wing3. I am using blue os but i couldnt how to autopilot with a opencv program. For example I have a program that detects a red circle and i want to land on the red circle how can i do that? (i have raspicam v2 and i have the code that detects the circle)