NAME

get_image_window_stats - Computes some statistics over an image window

SYNOPSIS

#include "i/i_stat.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_image_window_stats
(
	int *num_valid_pixels_ptr,
	Vector **mean_vpp,
	Vector **stdev_vpp,
	const KJB_image *source_ip,
	int row_offset,
	int col_offset,
	int num_target_rows,
	int num_target_cols
);

DESCRIPTION

This routine computes some statistics over an image window. The number of valid pixes, the image mean, and the image standard deviation are put into *num_valid_pixels_ptr, *mean_vpp, and *stdev_vpp, respectively. If *mean_vpp or *stdev_vpp are NULL, or are the wrong size, then they are created or resizes as need be. Any of the three output arguments may be set to NULL if you are not interested in that particular statistic. Statistics are only computed over valid pixels, and if there are not enough valid pixels to compute a requested statistic, then ERROR is returned, with an appropriate error message being set. The image window is specified by its minium row and minimum column (arguments "row_offset" and "col_offset" respectively), and its dimensions ("num_target_rows" and "num_target_cols"). If the window exceeds the image boundaries, then EROR is returned, with an appropriate error message being set.

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

get_ave_rgb , get_max_rgb , get_image_stats , get_ave_ratio_without_invalid , get_ave_sum_ratio_without_invalid