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.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 20 Sep. 2013

1 Stimme

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

8 Kommentare

can you please edit my codes.thanks.
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 am 20 Sep. 2013
Bearbeitet: Image Analyst am 20 Sep. 2013
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.
sorry.i dont know how to figure out this.
Image Analyst
Image Analyst am 23 Sep. 2013
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
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 am 25 Sep. 2013
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.
I,m working with R2009a,it uses blkproc. but is there any method in matlab to find the old codes.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by