bugGNU Octave - Bugs: bug #50152, image: rgb2ycbcr and ycbcr2rgb...


bug #50152: image: rgb2ycbcr and ycbcr2rgb conversions do not preserve single class

Submitter:  None
Submitted:  Thu 26 Jan 2017 09:33:12 AM UTC
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Sun 29 Jan 2017 03:55:34 PM UTC, comment #4: 

Thank you guys for the bug report and patch.  Both issues now fixed.

Docs fixed on stable http://hg.code.sf.net/p/octave/image/rev/2ab0db706c5f

Single class issue fixed on default since it is not a regression and backwards incompatible http://hg.code.sf.net/p/octave/image/rev/cecb20d64f40

Note that instead of converting back to single at the end, the change simple skips the conversion to double.  This is because that if the image is class single, the user has accepted to sacrifice the precision to reduce memory usage so we shouldn't be converting to double internally.

I am wondering if maybe we should also use single for images in uint8 at least.

Carnë Draug <carandraug>
Group Member
Fri 27 Jan 2017 09:20:57 AM UTC, comment #3: 

This bug is similar to bug #49941

Avinoam Kalma <avinoam>
Group Member
Thu 26 Jan 2017 01:12:46 PM UTC, comment #2: 

Thank you for your bug report, including a fix for this already.

I have changed your PATCH slightly (reattached as V2 patch file) to better match the current struccture of the code, added changes of the help string, and added some people to cc who care about the Octave image package.

(file #39562)

Hartmut <hardy>
Thu 26 Jan 2017 09:37:52 AM UTC, comment #1: 

Also, the help of both functions has a (copy-paste?) error and mentions both "601" and "709" as (default), but only "601" is it seems.

Thu 26 Jan 2017 09:33:12 AM UTC, original submission:  

If input image to rgb2ycbcr or ycbcr2rgb is of class single, output will be returned as double.

For uint8 and uint16 inputs, the same class is returned.

The attached patch should handle the single case as well.



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

Attach Files:

Attached Files
file #39562:  ycbcrfunc_V2.patch added by hardy (2KiB - text/x-diff)
file #39561:  ycbcrfunc.patch added by None (536B - application/octet-stream - ycbcrfunc patch to preserve single class input/output)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by avinoam (Updated the item)
  • -email is unavailable- added by hardy (Updated the item)
  • -email is unavailable- added by hardy
  • -email is unavailable- added by hardy

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-29 carandraug Dependencies- bugs #49941 is dependent
    2017-01-29 carandraug StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
        Release4.2.0 other
        Summaryrgb2ycbcr and ycbcr2rgb conversions do not preserve single class image: rgb2ycbcr and ycbcr2rgb conversions do not preserve single class
    2017-01-27 avinoam StatusNone Patch Submitted
    2017-01-26 hardy Attached File- Added ycbcrfunc_V2.patch, #39562
        Carbon-Copy- Added avinoam
        Carbon-Copy- Added carandraug
    2017-01-26 None Attached File- Added ycbcrfunc.patch, #39561

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code