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

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

[Octave-bug-tracker] [bug #60946] [octave forge] (image) bug in imresize


From: Hartmut
Subject: [Octave-bug-tracker] [bug #60946] [octave forge] (image) bug in imresize implementation
Date: Sun, 25 Jul 2021 11:51:38 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Follow-up Comment #4, bug #60946 (project octave):

My last patch (V1) is actually not yet the full solution. It makes it possible
to use imresize on images of size 1x1x3. But it does not yet work (for
arbitrary interpolation methods) for images of size 1xNx3 or Nx1x3.

To improve my last patch, I wanted to further add special cases to imremap.m.
Below is code that I would suggest to use:


  for i = 1:n_planes
    if isscalar (im(:,:,i))
      warped(:,:,i) = double(im(:,:,i));
    elseif size(im, 1) == 1
      warped(:,:,i) = ones(size(XI,1), 1) * interp1 (double (im(1,:,i)),
XI(1,:), interp, extrapval);
    elseif size(im, 2) == 1
      warped(:,:,i) = interp1 (double (im(:,1,i)), YI(:,1), interp,
extrapval)' * ones(1, size(YI,2));
    else
      warped(:,:,i) = interp2 (double (im(:,:,i)), XI, YI, interp,
extrapval);
    endif
  endfor


Unfortunatelly the (core) Octave function interp1.m does not behave in the way
I expected it, so currently this code does not work. (Matab's interp1 works
fine in this respect.) I filed bug #60967 for this. During the meantime I see
no useful way to go forward, here. (But let me know if you do.)

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60946>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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