当前位置:网站首页>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 .
边栏推荐
- China earth moving machinery market trend report, technical dynamic innovation and market forecast
- Learning record: USART serial communication
- Accounting regulations and professional ethics [1]
- LeetCode#198. raid homes and plunder houses
- ucorelab4
- 程序员的你,有哪些炫技的代码写法?
- Flink 使用之 CEP
- STM32 learning record: play with keys to control buzzer and led
- 毕业才知道IT专业大学生毕业前必做的1010件事
- Research Report of peripheral venous catheter (pivc) industry - market status analysis and development prospect prediction
猜你喜欢
随机推荐
LeetCode#268. Missing numbers
Cost accounting [20]
Shell脚本编程
Cost accounting [17]
动态规划前路径问题优化方式
Research Report on shell heater industry - market status analysis and development prospect forecast
Medical colposcope Industry Research Report - market status analysis and development prospect forecast
Unpleasant error typeerror: cannot perform 'ROR_‘ with a dtyped [float64] array and scalar of type [bool]
China's peripheral catheter market trend report, technological innovation and market forecast
STM32学习记录:玩转按键控制蜂鸣器和LED
FSM和i2c实验报告
LeetCode#237. Delete nodes in the linked list
Record of force deduction and question brushing
E. Breaking the Wall
China's earthwork equipment market trend report, technical dynamic innovation and market forecast
7-1 懂的都懂 (20 分)
TCP的三次握手与四次挥手
Take you to use wxpy to create your own chat robot (plus wechat interface basic data visualization)
数据在内存中的存储&载入内存,让程序运行起来
Flink 使用之 CEP