help-octave
[Top][All Lists]
Advanced

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

Re: Applying texture map of image to object using Octave 5.1 error


From: Rick T
Subject: Re: Applying texture map of image to object using Octave 5.1 error
Date: Wed, 6 Mar 2019 05:30:45 -0500

yes it was uint8 and 1024x1024x3 and im2double did fix it thanks!

On Wed, Mar 6, 2019 at 5:20 AM Pantxo Diribarne <address@hidden> wrote:


Le mer. 6 mars 2019 à 10:57, Rick T <address@hidden> a écrit :
I believe it's used as a variable to the image.
 
Yes, "original" contains pixels data, but depending on the original jpg file, those data can be "single", "uint16" ... and Octave only supports "uint8" and "double" data for textures. Hence my question: what does "class (original)" return?
If, as I'd bet, this returns anything but "uint8" or "double", then you can probably cast your data using "im2double" e.g. 

figure ();
im = im2double (imread ("my_image_file.jpg"));
[X,Y,Z] = ellipsoid (0,0,0,10,10,10);
hs = surf (X, Y, Z, "FaceColor", "texturemap", "CData", im);


Pantxo


reply via email to

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