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

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

[Octave-patch-tracker] [patch #9281] Image package: imsharpen


From: Hartmut
Subject: [Octave-patch-tracker] [patch #9281] Image package: imsharpen
Date: Tue, 4 Apr 2017 16:19:58 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #7, patch #9281 (project octave):

When I test the latest version of imsharpen (see comment #5) and add the
"double" command to the call to rgb2lab (as proposed in comment #6), then I
still see the very same tests failing. But many more tests also fail, and the
failing test fail by a much bigger amount (bigger than just a value of 1).

The reason for this is: Using the "double" command on an uint8 image gives you
floating point numbers, but still in the range of 0...255. This is not the
kind of input values that rgb2lab wants to have. So I think it will not treat
the values >1 properly and just use a very, very dark input image. I think
this is no bug of rgb2lab (I expect Matlab does the very same), it's just that
you should better use the "im2double" command for this type conversion. (But
even this is unnecessary in this case, since rgb2lab does this conversion
itself if necessary.)

I would assume that the remaing failing tests (failing by a difference of 1)
are due to some slight discrepancy between the calculation methond in
Avinoam's imsharpen.m and the Matlab version. I would guess that Matlab adds
the number 1 somewhere explicitly in the code. (But I would love to be proven
wrong, Avinoam. So go ahead and double check this.) If this turns out to be
the case, then I am not sure if I really want to copy the Matlab behavior, or
instead better stick to the "text book" version, that Avinoam's code properly
mimics. We could then make a small note of this in the help string.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9281>

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




reply via email to

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