-
Notifications
You must be signed in to change notification settings - Fork 5
/
tc_preproc.h
executable file
·67 lines (45 loc) · 2.02 KB
/
tc_preproc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* \file tc_preproc.h
* \brief Preprocess with colorspace, normalization, convolution
* \author David Ray Thompson
*
* Copyright 2012, by the California Institute of Technology. ALL RIGHTS
* RESERVED. United States Government Sponsorship acknowledged. Any
* commercial use must be negotiated with the Office of Technology
* Transfer at the California Institute of Technology.
*/
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "tc_image.h"
#ifndef TC_PREPROC_H
#define TC_PREPROC_H
/* Apply oriented bar filters. */
/* dst must be preallocated to have one channel per orientation */
int tc_bar(tc_image *dst, tc_image *src);
/* Convert to intensity. maxpx is the maximum value. */
/* dst must be preallocated to have a single channel. */
int tc_intensity(tc_image *dst, tc_image *src);
/* Normalize image intensity to have mean target_memu and standard deviation
* target_stdev. Images are preallocated. The parameter 'robust' tells us
* how many standard deviations outside the mean to consider (0=use all). */
int tc_normalize_image(tc_image *dst, tc_image *src, const pixel_t target_mu,
const pixel_t target_stdev, const int robust);
/* Greyworld color constancy */
int tc_greyworld(tc_image *dst, tc_image *src, const pixel_t target_mu);
/* convert to hsv space. maxpx is the maximum value */
int tc_rgbhsv(tc_image *dst, tc_image *src, const float maxpx);
/* needlessly slow */
int tc_moving_average(tc_image *dst, tc_image *src, const int wid);
/*! Slow bandpass filter (all images preallocated).
* 'wbig' and 'wsmall' are widths of the moving average filters.*/
int tc_bandpass_image(tc_image *dst, tc_image *src, const int wbig,
const int wsmall, const int target_mu);
/* Flat field correction */
int tc_flatfield_image(tc_image *dst, tc_image *src, tc_image *ff);
/* Convert grey image to rgb image. Essentially, triplicate each pixel in
* grey image to emulate a rgb image.
*/
int tc_greyrgb(tc_image *dst, tc_image *src);
#endif