Leptonica 1.68
C Image Processing Library

otsutest1.c File Reference

Demonstrates theory behind Otsu splitting by generating plots of histogram and Otsu score function. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "allheaders.h"

Go to the source code of this file.

Functions

static l_int32 GenerateSplitPlot (l_int32 i)
static NUMAMakeGaussian (l_int32 mean, l_int32 stdev, l_float32 fract)
 main (int argc, char **argv)

Variables

static const l_int32 NTests = 5
static const l_int32 gaussmean1 [5] = {20, 40, 60, 80, 60}
static const l_int32 gaussstdev1 [5] = {10, 20, 20, 20, 30}
static const l_int32 gaussmean2 [5] = {220, 200, 140, 180, 150}
static const l_int32 gaussstdev2 [5] = {15, 20, 40, 20, 30}
static const l_float32 gaussfract1 [5] = {0.2, 0.3, 0.1, 0.5, 0.3}
static char buf [256]

Detailed Description

Demonstrates theory behind Otsu splitting by generating plots of histogram and Otsu score function.

Definition in file otsutest1.c.


Function Documentation

static NUMA * MakeGaussian ( l_int32  mean,
l_int32  stdev,
l_float32  fract 
) [static]

Definition at line 132 of file otsutest1.c.

References numaMakeConstant(), numaSetValue(), and total.

Referenced by GenerateSplitPlot().

main ( int  argc,
char **  argv 
)

Variable Documentation

const l_int32 NTests = 5 [static]

Definition at line 25 of file otsutest1.c.

Referenced by main().

const l_int32 gaussmean1[5] = {20, 40, 60, 80, 60} [static]

Definition at line 26 of file otsutest1.c.

Referenced by GenerateSplitPlot().

const l_int32 gaussstdev1[5] = {10, 20, 20, 20, 30} [static]

Definition at line 27 of file otsutest1.c.

Referenced by GenerateSplitPlot().

const l_int32 gaussmean2[5] = {220, 200, 140, 180, 150} [static]

Definition at line 28 of file otsutest1.c.

Referenced by GenerateSplitPlot().

const l_int32 gaussstdev2[5] = {15, 20, 40, 20, 30} [static]

Definition at line 29 of file otsutest1.c.

const l_float32 gaussfract1[5] = {0.2, 0.3, 0.1, 0.5, 0.3} [static]

Definition at line 30 of file otsutest1.c.

Referenced by GenerateSplitPlot().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines