/* 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");
}
没有合适的资源?快使用搜索试试~ 我知道了~
bcs-spl-1.5-1.rar_dct_dwt图像压缩_dwt稀疏_图像稀疏基_稀疏基
共176个文件
m:127个
tiff:7个
bmp:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 71 浏览量
2022-07-14
03:35:10
上传
评论 1
收藏 16.85MB RAR 举报
温馨提示
实现图像分块压缩感知,实现了多种稀疏基下的压缩感知,包含CT、DCT、DDWT、DWT等
资源详情
资源评论
资源推荐
收起资源包目录
bcs-spl-1.5-1.rar_dct_dwt图像压缩_dwt稀疏_图像稀疏基_稀疏基 (176个子文件)
barbara 256KB
untitled.bmp 3.05MB
airplane.bmp 768KB
baboon.bmp 768KB
peppers.bmp 257KB
rec_Hotelling.bmp 65KB
boat 256KB
resampc.c 2KB
ChangeLog 2KB
COPYING 691B
resampc.dll 7KB
.DS_Store 6KB
.DS_Store 6KB
._.DS_Store 82B
._.DS_Store 82B
dualtree_eg1_figure.eps 12KB
Img3.JPG 262KB
Img2.JPG 260KB
Img1.JPG 188KB
lena 256KB
LICENSE-GPL 18KB
showpdfb.m 12KB
BCS_SPL_CT_Decoder.m 6KB
BCS_SPL_DDWT_Decoder.m 5KB
nlademo.m 5KB
computescale.m 5KB
BCS_SPL_DWT_Decoder.m 4KB
Contents.m 3KB
decdemo.m 3KB
BCS_SPL_DCT_Decoder.m 3KB
dfilters.m 3KB
pdfbdec.m 3KB
afb3D.m 3KB
run_experiment_ct.m 2KB
run_experiment_ddwt.m 2KB
denoisedemo.m 2KB
denoising_dtdwt.m 2KB
fbrec.m 2KB
dfbdec.m 2KB
BCS_SPL_GenerateProjection.m 2KB
fbdec.m 2KB
run_experiment_dwt.m 2KB
dfbrec.m 2KB
cplxdual3D_plots.m 2KB
run_experiment_dct.m 2KB
resampz.m 2KB
qup.m 2KB
pup.m 2KB
extend2.m 2KB
dfbrec_l.m 2KB
dfbdec_l.m 2KB
AntonB.m 2KB
dfbimage.m 2KB
pfilters.m 2KB
BCS_SPL_Encoder.m 2KB
qprec.m 2KB
sfb3D.m 2KB
qdown.m 2KB
dualfilt1.m 1KB
pdown.m 1KB
fbdec_l.m 1KB
DCT2D_Matrix.m 1KB
pprec.m 1KB
qpdec.m 1KB
pdfbrec.m 1KB
cplxdual3D.m 1KB
fbrec_l.m 1KB
wfb2rec.m 1KB
denoising_dwt.m 1KB
ppdec.m 1KB
wfb2dec.m 1KB
PSNR.m 1KB
RMS.m 1KB
sefilter2.m 1KB
dualtree2D.m 1KB
resamp.m 1KB
pdfb2vec.m 1KB
cplxdual2D.m 1KB
FSfarras.m 1KB
pdfb_tr.m 1KB
icplxdual3D.m 1KB
nlademo2.m 1KB
dualtree3D.m 1KB
rebacksamp.m 1KB
qupz.m 1KB
backsamp.m 1KB
efilter2.m 1KB
dualtree.m 1KB
idualtree3D.m 1000B
vec2pdfb.m 992B
den3.m 985B
afb2D_A.m 982B
farras.m 959B
icplxdual2D.m 928B
lprec.m 902B
pdfb_nest.m 901B
smthborder.m 890B
afb.m 886B
afb2D.m 870B
idualtree2D.m 865B
共 176 条
- 1
- 2
JaniceLu
- 粉丝: 78
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2