[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need a test in matlab to implement imformats in Octave
From: |
Laurent Hoeltgen |
Subject: |
Re: need a test in matlab to implement imformats in Octave |
Date: |
Fri, 05 Jul 2013 17:02:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
On 07/05/2013 04:50 PM, Carnë Draug wrote:
On 5 July 2013 08:22, PhilipNienhuis <address@hidden> wrote:
Carnë Draug-4 wrote
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:
This contains quite a bit of invalid ML syntax. [...]
Sorry. I always get caught in Octave's incompatibility bugs. It's not
like Octave changes that fast, Mathworks should have already fixed
this by now :p
Error using testreadjpg
Too many output arguments.
Error in imread (line 415)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
... so I think testreadjpg.m contains additional errors. It doesn't even get
called as there's no 'im initialized' message.
Could you please try again and define testreadjpg as
function [out, m] = testreadjpg (filename)
persistent im;
if (isempty (im)); im = 1; fprintf ('im initialized\n'); end
disp (im)
if (im > 3), error ('stuck in a loop\n'); end
im = im + 1;
[out, m] = imread (filename);
end
From their documentation, the test should either print 1, 2, 3 and
then give an error, or return the image. Unless, there's another
interpretation that I'm missing :(
Thank you,
Carnë
Hi,
Matlab R2012a output:
>> fmt = imformats ('jpg')
fmt =
ext: {'jpg' 'jpeg'}
isa: @isjpg
info: @imjpginfo
read: @readjpg
write: @writejpg
alpha: 0
description: 'Joint Photographic Experts Group (JPEG)'
>> fmt.read = @testreadjpg;
>> imformats ('update', 'jpg', fmt);
>> img = imread ('lena.jpg');
im initialized
1
2
3
4
Error using testreadjpg (line 5)
stuck in a loop\n
Error in imread (line 435)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
Error in testreadjpg (line 7)
[out, m] = imread (filename);
Error in imread (line 435)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
Error in testreadjpg (line 7)
[out, m] = imread (filename);
Error in imread (line 435)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
Error in testreadjpg (line 7)
[out, m] = imread (filename);
Error in imread (line 435)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
>> image (img)
Undefined function or variable 'img'.
>>