/* Resampling along the column (Type 1 and 2)
*
* Created by: Minh N. Do, March 2000
*/
#include "mex.h"
/*
function y = resampc(x, type, shift, extmod)
% RESAMPC Resampling along the column
%
% y = resampc(x, type, shift, extmod)
%
% Input:
% x: image that is extendable along the column direction
% type: either 1 or 2 (1 for shuffering down and 2 for up)
% shift: amount of shifts (typically 1)
% extmod: extension mode:
% 'per' periodic
% 'ref1' reflect about the edge pixels
% 'ref2' reflect, doubling the edge pixels
%
% Output:
% y: resampled image with:
% R1 = [1, shift; 0, 1] or R2 = [1, -shift; 0, 1]
*/
void
mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
double *x, *px; /* input matrix and pointer */
double *y, *py; /* result matrix and pointer */
int type; /* type of resampling */
int s; /* amount of shifts */
char extmod[10]; /* extension mode */
int i, j, k, m, n;
/* Parse input */
if (nrhs < 4)
mexErrMsgTxt("Not enough input for RESAMPC!");
x = mxGetPr(prhs[0]);
m = mxGetM(prhs[0]);
n = mxGetN(prhs[0]);
type = (int) mxGetPr(prhs[1])[0];
if ((type != 1) && (type != 2))
mexErrMsgTxt("The second input (type) must be either 1 or 2");
s = (int) mxGetPr(prhs[2])[0];
if (!mxIsChar(prhs[3]))
mexErrMsgTxt("EXTMOD arg must be a string");
mxGetString(prhs[3], extmod, 10);
/* Create output */
plhs[0] = mxCreateDoubleMatrix(m, n, mxREAL);
y = mxGetPr(plhs[0]);
px = x;
py = y;
if (strcmp(extmod, "per") == 0)
{
/* Resampling column-wise:
* y[i, j] = x[<i+sj>, j] if type == 1
* y[i, j] = x[<i-sj>, j] if type == 2
*/
for (j = 0; j < n; j++)
{
/* Circular shift in each column */
if (type == 1)
k = (s * j) % m;
else
k = (-s * j) % m;
/* Convert to non-negative mod if needed */
if (k < 0)
k += m;
for (i = 0; i < m; i++)
{
if (k >= m)
k -= m;
py[i] = px[k];
k++;
}
px += m;
py += m;
}
}
else
mexErrMsgTxt("Invalid EXTMOD");
}
没有合适的资源?快使用搜索试试~ 我知道了~
SAR图像去噪matlab(小波去噪、contourlet变换去噪、contourlet-小波变换+PCA去噪)
共34个文件
m:30个
dll:1个
bmp:1个
5星 · 超过95%的资源 需积分: 48 474 下载量 103 浏览量
2017-03-14
09:42:49
上传
评论 33
收藏 78KB ZIP 举报
温馨提示
程序包含基于WAVELET域、基于CONTOURLET域、基于WAVELET-CONTOURLET域及PCA的SAR图像去噪
资源推荐
资源详情
资源评论
收起资源包目录
SAR-denosing-sj.zip (34个子文件)
SAR-denosing-sj
ppdec.m 1KB
pprec.m 1KB
ldfilter.m 662B
backsamp.m 1KB
resampc.c 2KB
pdfbrec.m 1KB
dfbrec_l.m 2KB
qprec.m 2KB
BJ256_N_5.bmp 65KB
resampc.mexw64 9KB
pdfbdec.m 3KB
dfbdec_l.m 2KB
qpdec.m 1KB
extend2.m 2KB
resamp.m 1KB
denoising.m 6KB
lpdec.m 722B
lprec.m 935B
pdfb_nest.m 931B
pdfb_nest1.m 2KB
pfilters.m 2KB
fbrec_l.m 1KB
dfbrec.m 2KB
PSNR.m 459B
covriance.m 487B
rebacksamp.m 1KB
fbdec_l.m 1KB
vec2pdfb.m 1KB
wfb2dec.m 1KB
dup.m 755B
resampc.dll 7KB
sefilter2.m 1KB
wfb2rec.m 1KB
pdfb2vec.m 1KB
共 34 条
- 1
资源评论
- 一个精致的情绪疯子2021-10-06可以用,但还需要改改
- hb_ma2017-11-28应该可以用
- MUXIZImxz2019-09-02可以运行的,还可以
- maiwang08182017-07-06最近在学动目标检测,希望有用!
aabb112233445566
- 粉丝: 5
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功