当前位置:网站首页>First knowledge of opencv4.x --- image perspective transformation
First knowledge of opencv4.x --- image perspective transformation
2022-07-26 14:06:00 【F l e】
// Image perspective transformation
#include <stdio.h>
#include <iostream>
#include <string>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
// Perspective transformation of image , need 3x3 The rotation matrix of , in total 9 Parameters , Through the original image and the transformed correspondence 4 A point can be constructed 12 Solve equations 9 Parameters
Mat img = imread("noobcvqr.png");
// Note that boundary points cannot be used , The image is 628*628, The maximum value is 627, Otherwise, an error will be reported
Point2f src[4] = {
Point2f(94,374),Point2f(507,380),Point2f(1,623) ,Point2f(627,627) };
Point2f dst[4] = {
Point2f(0,0),Point2f(627,0),Point2f(0,627) ,Point2f(627,627) };
Mat rotation, img_dst;
rotation = getPerspectiveTransform(src, dst);
warpPerspective(img, img_dst, rotation, Size(img.cols, img.rows));
namedWindow(" Original picture ", WINDOW_NORMAL);
imshow(" Original picture ", img);
namedWindow(" Perspective transformation ", WINDOW_NORMAL);
imshow(" Perspective transformation ", img_dst);
waitKey(0);
return 0;
}

边栏推荐
- IDEA(warning)No artifacts configured
- [dark horse morning post] many apps under bytek have been taken off the shelves; The leakage of deoxidizer in three squirrels caused pregnant women to eat by mistake; CBA claimed 406million yuan from
- Circular queue (implemented in C language)
- MySQL-03 数据库操作
- 【数学建模】常用基本模型总结
- [shaders realize overlay to re cover cross dressing effect _shader effect Chapter 9]
- Videojs to canvas pause, play, switch video
- Disease knowledge discovery based on spo semantic triples
- Polymorphic case - making drinks
- 基于双层主题模型的技术演化分析框架及其应用
猜你喜欢

Leetcode215 the kth largest element (derivation of quick sort partition function)

uni-app从创建到运行到微信开发者工具

在检测分割中一些轻量级网络模型(自己学习的笔记分享)

Circular queue (implemented in C language)

Basic syntax of MySQL DDL and DML and DQL

.net6与英雄联盟邂逅之——根据官方LCU API制作游戏助手

基于双层主题模型的技术演化分析框架及其应用

The difference between V-model and.Sync modifier

基于专利多属性融合的技术主题划分方法研究

Comparison between agile development and Devops
随机推荐
PHP uses sqlserver
Multi task text classification model based on tag embedded attention mechanism
二叉树的层序遍历(C语言实现)
Pytorch学习笔记(二)神经网络的使用
Leetcode215 the kth largest element (derivation of quick sort partition function)
Circular queue (implemented in C language)
Integer internal cache
什么是Restful风格以及它的四种具体实现形式
Subscription and publication of messages
Frisbee, 2022 "black red" top stream
[shaders realize overlay to re cover cross dressing effect _shader effect Chapter 9]
Basic knowledge about memory chips
Jzoffer51- reverse pairs in the array (merge sort solution)
[oauth2] VIII. Configuration logic of oauth2 login -oauth2loginconfigurer and oauth2clientconfigurer
.net6 encounter with the League of heroes - create a game assistant according to the official LCU API
@千行百业,一起乘云而上!
2022-07-26 Daily: the first anniversary of the establishment of alphafold DB database, research on the lighting point of official promotion
Tdsql-c serverless: help start-ups achieve cost reduction and efficiency increase
JS submit the form to determine whether the user name and password are empty
In 2022, we "sent away" so many Internet products in only one month