![]() |
![]() |
Gwyddion Data Processing Library Reference Manual | ![]() |
|
---|---|---|---|---|
Top | Description |
#include <libprocess/gwyprocess.h> gdouble gwy_data_field_get_correlation_score (GwyDataField *data_field
,GwyDataField *kernel_field
,gint col
,gint row
,gint kernel_col
,gint kernel_row
,gint kernel_width
,gint kernel_height
); void gwy_data_field_crosscorrelate (GwyDataField *data_field1
,GwyDataField *data_field2
,GwyDataField *x_dist
,GwyDataField *y_dist
,GwyDataField *score
,gint search_width
,gint search_height
,gint window_width
,gint window_height
); GwyComputationState * gwy_data_field_crosscorrelate_init (GwyDataField *data_field1
,GwyDataField *data_field2
,GwyDataField *x_dist
,GwyDataField *y_dist
,GwyDataField *score
,gint search_width
,gint search_height
,gint window_width
,gint window_height
); void gwy_data_field_crosscorrelate_iteration (GwyComputationState *state
); void gwy_data_field_crosscorrelate_finalize (GwyComputationState *state
); void gwy_data_field_correlate (GwyDataField *data_field
,GwyDataField *kernel_field
,GwyDataField *score
,GwyCorrelationType method
); GwyComputationState * gwy_data_field_correlate_init (GwyDataField *data_field
,GwyDataField *kernel_field
,GwyDataField *score
); void gwy_data_field_correlate_iteration (GwyComputationState *state
); void gwy_data_field_correlate_finalize (GwyComputationState *state
);
gdouble gwy_data_field_get_correlation_score (GwyDataField *data_field
,GwyDataField *kernel_field
,gint col
,gint row
,gint kernel_col
,gint kernel_row
,gint kernel_width
,gint kernel_height
);
Calculates a correlation score in one point.
Correlation window size is given
by kernel_col
, kernel_row
, kernel_width
, kernel_height
,
postion of the correlation window on data is given by
col
, row
.
If anything fails (data too close to boundary, etc.), function returns -1.0 (none correlation)..
|
A data field. |
|
Kernel to correlate data field with. |
|
Upper-left column position in the data field. |
|
Upper-left row position in the data field. |
|
Upper-left column position in kernel field. |
|
Upper-left row position in kernel field. |
|
Width of kernel field area. |
|
Heigh of kernel field area. |
Returns : |
Correlation score (between -1.0 and 1.0). Value 1.0 denotes maximum correlation, -1.0 none correlation. |
void gwy_data_field_crosscorrelate (GwyDataField *data_field1
,GwyDataField *data_field2
,GwyDataField *x_dist
,GwyDataField *y_dist
,GwyDataField *score
,gint search_width
,gint search_height
,gint window_width
,gint window_height
);
Algorithm for matching two different images of the same object under changes.
It does not use any special features
for matching. It simply searches for all points (with their neighbourhood)
of data_field1
within data_field2
. Parameters search_width
and
search_height
determine maimum area where to search for points. The area is cenetered
in the data_field2
at former position of points at data_field1
.
|
A data field. |
|
A data field. |
|
A data field to store x-distances to. |
|
A data field to store y-distances to. |
|
Data field to store correlation scores to. |
|
Search area width. |
|
Search area height. |
|
Correlation window width. |
|
Correlation window height. |
GwyComputationState * gwy_data_field_crosscorrelate_init (GwyDataField *data_field1
,GwyDataField *data_field2
,GwyDataField *x_dist
,GwyDataField *y_dist
,GwyDataField *score
,gint search_width
,gint search_height
,gint window_width
,gint window_height
);
Initializes a cross-correlation iterator.
This iterator reports its state as GwyComputationStateType.
|
A data field. |
|
A data field. |
|
A data field to store x-distances to, or NULL . |
|
A data field to store y-distances to, or NULL . |
|
Data field to store correlation scores to, or NULL . |
|
Search area width. |
|
Search area height. |
|
Correlation window width. |
|
Correlation window height. |
Returns : |
A new cross-correlation iterator. |
void gwy_data_field_crosscorrelate_iteration
(GwyComputationState *state
);
Performs one iteration of cross-correlation.
Cross-correlation matches two different images of the same object under changes.
It does not use any special features
for matching. It simply searches for all points (with their neighbourhood)
of data_field1
within data_field2
. Parameters search_width
and
search_height
determine maimum area where to search for points.
The area is cenetered in the data_field2
at former position of points at
data_field1
.
A cross-correlation iterator can be created with
gwy_data_field_crosscorrelate_init()
. When iteration ends, either
by finishing or being aborted, gwy_data_field_crosscorrelate_finalize()
must be called to release allocated resources.
|
Cross-correlation iterator. |
void gwy_data_field_crosscorrelate_finalize
(GwyComputationState *state
);
Destroys a cross-correlation iterator, freeing all resources.
|
Cross-correlation iterator. |
void gwy_data_field_correlate (GwyDataField *data_field
,GwyDataField *kernel_field
,GwyDataField *score
,GwyCorrelationType method
);
Computes correlation score for all positions in a data field.
Correlation score is compute for all points in data field data_field
and full size of correlation kernel kernel_field
.
The points in score
correspond to centers of kernel. More precisely, the
point ((kxres
-1)/2, (kyres
-1)/2) in score
corresponds to kernel field
top left corner coincident with data field top left corner. Points outside
the area where the kernel field fits into the data field completely are
set to -1 for GWY_CORRELATION_NORMAL
.
|
A data field. |
|
Correlation kernel. |
|
Data field to store correlation scores to. |
|
Correlation score calculation method. |
GwyComputationState * gwy_data_field_correlate_init (GwyDataField *data_field
,GwyDataField *kernel_field
,GwyDataField *score
);
Creates a new correlation iterator.
This iterator reports its state as GwyComputationStateType.
|
A data field. |
|
Kernel to correlate data field with. |
|
Data field to store correlation scores to. |
Returns : |
A new correlation iterator. |
void gwy_data_field_correlate_iteration (GwyComputationState *state
);
Performs one iteration of correlation.
An iterator can be created with gwy_data_field_correlate_init()
.
When iteration ends, either by finishing or being aborted,
gwy_data_field_correlate_finalize()
must be called to release allocated
resources.
|
Correlation iterator. |
void gwy_data_field_correlate_finalize (GwyComputationState *state
);
Destroys a correlation iterator, freeing all resources.
|
Correlation iterator. |