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 
Switch to threaded view of this topic Create a new topic Submit Reply
to convert 3d array to 2d array [message #91429] Tue, 14 July 2015 03:35 Go to next message
Shaktivel Pillai is currently offline  Shaktivel Pillai
Messages: 16
Registered: June 2015
Junior Member
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....
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 next 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)
Re: to convert 3d array to 2d array [message #91438 is a reply to message #91429] Wed, 15 July 2015 04:17 Go to previous message
Shaktivel Pillai is currently offline  Shaktivel Pillai
Messages: 16
Registered: June 2015
Junior Member
On Tuesday, July 14, 2015 at 4:05:19 PM UTC+5:30, 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....

thanks buddy..........
It worked
  Switch to threaded view of this topic Create a new topic Submit Reply
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 07:16:33 PDT 2025

Total time taken to generate the page: 0.00395 seconds