bugGNU Octave - Bugs: bug #46084, image package: imcrop() doesn't...

 
 

bug #46084: image package: imcrop() doesn't work any more

Submitted by:  Hartmut <hardy>
Submitted on:  Wed 30 Sep 2015 08:51:10 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Open/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.

 

Sun 04 Oct 2015 04:36:20 PM UTC, comment #5:

Thank you guys for the help.

I have pushed Pantxo's patch http://hg.code.sf.net/p/octave/image/rev/90f66be4622a to fix the original bug report. This was pushed to stable.

And I pushed a slightly less verbose version of Avinoam patch to support clicking on the image in any order http://hg.code.sf.net/p/octave/image/rev/54c92ed5bf90

Regarding displaying of a message asking the user to click on the corners I don't like that very much. If the person that will select the region is the person that wrote the code, then the message is not required, that person already knows what to do. If it is not the same person, then we should let the developer choose what best way to inform his users what they have to do in the (via a message at the prompt, a graphical textbox, or something else). We should not be cluttering stdout ourselves. Of course, the ideal situation is when we have a nice looking interactive cropping tool.

Carnë Draug <carandraug>
Project Member
Sun 04 Oct 2015 06:28:33 AM UTC, comment #4:

Regarding comment #3, 2nd remark, the following patch should do the work:

Avinoam Kalma <avinoam>
Project Member
Sat 03 Oct 2015 08:15:40 PM UTC, comment #3:

Thanks for this patch!

I have tested it. And I think it fully solves the original issue of this bug report. You can interactivly crop images (I tested grayscale and rgb) with this patch, now.

Testing the patch, I noticed two (hopefully easy) improvements, that would make this interactive use of the imcrop function even more useful:

  • Couldn't we display a short text message on the console, before the user then needs to click twice into the displayed image? Something like this: "Please click twice into the image figure in order to mark two corners of the area you want to crop out."
  • Currently you first need to click into the upper left corner of your intended crop region, and afterwards into the lower right corner. If you do it the other way round, you will only get an error message. Couldn't we easily resort the return values of ginput in order to make the two clicks work properly, even if they are in the "wrong" order?
Hartmut <hardy>
Sat 03 Oct 2015 03:31:27 PM UTC, comment #2:

Hi,

I attached a very simple patch.

(file #35051)

Pantxo Diribarne <pantxo>
Project Member
Fri 02 Oct 2015 07:51:03 PM UTC, comment #1:

The changeset a17b71b7e407 was a complete rewrite of the function. Before that it was image package version 2.2.0. That version only supported passing the image as input to imcrop so no, this did not work back then. From the file history http://hg.code.sf.net/p/octave/image/log/default/inst/imcrop.m it would seem that this never worked (but please correct me if I'm wrong).

This issue is only when calling imcrop without any input arguments. In this case, it should use the current figure but it's failing to get the actual figure data. I'm really bad in handling figure objects and its childrens so if anyone wants to chip in and fix it, please do so.

Carnë Draug <carandraug>
Project Member
Wed 30 Sep 2015 08:51:10 PM UTC, original submission:

Here is a little script to reproduce the behavior:

With the current Octave (4.0.0) and the current image package (2.4.0) I get this error message: "error: get: unknown figure property cdata".

If I remember right, with image 2.2.0 this was still working. (But I am not sure about this.) Maybe changeset a17b71b7e407 introduced this behavior.

The figure doesn't seem to have any property with the name "cdata", neither with grayscale images (as in the example script), nor with rgb color images.

Hartmut <hardy>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #35051:  find_image.patch added by pantxo (1KiB - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by avinoam
  • -unavailable- added by hardy (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 04 Oct 2015 04:36:20 PM UTCcarandraugStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sat 03 Oct 2015 03:31:27 PM UTCpantxoAttached File-=>Added find_image.patch, #35051
    Sat 03 Oct 2015 09:19:40 AM UTCavinoamCarbon-Copy-=>Added avinoam
    Fri 02 Oct 2015 07:51:03 PM UTCcarandraugItem GroupRegression=>Other
      StatusNone=>Confirmed
      Release4.0.0=>other

    Back to the top


    Powered by Savane 3.1-cleanup1