problem of applying block processing function

my image is gray scale image of 100*120. my programme is
*fun=@(x) x.*2;
B = blkproc(I,[4 4],[1 1],fun);*
when i'm looking for 1st sub block it gives only a single number, it equals to the twice of (1,1) pixel value of original image. can't i get the twice of 1st 4*4 block.is it possible or not.

 採用された回答

Image Analyst
Image Analyst 2013 年 9 月 20 日

1 投票

It gives a single number but you can multiply by ones(blockSize) to expand it. See the attached demos scripts.

8 件のコメント

mahesh chathuranga
mahesh chathuranga 2013 年 9 月 20 日
can you please edit my codes.thanks.
mahesh chathuranga
mahesh chathuranga 2013 年 9 月 20 日
my 1st sub block is[1 12 3 5;34 78 9 4;1 2 3 4;5 6 7 8]; when i'm run my programme,it gives only 2 for the out put of B(1,1).but i want to get this[2 24 6 10;68 156 18 8;2 4 6 8;10 12 14 16].how can i get this.
Image Analyst
Image Analyst 2013 年 9 月 20 日
編集済み: Image Analyst 2013 年 9 月 20 日
I don't know what you're doing. You didn't attach your code. Can't you figure it out from the two examples I gave you? No need to accept an answer until your problem is solved.
mahesh chathuranga
mahesh chathuranga 2013 年 9 月 23 日
sorry.i dont know how to figure out this.
Image Analyst
Image Analyst 2013 年 9 月 23 日
Figure what? Figure out how to download and run the two well-commented examples I included? Just click on the filenames, type control-a, control-c, go to an empty/new editor window in MATLAB, and type control-v, then click the green triangle. Go here for more help http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
mahesh chathuranga
mahesh chathuranga 2013 年 9 月 25 日
It gives the error message ??? Undefined function or method 'blockproc' for input arguments of type 'function_handle'.
Error in ==> Untitled at 44 blockyImage8 = blockproc(single(grayImage), blockSize, medianFilterFunction);
Image Analyst
Image Analyst 2013 年 9 月 25 日
You must have a really, really old version of MATLAB. It had a different name back then, something like blkproc, blkprc, or something like that. You need to find out what it's called in your ancient version of MATLAB. Or just upgrade.
mahesh chathuranga
mahesh chathuranga 2013 年 9 月 25 日
I,m working with R2009a,it uses blkproc. but is there any method in matlab to find the old codes.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by