-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As this release is not stable, or properly formatted, it has been marked as a beta release Renamed test files to be more specific Signed-off-by: Alex Pereira <[email protected]>
- Loading branch information
1 parent
c0bd3be
commit 3a2c9ae
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Import Classes | ||
from frc_apriltags.stream import BasicStreaming | ||
from frc_apriltags.camera import USBCamera | ||
from frc_apriltags.apriltags import Detector | ||
|
||
# Defines the camera resolutions (width x height) | ||
tagCamRes = (1280, 720) | ||
|
||
# Creates a USBCamera and calibrates it | ||
camera = USBCamera(camNum = 0, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.4:1.0-video-index0", resolution = tagCamRes, calibrate = False) | ||
camMatrix = camera.getMatrix() | ||
|
||
# Prealocate space for the detection stream | ||
stream = camera.prealocateSpace(tagCamRes) | ||
|
||
# Instance creation | ||
detector = Detector() | ||
|
||
# Main loop | ||
while (True): | ||
# Gets the stream | ||
stream = camera.getUndistortedStream() | ||
|
||
# Runs April Tag detection on the undistorted image | ||
results, stream = detector.detectTags(stream, camMatrix, 0) | ||
|
||
# Displays the stream | ||
camera.displayStream() | ||
|
||
# Press q to end the program | ||
if ( camera.getEnd() == True ): | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Import Classes | ||
from frc_apriltags.stream import BasicStreaming | ||
from frc_apriltags.camera import USBCamera | ||
from frc_apriltags.apriltags import Detector | ||
|
||
# Defines the camera resolutions (width x height) | ||
tagCamRes = (1280, 720) | ||
|
||
# Creates a USBCamera and calibrates it | ||
camera = USBCamera(camNum = 0, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.4:1.0-video-index0", resolution = tagCamRes, calibrate = False) | ||
camMatrix = camera.getMatrix() | ||
|
||
# Creates a camera for the drivers | ||
driverCam = BasicStreaming(camNum = 1, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.2:1.0-video-index0") | ||
|
||
# Prealocate space for the detection stream | ||
stream = camera.prealocateSpace(tagCamRes) | ||
|
||
# Instance creation | ||
detector = Detector() | ||
|
||
# Main loop | ||
while (True): | ||
# Gets the stream | ||
stream = camera.getUndistortedStream() | ||
|
||
# Displays the stream | ||
camera.displayStream() | ||
|
||
# Press q to end the program | ||
if ( camera.getEnd() == True ): | ||
break |