Auto update new waypoint ! Urgent!

Hello ! Its my first time on the forum! I am pretty new in UAV but i took on a project that require me and my teammates to send the quad out for a search and rescue mission. It goes like this: first the quad will take off and fly to a rough waypoint and loiter around. (We are using opencv to look for the object) then once it detect it should pass the gps information to the mission planner and mission planner upload to the drone automatically then it will fly to the target and drop the payload. I need help with the uploading of the gps coordinates of the target. Can anyone help me with this ?