[Top][All Lists]

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

Re: colorspace_conversion_input_check

From: Carnë Draug
Subject: Re: colorspace_conversion_input_check
Date: Wed, 17 Jan 2018 17:00:41 +0000

On 17 January 2018 at 16:47, Rik <address@hidden> wrote:
> Carnë,
> According to the Matlab documentation, input images for rgb2gray and
> rgb2hsv can only be of type double, single, uint8, uint16.  However, the
> input validation is also accepting int8 and int16:
>     if (! any (strcmp (cls, {"uint8", "int8", "int16", "uint16", ...
>                              "single", "double"})))
>       error ("%s: %s of invalid data type '%s'", func, arg_name, cls);
> Should we remove support for int8 and int16, or is there undocumented
> Matlab voodoo and images of those types are accepted?
> I've finished up with rgb2gray, except for this issue.

In Matlab, rgb2hsv fails with int8 and int16 types, while rgb2gray
accepts both int8 and int16.

The int16 is a valid image data type, and Matlab has a im2int16
function and other im2X functions will accept int16 type.  int8 is not
recognized but often works fine too.  I prefer to support all of those
data types since the code is usually the same, it's more work to
actually filter them out, and makes the image processing functions
more consistent.


reply via email to

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