Camera (RoboRIO USB) unable to identify an AprilTag, or am I just being stupid?

This is our code for detecting AprilTags via a camera connected to a RoboRIO

This was taken from RI3D’s github

We are using a Logitech C270, and we are able to see a video feed in SmartDashboard.

It could also be an issue with our print-out of the AprilTag, so I have added an Imgur link to it.

Any help is greatly appreciated :>

The printed tag looks fine. But make sure it is perfectly flat. If you just hold a sheet of paper in the air it often doesn’t work well.

we have already taped the AprilTag onto a flat area, but our camera still isn’t detecting our AprilTag. Not sure what to do, but rn we are messing around with the
minClusterSize, and criticalAngle variables. still no luck :<

Ignore my past reply, but as it turns out, I am, in fact, stupid (lol).

In SmartDashboard, I added the CameraServer Stream (to see the video feed), but I hadn’t set the camera stream to “RioAprilTags”, by default it was set to “Logitech c270”.

What I forgot to do was right click on the stream, go to Properties and change the camera stream to “RioAprilTags”. (Make sure to do Ctrl + E to enable editing in SmartDashboard )After I did this it detected AprilTags correctly (although there are false positives and other bugs to fix etc)