Re: Problems with CONVOL and 3D data [message #29255] |
Fri, 08 February 2002 05:34 |
Jaco van Gorkom
Messages: 97 Registered: November 2000
|
Member |
|
|
"Alberto Martinez" <juan_eof@hotmail.com> wrote in message
news:3c63c8de@news.upm.es...
...
> kernel_1 = REFORM(kernel_1,3,1,1) ; An array in X direction , 3D
> kernel_2 = REFORM(kernel_1,1,3,1) ; The same in Y
> kernel_3 = REFORM(kernel_1,1,1,3) ; In Z direction
...
> result = CONVOL(FLOAT(data), FLOAT(kernel_2)) ;
>> %CONVOL: Kernel's dimensions are incompatible with operand's
>
> It seems that the filtering with "kernel_2" only works with data and
kernel
> in integers!
> I can�t filter Other types others types of 3D data with simple vector in
the
> Y direction !
> The others kernels works perfectly.
IDL has the habit of dropping leading dimensions of one, and this happens to
the FLOAT() result:
IDL> help, kernel_1, float(kernel_1), kernel_2, float(kernel_2), kernel_3,
float(kernel_3)
KERNEL_1 INT = Array[3, 1, 1]
<Expression> FLOAT = Array[3]
KERNEL_2 INT = Array[1, 3, 1]
<Expression> FLOAT = Array[1, 3]
KERNEL_3 INT = Array[1, 1, 3]
<Expression> FLOAT = Array[1, 1, 3]
so FLOAT(kernel_2) has two dimensions, whereas FLOAT(data) has three.
Another REFORM is needed:
result = CONVOL(FLOAT(data), REFORM(FLOAT(kernel_2), 1, 3, 1) )
Cheers,
Jaco
|
|
|