Skip to content

Commit

Permalink
add vision portal to open cv
Browse files Browse the repository at this point in the history
  • Loading branch information
GramGra07 committed Jan 31, 2024
1 parent 9d6876c commit f634e7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions autonomous/openCV.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,25 @@ Utils.matToBitmap(frame, b);
lastFrame.set(b);
```

Next, we will add it to our auto opMode.

In the variables area:
```
public static VisionPortal visionPortal = null; // vision portal for the webcam
public static YourDetection objProcessor = null; // processor for the vision portal
```

Then in your init, before runOpMode:

```
objProcessor = new YourDetection;
visionPortal = new VisionPortal.Builder()
.setCamera(hardwareMap.get(WebcamName.class, "Webcam 1"))
.setCameraResolution(new Size(400, 280))
.addProcessors(objProcessor)
.build();
```

[Next up: Road Runner][rr]

[Go back home][hP]
Expand Down

0 comments on commit f634e7c

Please sign in to comment.