NAME

image_to_matrix - Converts an image to a matrix

SYNOPSIS

#include "i/i_matrix.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 image_to_matrix
(
	const KJB_image *ip,
	Matrix **mpp
);

DESCRIPTION

This routine converts an image to a single matrix. The image is converted to black and white by simple averaging of the pixels. This is not the standard method which de-emphasizes blue. Further, the possiblity that the image is not linear is ignored. Likely some for these considerations will be implemenated as options at some point, but will require moving this routine to i_color.c so that the options can be shared with other routines that convert color images to black and white. If the matrix pointed to is NULL, then it is created. If any are the wrong size, they is is resized. Otherwise, the storage is recycled as is.

RETURNS

NO_ERROR on success, and ERROR on failure, with an appropriate error message being set.

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Kobus Barnard

DOCUMENTER

Kobus Barnard

SEE ALSO

matrix_vector_to_image , image_to_matrix_vector , rgb_matrix_array_to_image , image_to_rgb_matrix_array , matrix_to_bw_image , matrix_to_max_contrast_8bit_bw_image , rgb_matrices_to_image , image_to_matrix_2 , bw_image_to_matrix , image_to_rgb_matrices