Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9f5211

Browse files
authored
Update README.md
1 parent 93d82e0 commit e9f5211

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@ d) - our filter
2222
## Edge detection
2323
Here is the output of Canny edge detector that was applied on the image with and without preprocessing with our filter.
2424
![edges](/images/edge_detection.png)
25+
26+
## Code usage
27+
Libraries used:
28+
- opencv 4.3.0 for the usage of Mat type
29+
30+
Here is the simple example of filter usage with opencv Mat images:
31+
32+
```cpp
33+
//opencv included in Source.cpp if you need to change include path,
34+
//you should change it there
35+
#include "Source.cpp"
36+
37+
int main()
38+
{
39+
cv::Mat matImage = cv::imread("your_input_file_name", cv::IMREAD_COLOR); //read images using opencv from file into Mat type
40+
41+
int kernelSize = 3; //set kernelSize = 3 for filtering with 3x3 kernel
42+
Filter<float, uint8_t> filter; //create the instance of filter
43+
cv::Mat matOutput = filter(matImage, kernelSize); //filter image
44+
45+
cv::imwrite("your_output_file_name", matOutput); //write the result
46+
return 0;
47+
}
48+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /