patchGNU Octave - Patches: patch #8058, [image package new function]...


patch #8058: [image package new function] rgb2lab.m

Submitted by:  Ming Liu <liuming198904>
Submitted on:  Sat 25 May 2013 06:01:09 AM UTC  
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

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


Wed 22 Feb 2017 09:36:43 PM UTC, comment #2:

Thanks for submitting this patch, but since
rgb2lab has been added to Image Package,
I am closing this item.

Avinoam Kalma <avinoam>
Project Member
Sat 25 May 2013 03:50:50 PM UTC, comment #1:

I have several major issues with this submission:

1. You should compute the indexes once. For example, when you compute L, you have
L = Y;
L(L > 0.008856) = 116 * L(L > 0.008856).^(1/3) - 16;
L(L<= 0.008856) = 903.3 * L(L<= 0.008856) ;

Instead, compute Li = (L > 0.008856), then use Li or ~Li for all times you need it. Or really, you should compute Xi, Yi, and Zi (e.g. Yi = (Y > 0.008856)) first, then continue on.

2. You are converting signed values (a* and b*) to uint8. What good is this? If you wish to encode the a* and b* values using 8-bits (or 16-bits), follow the ICC spec. But this function should not automatically do that encoding (that should be a separate function). Just return the values as double-precision.

3. You are assuming the RGB data is a 3-dimensional array. What if you wanted to convert a single RGB value to L*a*b*?

4. This does not conform with the standard for converting sRGB to L*a*b*. You should really try to match that standard.

5. This should be part of the effort to add the color management functions to octave (i.e. makecform, applycform, etc.). The conversion from sRGB to L*a*b* should be added as part of those (to-be-added) functions.

Also, in your example, you suggest you can use imshow to display your (uint8) L*a*b* image. That is bogus - imshow expects RGB images.

Patrick Noffke <pnoffke>
Sat 25 May 2013 06:01:09 AM UTC, original submission:

simple colorspace transformation, rgb to lab
I = imread('test.png');
Ilab = rgb2lab(I);

Ming Liu <liuming198904>


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

Attach Files:

Attached Files
file #28164:  Ming_Liu_rgb2lab.patch added by liuming198904 (2KiB - application/octet-stream)
file #28165:  rgb2lab.m added by liuming198904 (2KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by pnoffke (Posted a comment)
  • -email is unavailable- added by liuming198904 (Submitted the item)

    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 logged-in users can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-22 avinoam Open/ClosedOpen => Closed
    2013-05-28 jwe Carbon-CopyRemoved -email is unavailable- => -
    2013-05-25 liuming198904 Attached File- => Added Ming_Liu_rgb2lab.patch, #28164
        Attached File- => Added rgb2lab.m, #28165
        Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.3