Re: Resize image using imresize gives an error in octave

RT <[email protected]>
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAHN3+dvotpVLWDVf+To6KPNynnwAFFt2K_dTRj-CR58_nGgr1w@mail.gmail.com>
To see the images and what I tried? I also posted to
https://stackoverflow.com/questions/68310913/resize-image-using-imresize-gives-an-error-in-octave?noredirect=1#comment120739744_68310913



On Fri, Jul 9, 2021 at 7:40 AM RT <[email protected]> wrote:

>
> 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.