matlab - Blockproc-like function for cell array output -
I like it work smoothly with large (huge) images, however, as far as I understand, It is limited to working with the function, which is the output matrix of the same size as the input they take, so I was wondering if the I believe that I can build it using myself, but I was wondering if there are any other bilitans or libraries (maybe third parties?) Which I use for it I can, and even completely avoid changing the wheel completely. Below is a solution that satisfies the first thing Your criteria image blocks different from image Use IM2COL function to organize the micro column, then apply your function to accumulated results in cell function in each room. > Of course, this only works when all the blocks are fitted in memory, otherwise you have to type the code manually, which removes a block at a time and thus processes it Is ... Alternatively, you can still use the BLOCKPROC function, Calling multiple times, each time calculating the same feature: blockproc < There is a way to copy / emulate / code>, but output a cell array for the function, we can either assume that Output array from the recording function is of the same dimensions as the input matrix, or it only produces a cell element, in this case the total output from the total processing will be a cell array with
N , the tile has been referenced.
blockproc (eg # 1)
% # read image img = im2double (imed ('tire.tif')); % # Blocks params sizBlk = [8 8]; NumBlk = Ceiling (size (IMG) ./sizBlk); % # Remove Block B = IM 2 Cole (IMG, SISBL, 'Separate'); B = reshape (B, [sizBlk size (b, 2)]); Pause% 3 # Dimension B = Squeeze (num2cell (B, [1 2])); Convert to% # cell array B = reshape (B, numBlk); % 2 blocks the image as a overlay on the block% myFcn = @ (blk) [mean2 (blk) std2 (blk)]; % # Or any other processing function I = cellphone (myFcn, B, 'UniformOutput', incorrect); % # In this example, we can separate each component from subplot (121), imso (cellphone (@ (c) c (1), i), title ('mean') subplot (122), imshov (cellphone (@ (C) C (2), I), Title ('STD')
% # Once B1 = BlockProx (IMG, SISBBike, @ (B) Mean 2 (B DATA) , 'PADPartial Blow A '); B2 = BlockProx (IMG, Szblack, @ (B) STD2 (B DATA), 'PADPartial Blocks' is true); Allocation of% # properties in the cellar II = array (@ (virgin) [vergin {:}], b1, b2, 'uniform effect', false); % # Is unlike the previous results (I, II)
Comments
Post a Comment