I am not sure how you find a heading to the tracked object base on the camera data.
Could you explain your question in more detail?
Well, if you want a heading based on the current robot heading (instead of an absolute heading), you can figure out the field of view of the camera (an angle measure). Then, using the x-coordinates of the center of the ball, you can approximate a heading.
I mean that I would like to the program to figure out what the pwm outputs need to be to drive to the ball based on data from the camera.