bugGNU Octave - Bugs: bug #56169, [octave forge] (image) images of...

 
 

bug #56169: [octave forge] (image) images of class double or single fail to convert to class uint8

Submitted by:  None
Submitted on:  Fri 19 Apr 2019 08:02:06 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  5.1.0
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sat 20 Apr 2019 01:53:11 AM UTC, comment #1: 

Where was the `im` data sourced from? It's hard to reproduce this without a full example. Can you attach an example input file to this issue?

Maybe you're not supposed to call im2uint8 on LAB-space image data? I don't know that the data structures used by the image toolbox have enough metadata for the functions to know whether they're RGB or LAB-space images. So maybe it's seeing that the input is a double, assuming it's RGB, in which case the values should have been in the interval [0.0 1.0], so these LAB values which are >1 are just saturating it and pegging all the values to 1.0, which gets normalized to 255 in uint8 space.

Andrew Janke <apjanke>
Fri 19 Apr 2019 08:02:06 AM UTC, original submission:  

>> lab = rgb2lab(im);
>> im(1:10,1:10,1)

ans =

  21  21  21  21  22  23  22  18  20  23
  24  23  21  21  21  20  20  19  21  22
  23  23  22  21  21  20  20  20  21  20
  25  23  21  21  21  22  22  22  23  24
  21  21  21  21  21  22  20  22  23  24
  25  22  21  21  21  21  21  21  22  23
  23  21  21  22  22  22  23  20  20  23
  25  24  24  22  22  22  23  23  24  24
  24  24  22  22  21  21  22  20  22  24
  26  23  21  21  22  22  20  19  20  23

>> lab(1:10,1:10,1)

ans =

   34.908   32.971   32.649   31.366   32.296   32.911   31.653   30.946   31.108   31.565
   34.340   32.965   32.762   31.892   31.570   31.603   31.925   31.697   31.745   31.451
   34.525   33.343   32.674   32.483   31.513   32.514   32.784   32.784   32.428   31.811
   34.362   33.343   32.064   32.271   31.513   32.296   31.749   31.749   33.128   32.725
   34.157   33.941   32.647   32.807   31.835   31.216   32.191   31.216   32.210   33.102
   34.629   33.428   31.686   31.628   32.103   31.399   31.686   30.410   31.711   32.965
   34.954   33.460   29.527   31.314   31.595   31.274   31.016   31.208   31.589   32.533
   36.233   33.960   33.314   32.399   31.805   32.019   32.478   31.887   32.614   33.102
   36.209   34.604   33.051   31.694   32.374   31.456   31.481   31.165   31.102   31.271
   35.565   35.274   33.140   32.807   31.917   30.694   32.135   31.511   32.079   32.424

>> a = im2uint8(lab);
>> size(a)

ans =

   308   168     3

>> class(a)

ans = uint8

>> a(1:10,1:10,1)

ans =

  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255
  255  255  255  255  255  255  255  255  255  255

>>

บบบบบบบบบบบบบบบบบบบ 翀 øᏊ貀 퀰 '￿)￿p￿é￿w￿v￿u￿t￿,￿(￿&￿￿Ž

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by apjanke (Posted a comment)
  •  

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

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-19 mtmiller CategoryOctave Function => Octave Forge Package
        Summaryimages of class double or single fail to convert to class uint8 => [octave forge] (image) images of class double or single fail to convert to class uint8

    Back to the top


    Powered by Savane 3.5