资源简介
Rectangling Panoramic Images via Warping论文的MATLAB代码,处理图像,可以使得图像的边缘变为规则图形!!
懂得自然懂!!!
代码片段和文件信息
#include
#include
#include
#include
#include
#include
using namespace std;
unsigned char* img;
int w h;
int* mask;
int* outMask;
unsigned char* outImg;
int* xDispMap;
int* yDispMap;
int* outXDispMap;
int* outYDispMap;
void readPPM(const char* name unsigned char** img int* w int* h) {
FILE* file = fopen(name “rb“);
fscanf(file “P6\n%d %d\n255\n“ w h);
int size = (*w) * (*h) * 3;
*img = new unsigned char[size];
fread(*img sizeof(unsigned char) size file);
fclose(file);
}
void writePPM(const char* name const unsigned char* img int w int h) {
FILE* file = fopen(name “wb“);
fprintf(file “P6\n%d %d\n255\n“ w h);
int size = w * h * 3;
fwrite(img sizeof(unsigned char) size file);
fclose(file);
}
void writePGM(const char* name const unsigned char* img int w int h) {
FILE* file = fopen(name “wb“);
fprintf(file “P5\n%d %d\n255\n“ w h);
int size = w * h;
fwrite(img sizeof(unsigned char) size file);
fclose(file);
}
void energy(const unsigned char* image int W int H int* energy int* mask){
memset(energy 0 sizeof(energy[0])*W*H);
//int addValue = max(WH)*3*10;
int addValue = 1000000;
#pragma omp parallel for
for(int i=0; i for(int j=0; j for(int k=0; k<3; ++k)
energy[i*W+j] += abs((int)image[(i*W+(j+1))*3+k] - (int)image[(i*W+j)*3+k]);
#pragma omp parallel for
for(int i=0; i for(int j=0; j for(int k=0; k<3; ++k)
energy[i*W+j] += abs((int)image[((i+1)*W+j)*3+k] - (int)image[(i*W+j)*3+k]);
#pragma omp parallel for
for(int i=0; i for(int j=0; j energy[i*W+j] += mask[i*W+j] * addValue;
}
///////////////////////Vertical Seam////////////////////////////
void accumulateVerEn(int * energy int W int H int* verticalEnergy int* verticalRoute){
/////////Initialize////////////
memset(verticalEnergy 0 sizeof(verticalEnergy[0])*W*H);
memset(verticalRoute 0 sizeof(verticalRoute[0])*W*H);
#pragma omp parallel for
for(int i=0; i verticalEnergy[i] = energy[i];
////////Accumulte the min energy and find the route//////////////
for(int i=1; i for(int j=0; j if(j-1<0){
verticalEnergy[i*W+j] = energy[i*W+j] + min(verticalEnergy[(i-1)*W+j] verticalEnergy[(i-1)*W+j+1]);//e(ij) + min( M(i-1j) M(i-1 j+1))
verticalRoute[i*W+j] = (verticalEnergy[(i-1)*W+j]<=verticalEnergy[(i-1)*W+j+1]) ? 0 : 1;
}
else if(j+1>=W){
verticalEnergy[i*W+j] = energy[i*W+j] + min(verticalEnergy[(i-1)*W+j-1] verticalEnergy[(i-1)*W+j]);//e(ij) + min( M(i-1j-1) M(i-1 j))
verticalRoute[i*W+j] = (verticalEnergy[(i-1)*W+j-1] }
else{
verticalEnergy[i*W+j] = energy[i*W+j] + min(min(verticalEnergy[(i-1)*W+j-1] verticalEnergy[(i-1)*W+j]) verticalEnergy[(i-1)*W+j+1]);//e(ij) + min( M(i-1j-1) M(i-1 j) M(i-1 j+1))
verticalRoute[i*W+j] = (verticalEnergy[(i-1)*W+j-1]
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\
目录 0 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\
文件 7374 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\addSeam.cpp
文件 11264 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\addSeam.mexw64
文件 477 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\addSeam_wrap.m
文件 449 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\checkInterSection.m
文件 264 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\drawGrid.m
文件 910 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\drawGridmask.m
文件 374 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\findLB.m
文件 385 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\findLS.m
文件 1055 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\getLinTrans.m
文件 253 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\getLinTrans2.m
文件 195 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\getvertices.m
文件 15825 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\globalmeshOpt.m
文件 2090 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\localWarping.m
文件 15605 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\main.m
文件 548 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\mask_fg.m
文件 1816 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\meshwarp.m
文件 1248 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\quadexp.m
文件 647 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\readme
目录 0 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\
文件 40960 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\lsd.mexw64
文件 43520 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\lsd_image.mexw64
文件 2520576 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\opencv_core247.dll
文件 2363904 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\opencv_highgui247.dll
文件 2203648 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\reference code\opencv_imgproc247.dll
文件 894 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\runAll.m
文件 57 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\showMask.m
目录 0 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\sig13pano\
文件 287042 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\sig13pano\10a_input.jpg
文件 285372 2016-01-14 16:20 Rectangling-Panoramic-Images-Via-Warping-master\final code\sig13pano\10b_input.jpg
............此处省略13个文件信息
相关资源
- The Micro-Doppler Effect in Radar Matlab DVD文件
- matlab版象棋棋盘识别源码
- 《MATLAB统计分析与应用:40个案例分析
- MATLAB电力系统设计与分析
- 实战Matlab之并行程序设计及其代码
- 《卡尔曼滤波原理及应用MATLAB仿真》
- MATLAB仿真应用详解-目前发现的Simuli
- MATLAB控制工程工具箱技术手册魏巍版
- 数字信号处理——基于计算机的方法
- 自抗扰控制ADRC入门资源
- 卷积神经网络的MATLAB实现
- 卷积神经网络完成程序matlab
- 深度置信网络DBN算法实现 matlab
- MATLAB数据分析与挖掘实战.rar
- matlab图像找茬设计与实现
- MATLAB通信仿真及应用实例详解158729
- 《精通图像处理经典算法MATLAB版》配
- 精通matlab北航的程序
- 电力电子和电力拖动控制系统matlab仿
- stm32-mat_target4.40
- PID and Predictive Control of Electrical Drive
- 现代通信系统MATLAB版)第二版.pdf
- 基于MATLAB的时间序列分析建模、预测
-
Matlab/Simuli
nk 2018RA的指导手册 - MATLAB从入门到精通.胡晓冬.董辰辉.扫
- 基于停用词的文本预处理及其聚类(
- MATLAB语音合成
- 数字图像处理的MATLAB实现第二版 源码
- MATLAB函数速查手册(修订版)-邓薇
- 数字通信同步技术的MATLAB与FPGA实现—
评论
共有 条评论