NAME
get_target_signature_db - Gets target signature database.
SYNOPSIS
#include "lsm/lsm_emd.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int get_target_signature_db
(
Signature_db **target_sig_db_ptr_ptr,
const int num_signatures
);
PARAMETERS
-
Signature_db **target_sig_db_ptr_ptr
-
Double pointer to output database
-
const int num_signatures
-
Number of signatures in database
DESCRIPTION
This routine implements the creation/over-writing semantics used in
the KJB library in the case of signature databases.
If *target_sig_db_ptr_ptr is NULL, then this routine creates the signature
database. If the target signature database is not NULL and is the correct
size, then this routine does nothing (recycles the memory). If the target
signature database is the wrong size, then it is resized.
A signature database is defined as follows:
| typedef struct Signature_db
{
int num_signatures; Number of signatures in database
Signature** signature_ptr_vec; Array of pointers to signatures
Emd_cluster_method cluster_method; Method used to make signatures
Emd_data_origin data_origin; Illuminant data origin (spectra/RGB)
Emd_illum_data illum_data; Either Spectra or RGB Matrix
} Signature_db;
The following clustering methods are currently defined:
EMD_NO_CLUSTERING Data is not clustered.
EMD_2D_HISTOGRAM Data is clustered in rg-chromaticity space using
a 2-D histogram (not currently implemented).
EMD_3D_HISTOGRAM Data is clustered in RGB space using a 3-D histogram.
EMD_K_MEANS Data is clustered using the k-means algorithm.
EMD_CLARANS Data is clustered using the CLARANS algorithm
(not currently implemented).
Each signature database contains the illuminant data from which it was
constructed. The illuminant data can be in one of two forms:
1) a KJB Spectra containing the illuminant spectra, or
2) a KJB Matrix containing the RGB of each illuminant.
The data_origin field of the Signature_db indicates the storage format of
the illuminant data and can have the following values:
EMD_FROM_RGB The illum_data field contains a Matrix of RGBs.
EMD_FROM_SPECTRA The illum_data field contains a Spectra of illuminants.
RETURNS
Either NO_ERROR, or ERROR, with an appropriate error message being set.
RELATED
free_signature_db, copy_signature_db, add_signature_to_db,
get_signature_from_db, set_signature_db_illum_data,
get_signature_db_illum_data, read_signature_db, write_signature_db
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Lindsay Martin
DOCUMENTER
Lindsay Martin
SEE ALSO
get_earthmover_distance
,
euclidean_distance
,
get_target_signature
,
free_signature
,
copy_signature
,
set_signature_features
,
set_signature_weights