Resize image using imresize gives an error in octave

RT <[email protected]>
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAHN3+dsC=R2mT4=sBWt7C7kRzMJcmCXin-kns-SjS5nUpzg_WA@mail.gmail.com>
I'm trying to resize a **very small image** using Octave 5.2.0 but I'm not
sure why it's giving an error when trying to resize it

The error happens with the line below:

    img_unique_only = imresize(f2, [640, 480]); %reshape output of unique
colors

-

    error: interp2: cubic requires at least 2 points in each dimension
    error: called from
        interp2 at line 244 column 9
        imremap at line 65 column 19
        imresize at line 135 column 8
        test_small_resize_question at line 30 column 17 (the last line
which is the imresize line)

Code Below:

    pkg load image

    f(:,:,1)=[0;0;0;0;127;128;128;128];

    f(:,:,2)=[0;0;127;128;0;0;0;0];

    f(:,:,3)=[127;128;0;0;0;0;127;128];

%%%%%%%%%%%%%%%%-------------------------------------------------------------------------

    [im_r im_c]=size(f);
    size_min=min(im_r,im_c); %get minum size from row and col
   f2=uint8(f); %convert to image format
    img_unique_only = imresize(f2, [640, 480]); %reshape output of unique
colors

Note: I'm also willing to try another way if better
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.