X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Jul 2015 07:37 AM by  anon
Issue with displaying 3D using surface()
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:16
New Member


--
15 Jul 2015 07:37 AM
    Hi, I require to get colours of the TEXTURE_IMAGE onto the DEM.I have failed to understand as to why I'm getting the output in "black" even after subjecting the TEXTURE_IMAGE with a color composite array named "overview" (as shown in the URL below) URL: https://www.dropbox.com/s/79gqsywr66j3ftp/issue.PNG?dl=0 Please let me know your thoughts on this. Context: 1).Both DSM and texture image's arrays were obtained by reading tiff files (yup I've rotated the tiff image accordingly[using ROTATE()], no issues with that) 2).Also tried scaling the texture image using BYTSCL (no use!) 3) I Did play with Z range Regards, Puneeth

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    15 Jul 2015 08:14 AM
    Hi Puneeth, Do you have a small, self-contained example which illustrates your problem? Seeing your code helps a lot and if you could set up your example code with no need for external data then that would really help.

    Deleted User



    New Member


    Posts:16
    New Member


    --
    15 Jul 2015 10:52 AM
    ; reading the required DSM filename_dsm='E:\xyz\xyz100m_blue.tif' temp = READ_TIFF(Filename_dsm,ORIENTATION=orientation_dsm) overview_dsm=ROTATE(temp,7) ; since "orientation_dsm=1" ;reading the texture image filename='E:\Ortho\xyz100m_ortho.tif' TIFF_info = QUERY_TIFF( Filename , Info , GEOTIFF=tiff_tags ) Overview = READ_TIFF(Filename, CHANNELS=[2,1,0], GEOTIFF=tiff_tags,ORIENTATION=orientation) b=image(overview,/ORDER,CURRENT=map_report,MAPPROJECTION=GEOTIFF_PROJ) b.POSITION=[0.5,0.2] ;Now to obtain 3D s = SURFACE(overview_dsm,TEXTURE_IMAGE=overview,TITLE='3D PERSPECTIVE',FONT_NAME='Helvetica') ;here OVERVIEW ULONG = Array[3, 5690, 5201] and OVERVIEW_DSM FLOAT = Array[6374, 3566] ;the output obtained from the above snippet is as shown in the Dropbox link: https://www.dropbox.com/s/79gqsywr66j3ftp/issue.PNG?dl=0

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    15 Jul 2015 12:57 PM
    Hi Puneeth, The image is black because the TIF image is likely only one band, meaning that the original image is gray-scaled. You either need to supply the RGB values to surface, or create an RGB image. Here is an example of each method. pro surface_image_texture_example compile_opt idl2 ireset, /no_prompt ; Read in a 2D array of surface heights dir = FILEPATH('',SUBDIR=['examples', 'data']) z = READ_BINARY(dir+'elevbin.dat', DATA_DIMS=[64,64]) ; Read in a texture image to overlay img = Rotate(READ_TIFF( dir+'examples.tif', r, g, b),7) ;create an RGB image dims = size(img, /dimensions) img_rgb = make_array(3,dims[0],dims[1], /byte) img_rgb[0,*,*] = r[img] img_rgb[1,*,*] = g[img] img_rgb[2,*,*] = b[img] ;use RGB table s = SURFACE(z, TEXTURE_IMAGE=img, YSTYLE=1, rgb_table = [[r],[g],[b]],$ window_title = 'Using RGB Table') ;use RGB image s2 = SURFACE(z, TEXTURE_IMAGE=img_rgb, YSTYLE=1,$ window_title = 'Using RGB Image') end
    You are not authorized to post a reply.