avatar
文章
37
标签
9
分类
8

胡侃有料的博客
搜索

胡侃有料的博客

【c++|opencv】二、灰度变换和空间滤波---6.锐化空间滤波
发表于2024-11-22|C++opencv
1. 锐化空间滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;// 定义滤波函数void myfilter(Mat& img_input,Mat& img_output); // 四邻域void myfilter2(Mat& img_input,Mat& img_output); // 八邻域int main(){ Mat img,img_gray,imt_output,img_output2; img = imread("/home/v/home.png"); if (img.empty()){ cout< ...
【c++|opencv】二、灰度变换和空间滤波---5.中值滤波
发表于2024-11-22|C++opencv
1. 中值滤波1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374#include<iostream>#include<opencv2/opencv.hpp>#include"Salt.h"using namespace cv;using namespace std;void myfilter(int filter_size,Mat& img_input,Mat& img_output);int mysort(Mat& sortarray,int filter_size);int main(){ Mat img,img_gray,img_output,img_output2; img = imread("/home/v/home.png"); if ...
【c++|opencv】二、灰度变换和空间滤波---4.高斯滤波
发表于2024-11-22|C++opencv
1. 高斯滤波123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include <iostream>#include <opencv2/opencv.hpp>#include"Salt.h"using namespace std;using namespace cv;// 定义高斯滤波函数void myfilter(int filter_size,Mat& img_input,Mat& img_output);int main(){ Mat img,img_gray,img_out,img_out2; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"can't open the ima ...
【c++|opencv】二、灰度变换和空间滤波---3.均值滤波
发表于2024-11-22|C++opencv
1. 均值滤波12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#include <iostream>#include <opencv2/opencv.hpp>#include"Salt.h"using namespace cv;using namespace std;// 定义盒式滤波器void myfilter(int filter_size,Mat& img_input,Mat& img_output);int main(){ Mat img,img_gray,img_output,img_output2; img = imread("/home/v/home.png"); if (img.empty()){ cout<<"can not load image"< ...
【c++|opencv】二、灰度变换和空间滤波---2.直方图
发表于2024-11-22|C++opencv
1. 图像直方图1234567891011121314151617181920212223242526272829303132333435363738394041#include <iostream>#include <opencv2/opencv.hpp>using namespace cv;using namespace std;int main(){ Mat img, img_gray,hist; img = imread("/home/v/home.png"); if (img.empty()){ cout << "Could not open or find the image" << endl; return -1; } cvtColor(img, img_gray, COLOR_BGR2GRAY); imshow("img gray",img_gray); // 获取 ...
【c++|opencv】二、灰度变换和空间滤波---1.灰度变换
发表于2024-11-22|C++opencv
1. 灰度变换1234567891011121314151617181920212223242526272829303132#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;int main() { Mat img,out_img,img_gray; img = imread("/home/v/home.png"); if (img.empty()){ cout << "Could not open or find the image" << endl; return -1; } cvtColor(img, img_gray, COLOR_BGR2GRAY); imshow("img gray",img_gray); out_img = img_gr ...
【c++|opencv】一、基础操作---4.访问图像像素
发表于2024-11-22|C++opencv
1. 访问图像像素1.1 访问某像素123456//灰度图像:image.at<uchar>(j, i) //j为行数,i为列数//BGR彩色图像image.at<Vec3b>(j, i)[0] //B分量image.at<Vec3b>(j, i)[1] //G分量image.at<Vec3b>(j, i)[2] //R分量 1.2 遍历像素以添加噪声为例 1.2.1 准备创建添加噪声函数 Salt.h 123456789#pragma once#include <iostream>#include <opencv2/opencv.hpp>#include <random>using namespace cv;using namespace std;void Salt(Mat img,int n); // n加入噪声点数 Salt.cpp 1234567891011121314151617181920212223#include "Salt.h"void Salt(Mat img, ...
【c++|opencv】一、基础操作----2.图像信息获取
发表于2024-11-22|C++opencv
1. 图像信息获取123456789101112131415161718192021222324// 获取图像信息#include <iostream>#include <opencv2/opencv.hpp>using namespace cv;using namespace std;int main(){ Mat img = imread("/home/v/home.png"); if(img.empty()){ cout<<"Error: Could not load image."<<endl; return -1; } imshow("img",img); cout<<"img row: "<<img.rows<<endl; cout<<"img col: "<<img.cols ...
【c++|opencv】一、基础操作----1.图像读取
发表于2024-11-22|C++opencv
1. 图像读取、显示、保存// 读取、显示、保存图像 #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; int main(){ Mat img; // 创建空图像 img = imread("/home/v/home.png") ; if(img.empty()){ cout << "读取图片失败" << endl; return -1; } namedWindow("home"); // 无这行窗口大小不能改变 imshow("home", img); imwrite("a.png",img); waitKey(0); return 0; }```
【PCL】7. 滤波
发表于2024-11-21|C++PCL
1. 直通滤波代码: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#include <iostream>#include <pcl/point_types.h>#include <pcl/filters/passthrough.h>int main(int argc, char** argv){ pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered (new pcl::PointCloud<pcl::PointXYZ>); // 生成数据 cloud->width = 5; cloud->height = 1; clo ...
1234
avatar
胡侃有料
心之所向,无问西东
文章
37
标签
9
分类
8
Follow Me
公告
This is my Blog
最新文章
正向运动学2026-08-16
机器人坐标系2026-08-03
Hello World2026-08-03
【c++|opencv】三、频率域滤波---7.巴特沃斯高通滤波 - C++ - opencv2024-11-22
【c++|opencv】三、频率域滤波---6.高斯高通滤波 - C++ - opencv2024-11-22
分类
  • C++23
    • PCL7
    • opencv16
  • js9
    • js基础3
    • js逆向6
  • 文章2
  • 机器人2
标签
js基础 C++ typora PCL 机器人 js逆向 补环境 opencv js逆向 hexo
归档
  • 八月 20263
  • 十一月 202423
  • 十月 20233
  • 九月 20235
  • 八月 20233
网站资讯
文章数目 :
37
本站总字数 :
24.1k
最后更新时间 :
©2020 - 2026 By 胡侃有料
框架 Hexo|主题 Butterfly
搜索
数据库加载中