bugGNU Octave - Bugs: bug #43846, image: imresize does not accept...

 
 

bug #43846: image: imresize does not accept floating point outside the [0 1] range

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Thu 18 Dec 2014 02:54:45 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: AvinoamOpen/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Thu 12 Nov 2015 04:39:22 PM UTC, comment #6:

I have pushed

http://hg.code.sf.net/p/octave/image/rev/17ed4752a081

Instead of a local isrgb and isgray, I just dropped those functions. This not only adds support for values outside the [0 1] range, it also allows the image to have any number of dimensions (although the function that actually performs the resize simple loops over each plane).

Carnë Draug <carandraug>
Project Member
Wed 11 Nov 2015 05:18:20 PM UTC, comment #5:

I've been bitten by this bug as well, any problems with the suggested patch?

Matthew Berginski <mbergins>
Fri 23 Jan 2015 03:09:13 PM UTC, comment #4:

Can you review the submitted patch?

Avinoam Kalma <avinoam>
Project Member
Sun 21 Dec 2014 08:20:20 PM UTC, comment #3:

Hi,

In order to fix this problem, isgray should be changed im imresize.
Changing isgray outside resize would cause problems in Matlab compatibility, so I have changed isgray to local_isgray, and in local_isgray
I have removed the is_double_image condition.

Please review the follwoing patch.

attached: imresize.diff & imresize.m

Thanks,

Avinoam

(file #32699, file #32700)

Avinoam Kalma <avinoam>
Project Member
Fri 19 Dec 2014 10:03:40 PM UTC, comment #2:

Hi,

Thanks,
I will check which of the tests should be remove,
and try to provide a patch.

Avinoam

Avinoam Kalma <avinoam>
Project Member
Thu 18 Dec 2014 07:25:33 PM UTC, comment #1:

The problem is not the negative values, the problem are values outside the range [0 1].

The function uses isrgb() and isgray() (two functions which were part of Matlab but removed recently) to check for valid input. Those functions return false if input is floating point but there is a value outside the [0 1] range (seems Matlab is dropping this but those were not valid images before).

Can you provide a patch that fixes this and adds tests for this situation?

http://www.gnu.org/software/octave/doc/interpreter/Basics-of-Generating-a-Changeset.html#Basics-of-Generating-a-Changeset

Just replace the URL for the repository with the one for the image package, the rest of the instructions are the same.

I think you will need to remove the check but please make sure there's no assumption anywhere else that values are on that range.

Carnë Draug <carandraug>
Project Member
Thu 18 Dec 2014 02:54:45 PM UTC, original submission:

Hi,

while Matlab computes the result of imresize.

Thanks,

Avinoam

Avinoam Kalma <avinoam>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #32699:  imresize.diff added by avinoam (2KiB - application/octet-stream)
file #32700:  imresize.m added by avinoam (13KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mbergins (Posted a comment)
  • -unavailable- added by avinoam (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

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

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 12 Nov 2015 04:39:22 PM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release3.8.2=>other
    Sun 21 Dec 2014 08:20:20 PM UTCavinoamAttached File-=>Added imresize.diff, #32699
      Attached File-=>Added imresize.m, #32700
    Thu 18 Dec 2014 07:25:33 PM UTCcarandraugSummaryimresize does not work with negative images=>image: imresize does not accept floating point outside the [0 1] range

    Back to the top


    Powered by Savane 3.1-cleanup1