The best way to go is probably to capture the image data directly from openGL. (Probably faster than printing it as an image, imreading it, and then adding that as a frame) But, I'm really not sure, and am ok with something being slower if it works.
How to replace the 'hardcopy' function with something that will run in Octave
8 views (last 30 days)
Show older comments
Hello all!
I am working to read in images, lay scatterplot data over them, and then export them as a movie. I have done this successfully in matlab, but need to make it work in Octave now. The only remaining conversion issue is the hardcopy function that I use at the end of the code.
detailed here http://www.mathworks.com/support/solutions/en/data/1-3NMHJ5/?solution=1-3NMHJ5 (in the solution) are two alternatives to the hardcopy function (#2 looks promising) but I'm not sure what of my block of code to replace with the imread calls.
The code I have (which works) is:
renderer = get(hnd,'renderer');
if strcmp(renderer,'painters')
renderer = 'opengl';
end
set(hnd, 'Units', 'pixels');
pixelsperinch = get(0,'screenpixelsperInch');
frame = hardcopy(hnd, ['-d' renderer], ['-r' num2str(round(pixelsperinch))]);
addframe(mov,frame);
I have tried replacing all of that with
addframe(mov,gcf)
But it just returns error: addframe: input frame should be in [0-1]
Any suggestions (or interpretations of the link I posted) on how to use something other than that hardcopy function to accomplish the same goal would be unbeliviably appreciated. Thank you all!
Answers (1)
See Also
Categories
Find more on Measurements and Spatial Audio in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!