bugGNU Octave - Bugs: bug #37410, image.m has a wrong check for...

 
 

bug #37410: image.m has a wrong check for linearly-spaced x and y

Submitted by:  Francesco Potortì <pot>
Submitted on:  Thu 20 Sep 2012 11:44:33 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 3.6.2Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 20 Sep 2012 01:50:18 PM UTC, comment #4:

I'd like to eliminate the use of length in Octave because the definition of length (inherited from prehistoric Matlab) is weird. So please use numel instead unless there is some specific case that actually needs the strange behavior of the length function. And in that case, please comment why it is needed.

John W. Eaton <jwe>
Project Administrator
Thu 20 Sep 2012 01:29:14 PM UTC, comment #3:

Yes. This is the code as I am currently using it:

dx = diff (x);
dy = diff (y);
dx = std (dx) / mean (abs (dx));
dy = std (dy) / mean (abs (dy));
tol = 100*eps;
if (any (dx > length(x)tol) || any (dy > length(y)tol))
warning ("Image does not map to non-linearly spaced coordinates")
endif

The only change is in the 'if' condition.

Francesco Potortì <pot>
Thu 20 Sep 2012 01:18:12 PM UTC, comment #2:

Did you mean:
tol = 100length(x) eps;

Doug Stewart <dastew>
Thu 20 Sep 2012 12:05:25 PM UTC, comment #1:

Sorry, I meant length(x) rather than rows(x).

Francesco Potortì <pot>
Thu 20 Sep 2012 11:44:33 AM UTC, original submission:

The check in image.m is

dx = diff (x);
dx = std (dx) / mean (abs (dx));
tol = 100*eps;
if (any (dx > tol))
warning

but this is too strict.

I stumbled upon it with x=linspace(0,10.43,743);

I suggest to set

tol = 100*rows(x);

Francesco Potortì <pot>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by pot (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup