bugGNU Octave - Bugs: bug #42709, image package: imcrop returns an...

 
 

bug #42709: image package: imcrop returns an image of the incorrect size

Submitted by:  None
Submitted on:  Tue 08 Jul 2014 04:32:54 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Lutz AndersohnOriginator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 09 Jul 2014 11:05:23 AM UTC, comment #3:

This is by design and not a bug. Also required for Matlab compatibility. Basically this is because in RECT ([X_INI Y_INI WIDTH HEIGHT]), X_INI and Y_INI are to be interpreted not as indexing but as coordinates (there is even an option, not yet implemented, to change the coordinate system).

Let's for example assume the simplest example of RECT = [1 1 1 1]. This means that using the standard system, you are not setting the left top coordinate of the cropping rectangle to the top of element (1, 1), but to the center of that rectangle (1.5, 1.5). Then, when you set WIDTH and HEIGHT both to 1, you set the bottom right corner of the rectangle to (2.5, 2.5). Since imcrop() returns any element that is only partially selected, it will return both the first and second rows and columns. Try the following examples:

I guess it could be made more clear on the documentation. Could you please write a nicer explanation for this?

Carnë Draug <carandraug>
Project Member
Wed 09 Jul 2014 02:59:58 AM UTC, comment #2:

Sorry if I posted this to the wrong list. I have image-2.2.1 installed.

Incidentally, just reported another bug for imcrop for this package.

Anonymous
Tue 08 Jul 2014 04:42:11 PM UTC, comment #1:

Thanks for your bug report. The imcrop function is part of the image package, not part of Octave 3.8.1. Which version of the image package do you have installed?

Mike Miller <mtmiller>
Project Administrator
Tue 08 Jul 2014 04:32:54 PM UTC, original submission:

I call image crop in an image like this:
which is supposed to return a 500x500 size image from the center of the original image.
The image that is returned has 501x501 pixels.

I think the problem is that the imgcrop.m code in line 164 when assigning i_end subtly switches from interpreting the last two parameters as a length to an index. changing the line from
to
should fix the problem. May need some special treatment if the last to parameters are 0 so that nothing is returned.

Anonymous

 

(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 mtmiller (Posted a comment)
  • -unavailable- added by None (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
    Wed 09 Jul 2014 11:05:23 AM UTCcarandraugStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Tue 08 Jul 2014 04:42:11 PM UTCmtmillerCategoryOctave Function=>Octave Forge Package
      StatusNone=>Need Info
      Release3.8.1=>other
      Summaryimgcrop in version 3.8.1 returns an image of the incorrect size=>image package: imcrop returns an image of the incorrect size

    Back to the top


    Powered by Savane 3.1-cleanup1