#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\core\core.hpp>
#include <iostream>
#include <stdlib.h>
#include <vector>
using namespace std;
using namespace cv;
int main(int argc, char* argv[])
{
Mat test=Mat::eye(16,12,CV_32F);
Mat t,d;
Mat testout=Mat::ones(12,16,CV_32F);
int i,j;
Scalar sum1;
int dirScale;
double xIn,w,yOut;
//cout<<test<<endl;
//copyMakeBorder(test,test,2,2,2,2,BORDER_REPLICATE);
//sum1=sum(test-20);
//testout(Rect(0,0,3,3)).copyTo(test(Rect(0,0,3,3)));
//cout<<test<<endl;
//test(Rect(0,0,3,3))=test(Rect(0,0,3,3))+1;
Mat filt=Mat::ones(1,5,CV_32F);
//cout<<testout<<endl;
Mat tm(32,36,CV_32F,Scalar(0));
copyMakeBorder(testout,testout,10,10,10,10,BORDER_CONSTANT);
//cout<<testout<<endl;
//cout<<tm<<endl;
//cout<<filt<<endl;
for(i=0;i<testout.rows;i++)
{
filter2D(testout.row(i),tm.row(i),CV_32F,filt);
}
cout<<tm<<endl;
Mat out=tm(Rect(10,10,tm.cols-20,tm.rows-20));
cout<<out<<endl;
//vector<double> vec[9];
//double syn5[4][11]= {-0.0280753,-0.0528051, +0.0609643, +0.9250912, +0.3045216, +0.0075195, +0.0146154, +0.0000000, +0.0000000, +0.0000000, +0.0000000,
// +0.0000000, +0.0004889, +0.0382805, -0.0861971, +0.8620317, +0.5205558, -0.1288526, +0.0618612, +0.0000000, +0.0000000, +0.0000000,
// +0.0000000, +0.0000000, +0.0000000, +0.0618612, -0.1288526, +0.5205558, +0.8620317, -0.0861971, +0.0382805, +0.0004889, +0.0000000,
// +0.0000000, +0.0000000, +0.0000000, +0.0000000, +0.0146154, +0.0075195, +0.3045216, +0.9250912, +0.0609643, -0.0528051, -0.0280753};
//double syn4[3][10]={-0.0420048, -0.0414416, +0.0696145, +0.9278507, +0.3652888, -0.0085849, +0.0300705, +0.0000000 +0.0000000, +0.0000000,
// +0.0000000, +0.0000000, +0.0293302, -0.0568660, +0.7267425, +0.7267425, -0.0568660, +0.0293302 +0.0000000, +0.0000000,
// +0.0000000, +0.0000000, +0.0000000, +0.0300705, -0.0085849, +0.3652888, +0.9278507, +0.0696145 -0.0414416, -0.0420048};
//double syn3[2][7]={1,2,3,4,5,6,7,
// -0.1005021, +0.1197507, +0.9271653, +0.6005021, -0.0469160,+0.0000000, +0.0000000};
//for(i=0;i<4;i++)
//{
// for(j=0;j<11;j++)
// {
// vec[i+5].push_back(syn5[i][j]);
// }
//}
//for(i=0;i<3;i++)
//{
// for(j=0;j<11;j++)
// {
// vec[i+2].push_back(syn4[i][j]);
// }
//}
//for(i=0;i<2;i++)
//{
// for(j=0;j<7;j++)
// {
// vec[i].push_back(syn3[i][j]);
// }
//}
//xIn=0.7;
//w=abs(xIn);
// if(w<1&&w>=0)
//{
// yOut=1-2*w*w+w*w*w;
//}
// else if( w>=1&&w<2)
//{
// yOut=4-8*w+5*w*w-w*w*w;
//}
// else yOut=0;
//cout<<yOut<<endl;
//xIn=1.3;
//w=abs(xIn);
// if(w<1&&w>=0)
//{
// yOut=1-2*w*w+w*w*w;
//}
// else if( w>=1&&w<2)
//{
// yOut=4-8*w+5*w*w-w*w*w;
//}
// else yOut=0;
//cout<<yOut<<endl;
//xIn=0;
//w=abs(xIn);
// if(w<1&&w>=0)
//{
// yOut=1-2*w*w+w*w*w;
//}
// else if( w>=1&&w<2)
//{
// yOut=4-8*w+5*w*w-w*w*w;
//}
// else yOut=0;
//cout<<yOut<<endl;
//test.col(5)=test.col(5)+2;
//test.col(7)=test.col(7)+3;
//test.row(2)=test.row(2)+4;
//test.row(1)=test.row(1)+1;
//cout<<test<<endl;
////test.row(0).copyTo(testout.col(1));
//transpose(test,test);
//transpose(test,test);
//cout<<test<<endl;
//copyMakeBorder(test,t,2,2,2,2,BORDER_CONSTANT,0);
//cout<<t<<endl;
//d=t(Rect(2,2,test.cols,test.rows));
//cout<<d<<endl;
/*test.row(0).copyTo(t);
cout<<t<<endl;
cout<<vec[1][0]<<vec[1][1]<<vec[1][2]<<vec[1][3]<<vec[1][4]<<vec[1][5]<<vec[1][6]<<endl;
filter2D(t,d,CV_32F,vec[1]);
cout<<d<<endl;*/
//t=Mat::eye(test.Size,CV_32F);
//cout<<t<<endl;
/*int a=3;
if(a==5)
{
double syn[4][11]= {-0.0280753,-0.0528051, +0.0609643, +0.9250912, +0.3045216, +0.0075195, +0.0146154, +0.0000000, +0.0000000, +0.0000000, +0.0000000,
+0.0000000, +0.0004889, +0.0382805, -0.0861971, +0.8620317, +0.5205558, -0.1288526, +0.0618612, +0.0000000, +0.0000000, +0.0000000,
+0.0000000, +0.0000000, +0.0000000, +0.0618612, -0.1288526, +0.5205558, +0.8620317, -0.0861971, +0.0382805, +0.0004889, +0.0000000,
+0.0000000, +0.0000000, +0.0000000, +0.0000000, +0.0146154, +0.0075195, +0.3045216, +0.9250912, +0.0609643, -0.0528051, -0.0280753};
}
else if(a==4)
{
double syn[3][10]={-0.0420048, -0.0414416, +0.0696145, +0.9278507, +0.3652888, -0.0085849, +0.0300705, +0.0000000 +0.0000000, +0.0000000,
+0.0000000, +0.0000000, +0.0293302, -0.0568660, +0.7267425, +0.7267425, -0.0568660, +0.0293302 +0.0000000, +0.0000000,
+0.0000000, +0.0000000, +0.0000000, +0.0300705, -0.0085849, +0.3652888, +0.9278507, +0.0696145 -0.0414416, -0.0420048};
}
else if(a==3)
{
double syn[2][7]={-0.1005021, +0.1197507, +0.9271653, +0.6005021, -0.0469160, +0.0000000, +0.0000000,
+0.0000000, +0.0000000, -0.0469160, +0.6005021, +0.9271653, +0.1197507, -0.1005021};
}
cout<<syn[1][6]<<endl;
*/
//value[0]=1;
//value[1]=2;
//value[2]=3;
//bgr[0].create(10,10,CV_8UC1);
//bgr[1].create(10,10,CV_8UC1);
//bgr[2].create(10,10,CV_8UC1);
////i=bgr[0].rows;
////j=bgr[0].cols;
////cout<<i<<j<<endl;
//for (i=0;i<5;i++)
// for (j=0;j<5;j++)
// {
// bgr[0].at<uchar>(i,j)=i;
// bgr[1].at<uchar>(i,j)=i;
// bgr[2].at<uchar>(i,j)=i;
// }
// bgr[0]=bgr[0]*5+15;
//merge(bgr,3,src);
// cout<<"out"<<src<<endl;
//
//
//namedWindow("test",WINDOW_AUTOSIZE);
//while(true)
//{
// c=waitKey();
// if(c=='a')
// {
// copyMakeBorder(src,dst,2,2,2,2, BORDER_REFLECT101);
// cout<<dst<<endl;
// }
// else if(c=='b')
// {
// copyMakeBorder(src,dst,2,2,2,2,BORDER_CONSTANT,value);
// cout<<dst<<endl;
// }
// else if(c=='d')
// {
// break;
// }
//
//}
///*src.convertTo(src,CV_32F);
//src=src/2;
//cout<<"out"<<src<<endl;
//split(src,bgr);
//cout<<"out"<<bgr[0]<<endl;*/
//
////Mat inp=Mat::eye (10,10,CV_8UC1);
////Mat out(19,15,CV_8UC1,0);
////out=inp(Rect(1,1,4,8));
////for(i=0;i<8;i++)
// //for(j=0;j<4;j++)
// //{
// //out.at<uchar>(i,j)=i+j;
// //}
////cout<<"out"<<src(Rect(0,0,2,2));
getchar();
return 0;
}
没有合适的资源?快使用搜索试试~ 我知道了~
c++编写的自相关超分辨率重建算法
共155个文件
tlog:92个
cpp:11个
obj:11个
4星 · 超过85%的资源 需积分: 9 84 下载量 73 浏览量
2015-06-26
09:43:15
上传
评论 2
收藏 8.82MB RAR 举报
温馨提示
用c++编写的超分辨率重建算法,基于自相关技术,完成单帧的超分辨率重建。
资源推荐
资源详情
资源评论
收起资源包目录
c++编写的自相关超分辨率重建算法 (155个子文件)
main.cpp 6KB
matchup.cpp 4KB
upfilter.cpp 3KB
downfilter.cpp 3KB
main.cpp 3KB
convFltr.cpp 2KB
rescale.cpp 2KB
rgb2yuv.cpp 2KB
upscale.cpp 2KB
upscalenomatch.cpp 1KB
yuv2rgb.cpp 1KB
SR.exe 145KB
test.exe 67KB
SR.vcxproj.filters 3KB
test.vcxproj.filters 942B
top.h 800B
upscalenomatch.h 212B
main.h 209B
upscale.h 191B
convFltr.h 177B
downfilter.h 153B
rescale.h 148B
upfilter.h 147B
matchup.h 146B
rgb2yuv.h 125B
yuv2rgb.h 121B
vc110.idb 603KB
vc110.idb 395KB
SR.ilk 2.31MB
test.ilk 539KB
test.lastbuildstate 77B
SR.lastbuildstate 77B
SR.Build.CppClean.log 17KB
test.Build.CppClean.log 3KB
test.log 3KB
SR.log 3KB
upfilter.obj 297KB
downfilter.obj 293KB
main.obj 199KB
matchup.obj 194KB
convFltr.obj 193KB
main.obj 181KB
rgb2yuv.obj 180KB
rescale.obj 179KB
yuv2rgb.obj 178KB
upscale.obj 177KB
upscalenomatch.obj 174KB
SR.opensdf 42B
SR.pdb 1.6MB
test.pdb 1.12MB
vc110.pdb 700KB
vc110.pdb 636KB
imgOut.png 2.72MB
test.png 289KB
SR.psess 3KB
SR.sdf 12.69MB
SR.sln 1KB
SR.v11.suo 85KB
CL.read.1.tlog 148KB
CL.write.1.tlog 18KB
CL.read.1.tlog 14KB
link.read.1.tlog 9KB
cl.command.1.tlog 6KB
link.read.1.tlog 6KB
link.command.1.tlog 4KB
link.command.1.tlog 3KB
link.write.1.tlog 2KB
cl.command.1.tlog 642B
link.write.1.tlog 494B
CL.write.1.tlog 384B
link.7068.write.1.tlog 2B
link-cvtres.read.1.tlog 2B
link.5192-rc.write.1.tlog 2B
link.5192-cvtres.read.1.tlog 2B
link.5192-cvtres.write.1.tlog 2B
link-cvtres.write.1.tlog 2B
link-rc.write.1.tlog 2B
link.7068-rc.write.1.tlog 2B
link.5192.read.1.tlog 2B
link.7068-rc.read.1.tlog 2B
link.5192.write.1.tlog 2B
link.7068.read.1.tlog 2B
link.7068-cvtres.write.1.tlog 2B
link-rc.read.1.tlog 2B
link.5192-rc.read.1.tlog 2B
link.7068-cvtres.read.1.tlog 2B
link.3852.read.1.tlog 2B
link.7424.write.1.tlog 2B
link.12012-cvtres.write.1.tlog 2B
link.2124-cvtres.write.1.tlog 2B
link.2556-rc.read.1.tlog 2B
link.2124-rc.write.1.tlog 2B
link.2124-cvtres.read.1.tlog 2B
link.6232.write.1.tlog 2B
link.7092-rc.read.1.tlog 2B
link.3852.write.1.tlog 2B
link.19116-rc.read.1.tlog 2B
link-cvtres.read.1.tlog 2B
link.19116.read.1.tlog 2B
link.4672-rc.read.1.tlog 2B
共 155 条
- 1
- 2
资源评论
- wanjangoto2018-01-26带工程的源码,应该需要调用opencv
- qq_286608612018-04-17试了下,效果还不错
- hula2018-01-12还行,看看再反馈。
- lanyao12212016-10-07下了试一下,看看再反馈。
- huimengyoux2019-03-13骗子,只是个读取视频显示的代码,根本没有超分辨率重建代码
李家小巷
- 粉丝: 1
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功