X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Dec 2015 11:45 PM by  anon
CONGRID() not shrinking data as supposed to
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:16
New Member


--
02 Dec 2015 11:45 PM
    Hi, I'm receiving a scrambled output while trying to shrink a bigtiff ortho.Kindly notice the dropbox link : https://www.dropbox.com/s/1ndfd1spp178dr4/CONGRID_ERROR.png?dl=0

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    03 Dec 2015 02:11 PM
    Hi Puneeth, This problem can be reproduced if you change the dimensions of the array to CONGRID by rotating the dimension which represents RGB (i.e. 3). Initially, you are trying to make a [3, 70000, 7000] array into a [700, 700, 3] array and that is what is causing a problem. If you want your result to be [700, 700, 3] then I would do that after the call to CONGRID. Here is an example of how to properly shrink your image to avoid any problems: ; Select the file. file = FILEPATH('rose.jpg', SUBDIR=['examples', 'data']) read_jpeg, file, data ; Use the CONGRID function to increase the image array magnifiedIm = CONGRID(data, 3, 10000, 10000, /INTERP) im1 = IMAGE(magnifiedIm) ;result is bad if you changge the x, y, z order of the image shrunkIm = CONGRID(magnifiedIm, 100, 100, 3) im2 = IMAGE(shrunkIm) ;proper way to shrink image shrunkIm = CONGRID(magnifiedIm, 3, 100, 100) im3 = IMAGE(shrunkIm)
    You are not authorized to post a reply.