This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f13e0a3
commit eb3da63
Showing
3 changed files
with
119 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
sidebar_position: 5 | ||
title: Bitwise Operations | ||
sidebar_label: Bitwise Operations | ||
--- | ||
|
||
# Bitwise Operations | ||
|
||
Bitwise operations are operations that are performed on the binary representation of a number. They are very useful for | ||
combining images, using masks, and more. | ||
|
||
There are two most common bitwise operations: `and` and `not`. | ||
|
||
There is also `or` and `xor`, but I have yet to find a use for these, so I will not be covering them. You can google them if you want to learn more. | ||
|
||
## And | ||
|
||
The `and` operation is used to combine two images. This allows us to use masks to only show certain parts of an image. | ||
A common use is to have a mask (say one provided by the `inRange` method) and use it to only show the parts of the image | ||
where the mask is white. | ||
|
||
```java | ||
Core.bitwise_and(Mat src1, Mat src2, Mat dst) | ||
``` | ||
|
||
## Not | ||
|
||
The `not` operation is used to invert an image. | ||
|
||
```java | ||
Core.bitwise_not(Mat src, Mat dst) | ||
``` |
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,11 @@ | ||
--- | ||
sidebar_position: 6 | ||
title: Blob and Edge Detection | ||
sidebar_label: Blob and Edge Detection | ||
--- | ||
|
||
# WIP | ||
|
||
This section is work in progress. Please check back later. | ||
|
||
For now just google it (or use github copilot) |
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,76 @@ | ||
--- | ||
sidebar_position: 4 | ||
title: Common Methods | ||
sidebar_label: Common Methods | ||
--- | ||
|
||
# Common Methods | ||
|
||
While we can't go over every single method in OpenCV, we will briefly go over some of the more common methods that will | ||
depend on what you are trying to accomplish. | ||
|
||
We are always adding more methods to this page, but if you don't see a method you need, you can always google it. | ||
|
||
## Mean value | ||
```java | ||
Core.mean(Mat mat) | ||
``` | ||
|
||
Find the mean value of an image. | ||
|
||
**Parameters:** | ||
- `mat`: The image to find the mean value of. | ||
|
||
**Returns:** A `Scalar` object containing the mean value of the image, seperated by channel. | ||
|
||
**Example:** | ||
```java | ||
Scalar mean = Core.mean(input); | ||
|
||
mean.val[0]; // Mean value of the first channel | ||
mean.val[1]; // Mean value of the second channel | ||
mean.val[2]; // Mean value of the third channel | ||
``` | ||
|
||
## In Range | ||
```java | ||
Core.inRange(Mat src, Scalar lowerBound, Scalar upperBound, Mat dst) | ||
``` | ||
|
||
Get a binary image of the pixels in a certain range. If the pixel is in the range, it will be white, otherwise it will be black. | ||
|
||
**Parameters:** | ||
- `src`: The image to find the mean value of. | ||
- `lowerBound`: The lower bound of the range. | ||
- `upperBound`: The upper bound of the range. | ||
- `dst`: The output image. | ||
|
||
**Returns:** None | ||
|
||
**Example:** | ||
```java | ||
Scalar lowerBound = new Scalar(0, 0, 0); | ||
Scalar upperBound = new Scalar(255, 255, 255); | ||
Mat dst = new Mat(); | ||
|
||
Core.inRange(input, lowerBound, upperBound, dst); | ||
``` | ||
|
||
## Split | ||
```java | ||
Core.split(Mat src, List<Mat> dst) | ||
``` | ||
|
||
Split an image into its channels. | ||
|
||
**Parameters:** | ||
- `src`: The image to split. | ||
- `dst`: The list of images to store the channels in. | ||
|
||
**Returns:** None | ||
|
||
**Example:** | ||
```java | ||
ArrayList<Mat> channels = new ArrayList<>(); | ||
Core.split(input, channels); | ||
``` |