octave-maintainers
[Top][All Lists]
Advanced

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

Re: rgb2ind changes


From: Jaroslav Hajek
Subject: Re: rgb2ind changes
Date: Wed, 17 Jun 2009 20:52:28 +0200

On Wed, Jun 17, 2009 at 7:11 PM, <address@hidden> wrote:
> I have made changes to rgb2ind2.m. I have attached a file that includes the
> diff file. sortbynorm is a function that sorts a matrix by the rows of the
> norms.

To sort a matrix by row norms, it suffices to do

[rn, ind] = sort (norm (m, "rows"));
m = m(ind,:);

there is no special function necessary.

further, what does the function actually do, beyond removing the
duplicate colors? it seems to do some smoothing of the palette, but
based on the ordering of pixels, not their distance, which does not
seem a particularly good idea to me. besides, that probably means the
transformation is irreversible. is that a reasonable default?

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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