octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

need a test in matlab to implement imformats in Octave


From: Carnë Draug
Subject: need a test in matlab to implement imformats in Octave
Date: Thu, 4 Jul 2013 22:40:00 +0100

Hi

could someone with matlab run a test for me in. I'm trying to
understand how the image IO functions work after messing up with
imformats. The test is the following:

1) add the following function somewhere in the path

function [out] = testreadjpg (filename)
  persistent im = 1;
  disp (im)
  if (im > 3), error ('stuck in a loop\n'); end
  im++;
  out = imread (filename);
end

2) running the following code:

fmt = imformats ('jpg');
fmt.read = @testreadjpg;
imformats ('update', 'jpg', fmt);
img = imread (PATH_TO_SOME_JPG);
image (img)

3) what gets displayed on the promp and does the last command displays
the image?

By the way, messing with imformats changes the way matlab reads images
so after this you'll want to restart the matlab session or run
"imformats ('factory')"

Thanks in advance,
Carnë


reply via email to

[Prev in Thread] Current Thread [Next in Thread]