bugGNU Octave - Bugs: bug #41240, image class is not preserved in...

 
 

bug #41240: image class is not preserved in cdata field of graphics handle

Submitted by:  CarnĂ« Draug <carandraug>
Submitted on:  Wed 15 Jan 2014 05:43:22 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 01 May 2014 08:28:17 PM UTC, comment #5:

I added support for images to use the logical data type (http://hg.savannah.gnu.org/hgweb/octave/rev/d57a83f2d73e). I then overhauled the imshow routine to get rid of the conversion to double. I also did a lot of other cleanup on imshow. It's not perfect, but is way better than before (http://hg.savannah.gnu.org/hgweb/octave/rev/0585787aa8ae).

Rik <rik5>
Project Administrator
Sun 27 Apr 2014 08:49:19 AM UTC, comment #4:

Here is a test in Matlab:

The image class is always preserved for the case of logical and uint8 integer images. Tell me if more exhaustive tests are needed.

Pantxo Diribarne <pantxo>
Project Member
Sat 26 Apr 2014 11:46:16 PM UTC, comment #3:

I added support in C++ for integer formats with this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/44f0d1a53ead). Octave can will now store cdata in the same datatype (uint8, single, etc.) as the original input format to image().

At this point, this bug should be easy to fix. In imshow.m there is this line:

This line was coded a long time ago and is probably no longer accurate. Someone with access to Matlab should verify how imshow behaves and possibly this line can be deleted. Actually, the whole of imshow looks like it could be cleaned up to just call image or imagesc for the backend.

Rik <rik5>
Project Administrator
Wed 29 Jan 2014 06:26:31 AM UTC, comment #2:

This has been a known issue for a while. See image.m and the following lines

which I added. There is currently no support for integer formats (zero-based indexing in the C++ renderer.

Rik <rik5>
Project Administrator
Sun 19 Jan 2014 06:53:15 PM UTC, comment #1:

Confirmed in default version as well.

Mike Miller <mtmiller>
Project Administrator
Wed 15 Jan 2014 05:43:22 PM UTC, original submission:

The data of an image being plotted is kept in the field cdata, but the class has changed. This is important because the class of an image changes how the data is interpreted.

For example:

Note how the the same function, imshow, displays the image so differently. As uint8, it's a gradient, as double, it's all white (since images of class double should be on range [0 1]).

The effect this has on other functions is that it's not possible to retrieve the image from a figure (required for things such as impixel and imcrop which return parts from the current or a specified figure).

I looked at the other fields available from get() but didn't notice anything that would point to the original class.

Also, this works in MatLab so it stacks as a matlab compatibility bug.

Carnë Draug <carandraug>
Project Member

 

(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 pantxo (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by carandraug (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 01 May 2014 08:28:17 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sun 19 Jan 2014 06:53:15 PM UTCmtmillerCategoryNone=>Plotting
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1