当前位置:网站首页>初识Opencv4.X----图像透视变换
初识Opencv4.X----图像透视变换
2022-07-26 14:01:00 【F l e】
//图像图像透视变换
#include <stdio.h>
#include <iostream>
#include <string>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
//图像的透视变换,需要3x3的旋转矩阵,总共9个参数,通过原图像和变换后的对应4个点就可以构造12个方程解出9个参数
Mat img = imread("noobcvqr.png");
//注意边界点不能用,图像为628*628,最大值为627,否则会报错
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("原图", WINDOW_NORMAL);
imshow("原图", img);
namedWindow("透视变换", WINDOW_NORMAL);
imshow("透视变换", img_dst);
waitKey(0);
return 0;
}

边栏推荐
- Synchronization mechanism of go (sync.mutex)
- Uncover the secret of white hat: 100 billion black products on the Internet scare musk away
- Official announcement! Edweisen group and Baidu xirang reached a deep co creation cooperation
- 基于标签嵌入注意力机制的多任务文本分类模型
- Intercept the coordinate points (four point coordinates of the face frame) face image from the marked XML file and save it in the specified folder
- How to quickly design a set of cross end components that support rendering rich text content
- Familiarize you with the "phone book" of cloud network: DNS
- LCL三相pwm整流器(逆变器)
- Canvas upload image Base64 with cropping function jcrop.js
- Latest battle report: Ten certifications and five best practices
猜你喜欢

redis学习笔记

gdb常用命令

聚力打造四个“高地”,携手合作伙伴共铸国云!

Digital collections accelerate the breaking of the circle and help the industry find new opportunities

Ten thousand words long article, talking about the blueprint of enterprise digital modeling

C语言_结构体和数组的结合

How can red star Macalline design cloud upgrade the traditional home furnishing industry in ten minutes to produce film and television level interior design effects

Uncover the secret of white hat: 100 billion black products on the Internet scare musk away

.net6 encounter with the League of heroes - create a game assistant according to the official LCU API

Solve the problem that JUnit of idea console cannot be input with scanner
随机推荐
Tianyi cloud web application firewall (edge cloud version) supports the detection and interception of Apache spark shell command injection vulnerabilities
Synchronization mechanism of go (sync.mutex)
数据泄漏、删除事件频发,企业应如何构建安全防线?
LCL三相pwm整流器(逆变器)
Code cloud, which officially supports the pages function, can deploy static pages
With frequent data leakage and deletion events, how should enterprises build a security defense line?
php使用sqlserver
Share 44 JS problems, and half of them are masters
Difference between base addressing and index addressing
2022-07-26日报:Alphafold DB数据库建立一周年,官推盘点亮点研究
JS get the current time, time and timestamp conversion
基于多任务深度学习的实体和事件联合抽取模型
基于SPO语义三元组的疾病知识发现
Research on Chinese medicine assisted diagnosis and treatment scheme integrating multiple natural language processing tasks -- taking diabetes as an example
C language Snake linked list and pointer practice
关于存储芯片的入门基础知识
[shaders realize overlay to re cover cross dressing effect _shader effect Chapter 9]
敏捷开发与DevOps的对比
Plato farm is expected to further expand its ecosystem through elephant swap
搞懂MySQL的数据类型中长度含义