blur & threshold
This commit is contained in:
1 parent
9366635e88
commit
275a44cfc8
7 files changed
+107
No files matched your search
@@ -0,0 +1,14 @@
|
|||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cv::Mat src = cv::imread("image.jpg");
|
||||||
|
cv::Mat dst;
|
||||||
|
|
||||||
|
// 参数:输入, 输出, 邻域直径, 颜色空间标准差, 坐标空间标准差
|
||||||
|
// 颜色标准差越大,表示越宽的颜色范围会被混合
|
||||||
|
cv::bilateralFilter(src, dst, 9, 75, 75);
|
||||||
|
|
||||||
|
cv::imshow("Bilateral Filter", dst);
|
||||||
|
cv::waitKey(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cv::Mat src = cv::imread("../img/2.jpg");
|
||||||
|
cv::Mat dst;
|
||||||
|
|
||||||
|
// 参数:输入, 输出, 卷积核大小 Size(w, h)
|
||||||
|
cv::blur(src, dst, cv::Size(5, 5));
|
||||||
|
|
||||||
|
cv::imshow("Mean Blur", dst);
|
||||||
|
cv::waitKey(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cv::Mat src = cv::imread("image.jpg");
|
||||||
|
cv::Mat dst;
|
||||||
|
|
||||||
|
// 参数:输入, 输出, 核大小, sigmaX(标准差), sigmaY
|
||||||
|
// 如果 sigmaY 为 0,则默认与 sigmaX 相等
|
||||||
|
cv::GaussianBlur(src, dst, cv::Size(5, 5), 0);
|
||||||
|
|
||||||
|
cv::imshow("Gaussian Blur", dst);
|
||||||
|
cv::waitKey(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user