So you want to add object tracking and following to your existing drone? shashankvkt8 has shared a guide that shows you how to do just that. A camera mounted on a 3-axis gimbal was used to compete this project. The target is always kept at the center of the frame while the camera tracks the target and follows it.
You will need a F450 quadrotor, Pixhawk PX4, Odroid XU4, and Sj4000 camera to get started, though you can always use comparable parts.