MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB图像处理] 关于blkproc函数求助!!! (https://www.labfans.com/bbs/showthread.php?t=14466)

南小蹦 2012-03-24 00:34

关于blkproc函数求助!!!
 
clc;clear all;
I=imread('harbour.tif');
I=im2double(I);
T=dctmtx(16);
B=blkproc(I,[16 16],'p1*x*p2',T,T');
mask=[1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0;
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0;
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0;
1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0;
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];

B2=blkproc(B,[16,16],'p1*x',mask);
I2=blkproc(B2,[16 16],'p1*x*p2',T',T);
figure(1)
subplot(2,1,1);imshow(I);title('原图');
subplot(2,1,2);imshow(I2);title('压缩后的图像');
??? Error using ==> inlineeval at 15
Error in inline expression ==> p1*x*p2
Undefined function or variable 'p1'.

Error in ==> inline.feval at 36
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr,
INLINE_OBJ_.expr);

Error in ==> blkproc at 103
firstBlock = feval(fun,x,params{:});

Error in ==> six at 5
B=blkproc(I,[16 16],'p1*x*p2',T,T');
出错在什么地方?求指导 谢谢。


所有时间均为北京时间。现在的时间是 11:04

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.