当前位置:网站首页>Opencv learning log 32 edge extraction
Opencv learning log 32 edge extraction
2022-07-06 15:43:00 【@Spring sauce】
Preface
This article focuses on opencv Application of edge extraction algorithm in image processing .
One 、 Edge extraction
// Fourth question Edge extraction
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
int main()
{
VideoCapture cap;
cap.open("C://Users//john//Desktop//VID.mp4");
cv::Size rect;
rect.width = 5;
rect.height = 5;
if (!cap.isOpened())
{
std::cout << " Cannot open video file " << std::endl;
return -1;
}
double fps = cap.get(CAP_PROP_FPS);
std::cout << "fps" << fps << std::endl;
while (1)
{
cv::Mat frame;
cv::Mat grayframe;
cv::Mat resframe;
cap.read(frame);
cvtColor(frame, grayframe, CV_RGB2GRAY);
cv::imshow("grayframe", grayframe);
Sobel(grayframe, resframe, CV_8UC1,0,1);
cv::imshow("resframe", resframe);
waitKey(0);
}
}
summary
1. The code can run directly , If you don't understand, please leave a message .
边栏推荐
- 基于web的照片数码冲印网站
- ucore lab 6
- LeetCode#268. Missing numbers
- Path problem before dynamic planning
- Cost accounting [13]
- HDU - 6024 Building Shops(女生赛)
- China chart recorder market trend report, technology dynamic innovation and market forecast
- Cost accounting [13]
- Learning record: USART serial communication
- Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]
猜你喜欢
随机推荐
数据在内存中的存储&载入内存,让程序运行起来
MATLAB综合练习:信号与系统中的应用
毕业才知道IT专业大学生毕业前必做的1010件事
STM32学习记录:LED灯闪烁(寄存器版)
VS2019初步使用
通俗地理解什么是编程语言
cs零基础入门学习记录
Learning records: serial communication and solutions to errors encountered
csapp shell lab
ucore lab7
ucorelab3
程序员的你,有哪些炫技的代码写法?
Cost accounting [24]
Learning record: Tim - capacitive key detection
Research Report on market supply and demand and strategy of China's Medical Automation Industry
STM32 learning record: input capture application
力扣刷题记录--完全背包问题(一)
JS调用摄像头
Accounting regulations and professional ethics [5]
Record of brushing questions with force deduction -- complete knapsack problem (I)