Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6544983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:31:52+00:00 2026-05-25T11:31:52+00:00

I like blockproc , it makes working with large (very large) images easily. However,

  • 0

I like blockproc, it makes working with large (very large) images easily. However, as far as I understand, it is limited to working with functions that output a matrix of the same size as the input they take.

So I was wondering if there is a way of replicating/simulating what blockproc does but for functions that output a cell array. We can either assume that the output array from the processing function is of the same dimensions of the input matrix, or that it just outputs one cell element, in which case the final output from the total processing would be a cell array with M x N elements, with M and N specifying the tiling for the processing.

I believe I can build this myself using cellfun, but I was wondering if there is are any other builtins or libraries (maybe third-party?) that I can use for this, and maybe even completely avoid reinventing the wheel.

More specifically, I am looking for something that has the same strengths as blockproc:

  • Can load a large image from disk progressively tile-by-tile to minimize the memory footprint of the processing
  • Takes care of the final concatenation of results for building the final cell array
  • Has an interface similar to blockproc (e.g. # of tiles, etc.)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:31:53+00:00Added an answer on May 25, 2026 at 11:31 am

    Below is a solution that satisfies your criteria except for the first point

    Use the IM2COL function to arrange distinct image blocks from the image into columns, then apply your function to each column storing the result in a cell array.

    Of course this only works if all blocks fit into memory, otherwise you would have to manually write code that extracts one block at a time and process it in that way…

    %# read image
    img = im2double(imread('tire.tif'));
    
    %# blocks params
    sizBlk = [8 8];
    numBlk = ceil( size(img) ./ sizBlk );
    
    %# extract blocks
    B = im2col(img, sizBlk, 'distinct');
    B = reshape(B, [sizBlk size(B,2)]);    %# put blocks on the 3rd dimension
    B = squeeze( num2cell(B,[1 2]) );      %# convert to cell array
    B = reshape(B, numBlk);                %# reshape as blocks overlayed on image
    
    %# process blocks
    myFcn = @(blk) [mean2(blk) std2(blk)]; %# or any other processing function
    I = cellfun(myFcn, B, 'UniformOutput',false);
    
    %# in this example, we can show each component separately
    subplot(121), imshow( cellfun(@(c)c(1),I) ), title('mean')
    subplot(122), imshow( cellfun(@(c)c(2),I) ), title('std')
    

    Alternatively, you could still use the BLOCKPROC function, but you have to call it multiple times, each time computing a single feature:

    %# compute one feature at a time
    b1 = blockproc(img, sizBlk, @(b)mean2(b.data), 'PadPartialBlocks',true);
    b2 = blockproc(img, sizBlk, @(b)std2(b.data), 'PadPartialBlocks',true);
    
    %# combine into cellarray of features
    II = arrayfun(@(varargin)[varargin{:}], b1, b2, 'UniformOutput',false);
    
    %# compare to previous results
    isequal(I,II)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like many companies that require all access be through stored procedures, we seem to
Like in the title I want to swap the field that is rendered on
Like the title says, how do I redirect every url that starts with http://example.com/shop
Like many developers working on web sites for Internet Explorer, I seem to come
Like when using aircrack-ng, or any program that has tables of data that constantly
Like a start button on windows ) or something like that, I want to
Like most apps, mine has a users table that describes the entities that can
Like most programmers, I am not an expert on cryptography but I understand the
Like the title says, I can't get Canvas/CanvasLayer working in PlayN. My sample code
Like this one: <div class=abc foo-something> How can I select div that has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.