video - Matlab: How to distribute workload? -


i trying record footage of camera , represent matlab in graphic window using "image" command. problem i'm facing slow redraw of image , of course effects whole script. here's quick pseudo code explain program:

    figure     while(true)       frame = acquireimagefromcamera();  % mex, returns current frame       image(i);     end 

acquireimagefromcamera() mex coming api camera. without displaying acquired image script grabbs frames coming camera (it records limited framerate). display every image real-time video stream, slows down terribly , therefore frames lost not captured.

does have idea how split process of acquiring images , displaying them in order use multiple cores of cpu example? parallel computing first thing pops mind, parallel toolbox works entirely different form want here...

edit: i'm student , in faculty's matlab version toolboxes included :)

i'm not sure how precise pseudo code is, creating image object takes quite bit of overhead. faster create once , set image data.

figure himg = image(i) while(true)   frame = acquireimagefromcamera();  % mex, returns current frame   set(himg,'cdata',frame);   drawnow; %also make sure screen updated. end 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -