comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » to convert 3d array to 2d array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: to convert 3d array to 2d array [message #91430 is a reply to message #91429] Tue, 14 July 2015 07:08 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/14/15 4:35 AM, SP wrote:
> I have an image array of 835*827 pixels The total size is image array
> [ 835, 827, 3] I want to apply gradient function in this image, so
> idl is asking to give a 2d image array as input. Can anyone tell me
> on How to convert this 3d image array to a 2d array... Thanks....
>

If your gradient function wants a 2D array, then you will have to do the
bands of your image separately, i.e.:

im[*, *, 0] = your_gradient_function(reform(im[*, *, 0]))
im[*, *, 1] = your_gradient_function(reform(im[*, *, 1]))
im[*, *, 2] = your_gradient_function(reform(im[*, *, 2]))

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Setting the zoom_base property in IDLgrWindow
Next Topic: Hello

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:17:25 PDT 2025

Total time taken to generate the page: 0.00623 seconds