PhotonVision beta 3D calibration lags on limelight camera

I have imaged the PhotonVision beta for April Tag support onto a Limelight 2+ camera and have been trying to do the 3D calibration. However, when I switch into calibration mode, the camera feed begins to lag tremendously (like 30 seconds) before timing out (the screen turns into the yellow background with spinning loading wheel). I am never able to take more than 2 snapshots before the camera feed times out.

For my test setup, I have the Limelight directly connected to a 12V robot battery through POE and plugged into my computer through ethernet. I am able to load and ping PhotonVision’s local website without excessive delay, so it doesn’t seem like a camera-computer connection issue.

Any advice would be appreciated.

3 Likes

What resolution are you calibrating at?

960x720

Unfortunately there are performance issues with higher resolutions during calibration. We’re working on a new calibration solution that does the calibration client-side to address this issue. For now, I would recommend sticking with 480p.

4 Likes

Thanks, I’ll try that.

IS there a specific distance you are supposed to calibrate with?

Nothing exact, just whatever can get the checkerboard in frame but detectable.

1 Like

I got thread crossed, but how does distance determination work without a fixed distance/target size calibration?

The target size is fixed, you specify the checkerboard dimensions.

2 Likes

I guess that works if you know to the field of view angle.

1 Like

The calibration process inherently finds the FOV through camera intrinsics.

1 Like

@Bmongar I likely didn’t do a good job calibrating as I doubt the various angles for calibration were as large as needed for accuracy.

From the PhotonVision documentation:
Now, we’ll capture images of our chessboard from various angles. The most important part of this step is to make sure that the chessboard overlay matches the chessboard in your image.

But at some resolutions and angles the rainbow overlay didn’t match at all well.

The instructions aren’t clear if the camera and the calibration target should remain parallel to each other or if the camera should point to the target or if neither is necessary.

From the OpenCV documentation:
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.

2 Likes

Definitely make sure the overlay matches.
You want to get images of the chessboard to collectively cover most of the FOV as well as the chessboard with minor tilt if possible (not completely parallel to the camera).


If the reprojection errors are low, you will have a smaller mean error/standard deviation. This doesn’t mean the 3d measurements will be accurate, only that the calibration model fits the given data (check your physical checkerboard dimensions are accurate).
image

2 Likes

We had an issue where if it wasn’t connected to a robot, and it wasn’t running its network tables server, the camera would lag until we selected the option to run its own network table server. Maybe this is related?

1 Like

Thanks. That’s very helpful.

Couldn’t reproduce this. What device and photon version were you using, if you know?

I’ve had a few instances of about 30-second camera image update lag that I cannot reproduce or correlate to anything. Last night the LImeLight2+ with beta-5 lagged so I hit the restart device button in PhotonVision. I don’t think I was using static IP at the time but not sure and that might or might not matter.

Raspberry pi 4b running beta 5 with a Microsoft LifeCam

1 Like

I think the target acquisition was still performing at normal speeds of fps and latency. It was the display in the dashboard port 5800 that was buggered. I can’t prove that now after the fact so I hope I’m not being misleading. No longer sure what the other ports were doing (1181 … 1184). Maybe others can pay attention to this if they run into the situation.

1 Like

Proper calibration yields excellent results.

I had not noticed on the Camera Calibration that the yellow bar at the bottom was a scroll bar; I thought only the mean error and std dev were the only two columns and that was reinforced by you pasting that in #13 above.

Before proper calibration and now capable of scrolling I see the FOVs were ridiculously low. I followed your instructions and the FOVs are now exactly the published numbers. The x, y determined distances are pretty good now. Thanks for your instruction.

For the lag in the display I could only reproduce one situation and I already had reported that. I couldn’t reproduce the 30-second delays I had seen a few times.

The lag I can usually reproduce is using Chrome browser. Often Chrome has lag in updating the camera image on port 5800. The other ports 1183, 1184, are okay. The targeting information on the dashboard updates okay.

I have to remember to use Edge browser as I reported before. That does not have that delay.

edit:
As soon as I hit send, of course, Edge started jerky display. Not as bad a Chrome usually and not as often. Hitting refresh fixes the jerkiness.

4 Likes