Surfaces & pictures

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Surfaces & pictures

fbarbuto

Hi,

Is there a way to project a picture (a jpg, png, whatever) onto a
3-D surface plotted with surf()?

Regards,

Fausto




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

Jordi Gutiérrez Hermoso-2
On Thu, 2015-05-14 at 18:43 +0000, Fausto Arinos de A. Barbuto wrote:
> Is there a way to project a picture (a jpg, png, whatever) onto a3-D
> surface plotted with surf()?

This is called texture-mapping. I don't believe we have this ability
in Octave yet.

- Jordi G. H.



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

inor0627
In reply to this post by fbarbuto
fbarbuto wrote
Hi,
Is there a way to project a picture (a jpg, png, whatever) onto a3-D surface plotted with surf()?
Hello Fausto,

In the function reference of surf, an additional color argument is mentioned:

"Optionally, the color of the surface can be specified independently of z by supplying a color matrix, c."

So using your (maybe modified) picture as 'c', surf(xx,yy,zz,c) in combination with an appropriate colormap might do the trick.

Best regards,
Ingo


Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

Helios de Rosario
In reply to this post by fbarbuto
>>> El día 16/05/2015 a las 20:26, Jordi GutiérrezHermoso
<[hidden email]>
escribió:
> On Thu, 2015-05-14 at 18:43 +0000, Fausto Arinos de A. Barbuto
wrote:
>> Is there a way to project a picture (a jpg, png, whatever) onto
a3-D
>> surface plotted with surf()?
>
> This is called texture-mapping. I don't believe we have this ability
> in Octave yet.
>
> - Jordi G. H.

I think we do, if I understood Faustino's question correctly. Say we
have this 50x50 RGB image (a cyan cross):

img = ones(50,50,3);
img(1:51:50^2) = 0;
img(50:49:50^2) = 0;

It can be projected onto a 50x50 surface just like this:

surf(sombrero(50), img)

You can use "imread" to read the image from the file into a matrix.

Helios De Rosario


ibv.org/anuario2014
Conoce la actividad más destacada del IBV en 2014
______________________________

INSTITUTO DE BIOMECÁNICA DE VALENCIA
Universidad Politécnica de Valencia • Edificio 9C
Camino de Vera s/n • 46022 VALENCIA (ESPAÑA)
Tel. +34 961111170- +34 610567200 • Fax +34 96 387 91 69
www.ibv.org

Antes de imprimir este e-mail piense bien si es necesario hacerlo.
En cumplimiento de la Ley Orgánica 15/1999 reguladora de la Protección
de Datos de Carácter Personal, le informamos de que el presente mensaje
contiene información confidencial, siendo para uso exclusivo del
destinatario arriba indicado. En caso de no ser usted el destinatario
del mismo le informamos que su recepción no le autoriza a su divulgación
o reproducción por cualquier medio, debiendo destruirlo de inmediato,
rogándole lo notifique al remitente.


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

fbarbuto
On 18-05-2015 05:32, Helios de Rosario wrote:

> I think we do, if I understood Faustino's question correctly. Say we
> have this 50x50 RGB image (a cyan cross):
>
> img = ones(50,50,3);
> img(1:51:50^2) = 0;
> img(50:49:50^2) = 0;
>
> It can be projected onto a 50x50 surface just like this:
>
> surf(sombrero(50), img)
>
> You can use "imread" to read the image from the file into a matrix.
>

Thanks, but it did not work. I forgot to say I'm using Octave 3.8.1 on
a Ubuntu 14.04-64 installation.  The list of packages I have using are:

               bim *|   1.1.3 | /usr/share/octave/packages/bim-1.1.3
         dataframe  |   1.1.0 | /home/fausto/octave/dataframe-1.1.0
      econometrics  |   1.1.1 | /home/fausto/octave/econometrics-1.1.1
         financial  |   0.4.0 | /home/fausto/octave/financial-0.4.0
               fpl *|   1.3.4 | /usr/share/octave/packages/fpl-1.3.4
           general *|   1.3.4 | /usr/share/octave/packages/general-1.3.4
          geometry *|   1.7.0 | /usr/share/octave/packages/geometry-1.7.0
                io *|   2.0.2 | /usr/share/octave/packages/io-2.0.2
    linear-algebra  |   2.2.1 | /home/fausto/octave/linear-algebra-2.2.1
     miscellaneous *|   1.2.0 | /usr/share/octave/packages/miscellaneous-1.2.0
missing-functions *|   1.0.2 | /usr/share/octave/packages/missing-functions-1.0.2
               msh *|   1.0.6 | /usr/share/octave/packages/msh-1.0.6
            odebvp  |   1.0.6 | /home/fausto/octave/odebvp-1.0.6
            odepkg *|   0.8.4 | /usr/share/octave/packages/odepkg-0.8.4
             optim  |   1.4.0 | /home/fausto/octave/optim-1.4.0
          parallel  |   2.2.0 | /home/fausto/octave/parallel-2.2.0
              plot *|   1.1.0 | /usr/share/octave/packages/plot-1.1.0
           splines *|   1.2.6 | /usr/share/octave/packages/splines-1.2.6
            struct  |  1.0.10 | /home/fausto/octave/struct-1.0.10

Fausto




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

tmacchant
Fausto
Is the below related to your trouble?
http://stackoverflow.com/questions/25046327/octave-imread-function

Tatsuro
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

Helios de Rosario
In reply to this post by fbarbuto
>>> El día 19/05/2015 a las 1:42, "Fausto Arinos de A. Barbuto"
<[hidden email]> escribió:
> On 18-05-2015 05:32, Helios de Rosario wrote:
>
>> I think we do, if I understood Faustino's question correctly. Say
we

>> have this 50x50 RGB image (a cyan cross):
>>
>> img = ones(50,50,3);
>> img(1:51:50^2) = 0;
>> img(50:49:50^2) = 0;
>>
>> It can be projected onto a 50x50 surface just like this:
>>
>> surf(sombrero(50), img)
>>
>> You can use "imread" to read the image from the file into a matrix.
>>
>
> Thanks, but it did not work. I forgot to say I'm using Octave 3.8.1
on
> a Ubuntu 14.04-64 installation.  The list of packages I have using
are:
>
[snip]

What did not work? Can you describe what is the error message that you
found, or the unexpected output?

Helios

ibv.org/anuario2014
Conoce la actividad más destacada del IBV en 2014
______________________________

INSTITUTO DE BIOMECÁNICA DE VALENCIA
Universidad Politécnica de Valencia • Edificio 9C
Camino de Vera s/n • 46022 VALENCIA (ESPAÑA)
Tel. +34 961111170- +34 610567200 • Fax +34 96 387 91 69
www.ibv.org

Antes de imprimir este e-mail piense bien si es necesario hacerlo.
En cumplimiento de la Ley Orgánica 15/1999 reguladora de la Protección
de Datos de Carácter Personal, le informamos de que el presente mensaje
contiene información confidencial, siendo para uso exclusivo del
destinatario arriba indicado. En caso de no ser usted el destinatario
del mismo le informamos que su recepción no le autoriza a su divulgación
o reproducción por cualquier medio, debiendo destruirlo de inmediato,
rogándole lo notifique al remitente.


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

fbarbuto
In reply to this post by tmacchant
On 19-05-2015 18:23, tmacchant wrote:
> Fausto
> Is the below related to your trouble?
> http://stackoverflow.com/questions/25046327/octave-imread-function
>
>

Hi Tatsuro,

I installed Octave 3.8.2 from the tarball and now I can get the image
as suggested by Helios.

Also, I observed that Octave 3.8.2 at least /seems/ to be faster on
loading than 3.8.1.  Need more tests, though.

Thanks.

Fausto




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Surfaces & pictures

fbarbuto
On 21-05-2015 20:32, Fausto Arinos de A. Barbuto wrote:

> On 19-05-2015 18:23, tmacchant wrote:
>> Fausto
>> Is the below related to your trouble?
>> http://stackoverflow.com/questions/25046327/octave-imread-function
>>
>>
>
> Hi Tatsuro,
>
> I installed Octave 3.8.2 from the tarball and now I can get the image
> as suggested by Helios.
>
> Also, I observed that Octave 3.8.2 at least /seems/ to be faster on
> loading than 3.8.1.  Need more tests, though.
>
> Thanks.
>
> Fausto

On the other hand...

 >> A = imread("205154.jpg");
error: imread: invalid image file: imfinfo: support for Image IO was disabled when Octave was built
error: called from:
error:   /usr/local/share/octave/3.8.2/m/image/private/__imread__.m at line 181, column 7
error:   /usr/local/share/octave/3.8.2/m/image/private/imageIO.m at line 66, column 26
error:   /usr/local/share/octave/3.8.2/m/image/imread.m at line 107, column 30
 >>

Is there a way to have this fixed without re-compiling everything? I don't remember
having let any option or support out of the compilation process.

Fausto




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave