Read GPS data from pixhawk to raspberry pi

Hi everyone,
I am working on a project that finds positions of red-colored objects using python(OpenCV) but i am struggling with reading instantaneous position data file from pixhawk. Is there a way to do that?