当前位置:网站首页>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 .
边栏推荐
- Research Report on shell heater industry - market status analysis and development prospect forecast
- Research Report on medical toilet industry - market status analysis and development prospect forecast
- STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)
- SSM框架常用配置文件
- Market trend report, technical innovation and market forecast of Chinese hospital respiratory humidification equipment
- Cost accounting [22]
- ucore lab7
- Crawler series (9): item+pipeline data storage
- Ball Dropping
- 7-1 懂的都懂 (20 分)
猜你喜欢
随机推荐
Eslint--- error: newline required at end of file but not found (EOL last) solution
F - Birthday Cake(山东省赛)
SSM框架常用配置文件
学习记录:TIM—基本定时器
LeetCode#204. Count prime
B - 代码派对(女生赛)
TCP的三次握手与四次挥手
力扣刷题记录--完全背包问题(一)
Accounting regulations and professional ethics [1]
Learning record: how to perform PWM output
Opencv learning log 12 binarization of Otsu method
LeetCode#36. Effective Sudoku
想应聘程序员,您的简历就该这样写【精华总结】
STM32 how to use stlink download program: light LED running light (Library version)
Optimization method of path problem before dynamic planning
China's earthwork tire market trend report, technical dynamic innovation and market forecast
Interesting drink
Learning record: Tim - capacitive key detection
Shell脚本编程
1010 things that college students majoring in it must do before graduation








