Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
how this [1 2] working and giving me the difference ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
My code is working well, everything is expected as it should be but i want to go deep and want to learn more how this code is giving me the difference ?
Is [1 2] divide it into blocks ? If yes then how ?
O_IMAGE = imread('boat_256x256.tif');
% The difference
THE_DIFF = blkproc(double(O_IMAGE), [1 2], inline('x(1) - x(2)'));
Anyone who can elaborate it to me ? Thanks in Advance
0 Kommentare
Antworten (1)
Walter Roberson
am 15 Aug. 2020
blkproc is considered obsolete and should not be used.
[1 2] means that the function will start in the top left corner and take a 1 pixel by 2 pixel part of the image, and will pass that to the function and will store the result. Then it will move right by 2 pixels and take 1x2 pixels there, pass that to the function, and it will keep sliding the window over two pixels at a time. When it gets to the end of the first row it will start at the beginning of the second row, take 1x2 there, pass it to the function and so on.
The way it does all of this is by using for loops internally. The code did not separate the image into separate variables and process each variable, and did not create cell arrays of subsets and process each subset: it just used for loops.
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!