If your method described above doesn't seem to give you quite the right answer, perhaps you really want to know what the proportionality constant (pixels to degrees) is for
small angles (rather than the full image width). To do this, I suggest:
- Position the robot so that the target is reasonably close to the center of the image.
- Note exactly where the target center is located.
- Rotate by a known small number of degrees (perhaps 5 or 10)
- Note where the center of the target is now.
- Divide the number of pixels moved from step 2 to 4 by the number of degrees rotated in step 3
This will give you the number of pixels per degree for small angles near the center of the camera image.