Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96638668
im_convolve.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 29, 08:49
Size
959 B
Mime Type
text/x-c
Expires
Tue, Dec 31, 08:49 (2 d)
Engine
blob
Format
Raw Data
Handle
23218632
Attached To
R1448 Lenstool-HPC
im_convolve.c
View Options
#include<stdio.h>
#include<math.h>
#include "fonction.h"
#include "constant.h"
#include"dimension.h"
#include "structure.h"
#include "lt.h"
long
int
im_convolve
(
double
**
ima
,
int
nx
,
int
ny
,
double
**
filt
,
int
nf
)
{
register
int
i
,
j
,
ii
,
jj
;
int
i_im
,
j_im
,
nfd
;
double
s
;
double
**
im_conv
;
nfd
=
(
nf
+
1
)
/
2
;
nfd
=
(
nf
-
1
)
/
2
;
im_conv
=
(
double
**
)
alloc_square_double
(
nx
,
ny
);
for
(
i
=
0
;
i
<
nx
;
i
++
)
for
(
j
=
0
;
j
<
ny
;
j
++
)
{
s
=
0.
;
for
(
ii
=
0
;
ii
<
nf
;
ii
++
)
{
i_im
=
i
-
nfd
+
ii
;
for
(
jj
=
0
;
jj
<
nf
;
jj
++
)
{
j_im
=
j
-
nfd
+
jj
;
if
((
i_im
>=
0
)
&&
(
i_im
<
nx
)
&&
(
j_im
>=
0
)
&&
(
j_im
<
ny
))
s
+=
ima
[
i_im
][
j_im
]
*
filt
[
ii
][
jj
];
};
};
im_conv
[
i
][
j
]
=
s
;
};
return
(
(
long
int
)
im_conv
);
}
Event Timeline
Log In to Comment