Surface
detect surface points in an image stack
Defines | Functions | Variables
surface.c File Reference

Surface detector. More...

#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include <jwsc/base/error.h>
#include <jwsc/base/option.h>
#include <jwsc/matblock/matblock.h>
#include <jwsc/imgblock/imgblock.h>
#include <jwsc/imgblock/imgblock_io.h>
#include <jwsc/imgblock/imgblock_util.h>
#include <jwsc/imgblock/surface.h>

Go to the source code of this file.

Defines

#define DEFAULT_BEGIN_THRESH   0.06f
#define DEFAULT_END_THRESH   0.025f
#define DEFAULT_SIGMA   1.0f
#define DEFAULT_SAMPLE_RATE   1.0f
#define DEFAULT_GRAD_IMG_WEIGHT   1.0f
#define DEFAULT_GRAD_ROW_WEIGHT   1.0f
#define DEFAULT_GRAD_COL_WEIGHT   1.0f
#define DEFAULT_RES_IMG   1.0f
#define DEFAULT_RES_ROW   1.0f
#define DEFAULT_RES_COL   1.0f
#define NUM_OPTS_NO_ARG   3
#define NUM_OPTS_WITH_ARG   9

Functions

static void print_usage (void)
 Prints the usage of the program.
static Errorprocess_help_opt (void)
 Processes the 'help' program options.
static Errorprocess_version_opt (void)
 Processes the 'version' program options.
static Errorprocess_named_opt (void)
 Processes the 'named' program options.
static Errorprocess_colored_out_opt (Option_arg arg)
 Processes the 'colored-out' program options.
static Errorprocess_map_out_opt (Option_arg arg)
 Processes the 'map-out' program options.
static Errorprocess_pts_out_opt (Option_arg arg)
 Processes the 'pts-out' program options.
static Errorprocess_begin_thresh_opt (Option_arg arg)
 Processes the 'begin-thresh' program options.
static Errorprocess_end_thresh_opt (Option_arg arg)
 Processes the 'end-thresh' program options.
static Errorprocess_sigma_opt (Option_arg arg)
 Processes the 'sigma' program options.
static Errorprocess_sample_rate_opt (Option_arg arg)
 Processes the 'sample-rate' program options.
static Errorprocess_grad_weight_opt (Option_arg arg)
 Processes the 'grad-weight' program options.
static Errorprocess_resolution_opt (Option_arg arg)
 Processes the 'resolution' program options.
int main (int argc, const char **argv)
 Main function for the surface program.

Variables

static Option_no_arg opts_no_arg [NUM_OPTS_NO_ARG]
 Program options taking no argument.
static Option_with_arg opts_with_arg [NUM_OPTS_WITH_ARG]
 Program options taking an argument.
static const char * pts_fname
 Name of the file to write the surface points to in ASCII.
static const char * map_fname
 Name of the surface map image block to output.
static const char * colored_fname
 Name of the image block with surfaces colored to output.
static float begin_thresh
 Gradient magnitude surface detection threshold for beginning hysterisis.
static float end_thresh
 Gradient magnitude surface detection threshold for ending hysterisis.
static float sigma
 Sigma for smoothing the image block.
static float sample_rate
 Percentage of detected surface points to randomly sample from.
static float grad_img_weight
 Weight along the image gradient at a Surface_point.
static float grad_row_weight
 Weight along the row gradient at a Surface_point.
static float grad_col_weight
 Weight along the column gradient at a Surface_point.
static uint8_t images_named
 Boolean indicating whether the images to read are a named sequence in argv, or a printf numbered sequence.
static float res_img
 Resolution for the images in the input stack.
static float res_row
 Resolution for the rows in the input stack.
static float res_col
 Resolution for the columns in the input stack.

Detailed Description

Surface detector.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file surface.c.


Define Documentation

#define DEFAULT_BEGIN_THRESH   0.06f

Definition at line 126 of file surface.c.

#define DEFAULT_END_THRESH   0.025f

Definition at line 127 of file surface.c.

#define DEFAULT_SIGMA   1.0f

Definition at line 128 of file surface.c.

#define DEFAULT_SAMPLE_RATE   1.0f

Definition at line 129 of file surface.c.

#define DEFAULT_GRAD_IMG_WEIGHT   1.0f

Definition at line 130 of file surface.c.

#define DEFAULT_GRAD_ROW_WEIGHT   1.0f

Definition at line 131 of file surface.c.

#define DEFAULT_GRAD_COL_WEIGHT   1.0f

Definition at line 132 of file surface.c.

#define DEFAULT_RES_IMG   1.0f

Definition at line 133 of file surface.c.

#define DEFAULT_RES_ROW   1.0f

Definition at line 134 of file surface.c.

#define DEFAULT_RES_COL   1.0f

Definition at line 135 of file surface.c.

#define NUM_OPTS_NO_ARG   3

Definition at line 137 of file surface.c.

#define NUM_OPTS_WITH_ARG   9

Definition at line 138 of file surface.c.


Function Documentation

static void print_usage ( void  ) [static]

Prints the usage of the program.

Definition at line 200 of file surface.c.

static Error* process_help_opt ( void  ) [static]

Processes the 'help' program options.

Definition at line 210 of file surface.c.

static Error* process_version_opt ( void  ) [static]

Processes the 'version' program options.

Definition at line 219 of file surface.c.

static Error* process_named_opt ( void  ) [static]

Processes the 'named' program options.

Definition at line 228 of file surface.c.

static Error* process_colored_out_opt ( Option_arg  arg) [static]

Processes the 'colored-out' program options.

Definition at line 236 of file surface.c.

static Error* process_map_out_opt ( Option_arg  arg) [static]

Processes the 'map-out' program options.

Definition at line 248 of file surface.c.

static Error* process_pts_out_opt ( Option_arg  arg) [static]

Processes the 'pts-out' program options.

Definition at line 260 of file surface.c.

static Error* process_begin_thresh_opt ( Option_arg  arg) [static]

Processes the 'begin-thresh' program options.

Definition at line 272 of file surface.c.

static Error* process_end_thresh_opt ( Option_arg  arg) [static]

Processes the 'end-thresh' program options.

Definition at line 287 of file surface.c.

static Error* process_sigma_opt ( Option_arg  arg) [static]

Processes the 'sigma' program options.

Definition at line 302 of file surface.c.

static Error* process_sample_rate_opt ( Option_arg  arg) [static]

Processes the 'sample-rate' program options.

Definition at line 317 of file surface.c.

static Error* process_grad_weight_opt ( Option_arg  arg) [static]

Processes the 'grad-weight' program options.

Definition at line 333 of file surface.c.

static Error* process_resolution_opt ( Option_arg  arg) [static]

Processes the 'resolution' program options.

Definition at line 357 of file surface.c.

int main ( int  argc,
const char **  argv 
)

Main function for the surface program.

Definition at line 380 of file surface.c.


Variable Documentation

Option_no_arg opts_no_arg[NUM_OPTS_NO_ARG] [static]

Program options taking no argument.

Definition at line 142 of file surface.c.

Option_with_arg opts_with_arg[NUM_OPTS_WITH_ARG] [static]

Program options taking an argument.

Definition at line 145 of file surface.c.

const char* pts_fname [static]

Name of the file to write the surface points to in ASCII.

Definition at line 149 of file surface.c.

const char* map_fname [static]

Name of the surface map image block to output.

Definition at line 152 of file surface.c.

const char* colored_fname [static]

Name of the image block with surfaces colored to output.

Definition at line 155 of file surface.c.

float begin_thresh [static]

Gradient magnitude surface detection threshold for beginning hysterisis.

Definition at line 161 of file surface.c.

float end_thresh [static]

Gradient magnitude surface detection threshold for ending hysterisis.

Definition at line 166 of file surface.c.

float sigma [static]

Sigma for smoothing the image block.

Definition at line 169 of file surface.c.

float sample_rate [static]

Percentage of detected surface points to randomly sample from.

Definition at line 172 of file surface.c.

float grad_img_weight [static]

Weight along the image gradient at a Surface_point.

Definition at line 175 of file surface.c.

float grad_row_weight [static]

Weight along the row gradient at a Surface_point.

Definition at line 178 of file surface.c.

float grad_col_weight [static]

Weight along the column gradient at a Surface_point.

Definition at line 181 of file surface.c.

uint8_t images_named [static]

Boolean indicating whether the images to read are a named sequence in argv, or a printf numbered sequence.

Definition at line 187 of file surface.c.

float res_img [static]

Resolution for the images in the input stack.

Definition at line 190 of file surface.c.

float res_row [static]

Resolution for the rows in the input stack.

Definition at line 193 of file surface.c.

float res_col [static]

Resolution for the columns in the input stack.

Definition at line 196 of file surface.c.