当前位置:网站首页>Opencv based real-time stitching of simple dual camera images
Opencv based real-time stitching of simple dual camera images
2022-07-28 17:28:00 【Dashan classmate】
#include"opencv2/opencv.hpp"
using namespace cv;
The number of rows is equal Peer splicing
Mat comMatR(Mat Matrix1,Mat Matrix2,Mat &MatrixCom)
{
CV_Assert(Matrix1.rows==Matrix2.rows);// The number of rows is not equal , An error interrupt occurred
MatrixCom.create(Matrix1.rows,Matrix1.cols+Matrix2.cols,Matrix1.type());
Mat temp=MatrixCom.colRange(0,Matrix1.cols);
Matrix1.copyTo(temp);
Mat temp1=MatrixCom.colRange(Matrix1.cols,Matrix1.cols+Matrix2.cols);
Matrix2.copyTo(temp1);
return MatrixCom;
}
The number of columns is equal Same column splicing
Mat comMatC(Mat Matrix1,Mat Matrix2,Mat &MatrixCom)
{
CV_Assert(Matrix1.cols==Matrix2.cols);// The number of columns is not equal , An error interrupt occurred
MatrixCom.create(Matrix1.rows+Matrix2.rows,Matrix1.cols,Matrix1.type());
Mat temp=MatrixCom.rowRange(0,Matrix1.rows);
Matrix1.copyTo(temp);
Mat temp1=MatrixCom.rowRange(Matrix1.rows,Matrix1.rows+Matrix2.rows);
Matrix2.copyTo(temp1);
return MatrixCom;
}
int main()
{
VideoCapture capture1(0); // call 1 Camera number
VideoCapture capture2(1); // call 2 Camera number
while(1)
{
Mat frame1,frame2; // Definition Mat Variable frame1 frame2
Mat combine; // Definition Mat Variable combine After the combination of Mat
capture1>>frame1; // Get images 1
capture2>>frame2; // Get images 2
comMatR(frame1,frame2,combine); // Start splicing
imshow(" video 1",combine);// Display the stitched image
waitKey(30);// Time delay 30MS
}
}
Learn from the following blog
opencv Image mosaic , That is, combine the two matrices into one (vconcat and hconcat)、Mat Member functions size()_mikedadong The blog of -CSDN Blog _cv::mat vconcat A little rookie , Don't laugh, big guys .
边栏推荐
- 火了 2 年的服务网格究竟给微服务带来了什么?(转载)
- Verilog 每日一题(VL26 简易秒表)
- Use of influxdb2
- Verilog daily question (vl8 uses generate... For statement to simplify code)
- C# 导入Excel文件数据的几种方法
- 微信小程序现金红包返回“IP地址非你在商户平台设置的可用IP地址”错误终极解决方法
- Goweb开发之Beego框架实战:第四节 数据库配置及连接
- QR code generation of wechat applet with parameters
- Verilog daily question (simple implementation of VL30 RAM)
- [Presto] common commands of Presto
猜你喜欢

Azure Devops developed by visual studio 2015 team

High speed circuit design practice -- Overview

Selection of resistance in high speed circuit

高速电路设计实践——概述

Shell脚本之AWK

Verilog daily question (vl29 single port RAM)

Goweb开发之Beego框架实战:第一节 Beego框架介绍
![[atlas] atlas compilation error sorting (all)](/img/bb/2ca51dffc7a09b378be4e581280246.png)
[atlas] atlas compilation error sorting (all)

Visual Studio 2015 团队开发之Azure DevOps篇

influxdb2的使用
随机推荐
WPF command button transparent style
我为什么选择使用Go语言?
MySQL的触发器
异步电路设计--同步脉冲器原理及例题
火了 2 年的服务网格究竟给微服务带来了什么?(转载)
Introduction to vscade interface
net框架
Verilog daily question (vl14 vending machine 1 -- FSM common question types)
Linear algebra and matrix theory (VIII)
influxdb2的使用
With a total data volume of more than trillions of lines, Yuxi cigarette factory can easily deal with it by correctly selecting the timing database
Message Passing for Complex Question Answering over Knowledge Graphs
Application system log structure of elastic stack
Gray code and binary conversion and typical examples (4bits gray code counter)
The practice of beego framework developed by goweb: Section 4 database configuration and connection
[kibana] problem sorting kibana 7.x no indices match pattern "APM-*“
堡垒机的作用
利用SQL Server代理作业对数据库进行定时还原
MySQL PgSQL realizes the merging of multiple lines of records into one line, grouping and merging, and dividing with specified characters
Wechat applet cash red packet returns the error "the IP address is not the available IP address you set on the merchant platform". The ultimate solution