octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #42709] imgcrop in version 3.8.1 returns an im


From: anonymous
Subject: [Octave-bug-tracker] [bug #42709] imgcrop in version 3.8.1 returns an image of the incorrect size
Date: Tue, 08 Jul 2014 16:32:55 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0

URL:
  <http://savannah.gnu.org/bugs/?42709>

                 Summary: imgcrop in version 3.8.1 returns an image of the
incorrect size
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 08 Jul 2014 04:32:54 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Lutz Andersohn
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I call image crop in an image like this:

 CroppedI = imcrop(I, [(CentRowImg)-(CropImSqResSize/2)
(CentColImg)-(CropImSqResSize/2) 500 500);

 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

i_end = round ([rect(1)+rect(3) rect(2)+rect(4)]);

to

i_end = round ([rect(1)+rect(3)-1 rect(2)+rect(4)-1]);

should fix the problem. May need some special treatment if the last to
parameters are 0 so that nothing is returned.








    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42709>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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