For Tee camera, the ball will be immediately above the marker.
For Flight camera, create a support that will hold the ball so that its center in space is where the marker point existed in space before it was replaced by an actual ball. Put the
Example setups: Flight camera:
Tee camera:
Ensure that the area around the ball has good contrast. For example, put down some black felt around the ball or use a white ball on a green hitting mat.
For Tee camera, turn the LED strip on the LM base on to make sure there’s sufficient light for good exposures.
Re-Measure H to ensure it’s correct - it is the distance on a line straight out from the camera lens to the ball center (at or near where the marker point was)
Set the H distance into the appropriate parameter in the “calibration” section of the golf_sim_config.json file:
For Tee camera, "kCamera1CalibrationDistanceToBall". ~87cm is typical
For Flight camera, "kCamera2CalibrationDistanceToBall". ~55cm is typical
For Flight camera, install the light filter and holder on the lens.
Focus the lens as well as possible and lock in the focus by tightening the thumb screw closest to the camera (the other screw should already have been tightened). Using the brand-marking or number printed on the ball can help this process. This will establish the focal distance in the next step.
IF NOT ALREADY DONE AT LEAST ONCE, PERFORM CAMERA LENS UNDISTORTION PROCESS (other section)
Ensure the ball is well-lit, especially near its bottom.
For Flight camera, getting as much sunlight in as possible can help provide sufficient IR to see well, or an incandescent light can also help.
Run the “runCam1Calibration.sh” or “runCam2Calibration.sh” script to get the focal length.
It will take multiple measurements and average them. This will take a minute or so.
Set the resulting focal length into the .JSON file.
E.g., "kCamera1FocalLength": 5.216 would be typical
Determine the x & y (pan and tilt) camera1 angles for the configuration .JSON file
(in “cameras” section) "kCamera1Angles": [ 54.7, -22.2 ], (x,y or pan, tilt)
Place a ball ball near the mark on the tee-up spot so that there is a straight line from the camera to the mark that runs through the center of the ball (thus the ball will be slightly in front of the marker)
Measure the distances to the center of the ball
In the JSON file, set calibration.kCamera1CalibrationDistanceToBall to the distance to the ball in meters, e.g,. 0.81
Run “runCam1BallLocation.sh” script to make sure the angles and distances and processing are correct
The ball-search location should work in the center: --search_center_x 723 --search_center_y 544. If the script doesn’t return values, check the log_view_final_search_image_for_Hough.png file.
Remember, that the distances will be approximately to the center of the ball FROM THE CAMERA, so will be a little shorter than the distance to the LM in the X direction.