当前位置:网站首页>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 .
边栏推荐
- Learning record: use stm32f1 watchdog
- FSM和i2c实验报告
- STM32 learning record: play with keys to control buzzer and led
- 动态规划前路径问题
- 程序员的你,有哪些炫技的代码写法?
- Research Report of pharmaceutical solvent industry - market status analysis and development prospect prediction
- Research Report on market supply and demand and strategy of geosynthetics industry in China
- Research Report on market supply and demand and strategy of China's Medical Automation Industry
- Eslint--- error: newline required at end of file but not found (EOL last) solution
- 通俗地理解什么是编程语言
猜你喜欢
随机推荐
学习记录:串口通信和遇到的错误解决方法
Opencv learning log 12 binarization of Otsu method
0-1背包问题(一)
Cost accounting [24]
STM32學習記錄:輸入捕獲應用
ucorelab4
Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
STM32 learning record: LED light flashes (register version)
China's earthwork tire market trend report, technical dynamic innovation and market forecast
TCP的三次握手与四次挥手
用C语言写网页游戏
Flex --- detailed explanation of flex layout attributes
Indonesian medical sensor Industry Research Report - market status analysis and development prospect forecast
FSM and I2C experiment report
差分(一维,二维,三维) 蓝桥杯三体攻击
CS zero foundation introductory learning record
MATLAB实例:阶跃函数的两种表达方式
HDU-6025-Coprime Sequence(女生赛)
Report on the market trend, technological innovation and market forecast of printing and decorative paper in China
Find 3-friendly Integers