旋转相机柱面投影

【Octave】柱面投影简析

http://www.cnblogs.com/cheermyang/p/5431170.html

柱面投影法

https://zh.wikipedia.org/wiki/%E6%9F%B1%E9%9D%A2%E6%8A%95%E5%BD%B1%E6%B3%95

Octave与维基百科分别是从相机焦面端和实景端分析的。

 

C/C++ 图像处理(8)------图像の柱面投影算法

https://blog.csdn.net/weixinhum/article/details/50611750

讲解柱面投影公式推导过程。

 

Lab 8 - 全景图拼接

http://www.cad.zju.edu.cn/home/gfzhang/course/computational-photography/lab6-panorama/panorama.html

浙大柱面投影实验,有借鉴作用。(感觉给的公式有错误)

图像拼接---图片柱面投影简单实现

https://blog.csdn.net/u010551600/article/details/78461142

图像拼接(一):柱面投影+模板匹配+渐入渐出融合(有代码)

https://blog.csdn.net/czl389/article/details/54599253

opencv柱面投影

https://blog.csdn.net/zouxin_88/article/details/85167602

// zhumian.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include<time.h>
using namespace cv;
using namespace std;
#define PI 3.1415
int main()
{
	cv::Mat image1 = cv::imread("5.bmp", 1);
	if (!image1.data)
		return 0;
	imshow("image1", image1);

	Mat imgOut = Mat(image1.rows, image1.cols, CV_8UC3);
	float w = image1.cols;
	float h = image1.rows;
	float f = (w / 2) / tan(PI / 56);
//	f = 5000;

	for (int i = 0; i < image1.rows; i++)
	{
		for (int j = 0; j < image1.cols; j++)
		{
			float x = j;
			float y = i;
			float x1 = f * atan((x - w / 2) / f) + f * atan(w / (2.0f * f));
			float y1 = f * (y - h / 2.0f) / sqrt((x - w / 2.0f) * (x - w / 2.0f) + f * f) + h / 2.0f;

			int col = (int)(x1 + 0.5f);//加0.5是为了四舍五入
			int row = (int)(y1 + 0.5f);//加0.5是为了四舍五入

			if (col < image1.cols && row < image1.rows)
			{
				imgOut.at<Vec3b>(row, col)[0] = image1.at<Vec3b>(i, j)[0];
				imgOut.at<Vec3b>(row, col)[1] = image1.at<Vec3b>(i, j)[1];
				imgOut.at<Vec3b>(row, col)[2] = image1.at<Vec3b>(i, j)[2];
			}
		}
	}

	imshow("imgOut", imgOut);

	waitKey(0);
	return 0;
}

 

 

CS129 Final Project: Cylindrical Panorama

http://cs.brown.edu/courses/cs129/results/final/yunmiao/

 

 

 

 

 

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值