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

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

[Octave-patch-tracker] [patch #8812] Added imquantize to image toolset


From: Carnë Draug
Subject: [Octave-patch-tracker] [patch #8812] Added imquantize to image toolset
Date: Wed, 02 Dec 2015 14:35:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.4.0

Follow-up Comment #8, patch #8812 (project octave):

Are you sure of that? That imquantize can't be replaced with lookup? I just
gave it a go, and it passes all of your tests. See what I get using lookup(),
even when the image values are scrambled:


img = [1:10; 11:20; 21:30; 31:40; 41:50; 51:60; 61:70];
idx = reshape (randperm (numel (img)), size (img));
img_s = img(idx);
quant = imquantize (img, [5 15 25 30 40 60]);
quant_s = imquantize (img_s, [5 15 25 30 40 60]);
isequal (quant_s, quant(idx))

ans =  1


I have attached my implementation (two lines if you remove input check).

(file #35615)
    _______________________________________________________

Additional Item Attachment:

File name: imquantize.m                   Size:2 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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