to convert 3d array to 2d array [message #91429] |
Tue, 14 July 2015 03:35  |
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   |
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  |
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
|
|
|