Edges
detect edges in an image
|
Edge detector. More...
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <jwsc/base/error.h>
#include <jwsc/base/option.h>
#include <jwsc/matrix/matrix.h>
#include <jwsc/image/image.h>
#include <jwsc/image/image_io.h>
#include <jwsc/image/edge.h>
Go to the source code of this file.
Defines | |
#define | DEFAULT_BEGIN_MAG_THRESH 0.05f |
#define | DEFAULT_END_MAG_THRESH 0.025f |
#define | DEFAULT_BREAK_DP_THRESH -1.0f |
#define | DEFAULT_BREAK_DP_NUM_AVG 1 |
#define | DEFAULT_SIGMA 1.0f |
#define | DEFAULT_SAMPLE_RATE 1.0f |
#define | DEFAULT_MIN_LEN 1 |
#define | DEFAULT_SEED 289375 |
#define | DEFAULT_RANDOM_COLOR 0 |
#define | NUM_OPTS_NO_ARG 3 |
#define | NUM_OPTS_WITH_ARG 12 |
Functions | |
static void | print_usage (void) |
Prints the usage of the program. | |
static Error * | process_help_opt (void) |
Processes the 'help' program options. | |
static Error * | process_version_opt (void) |
Processes the 'version' program options. | |
static Error * | process_random_color_opt (void) |
Processes the 'random-color' program options. | |
static Error * | process_color_out_opt (Option_arg arg) |
Processes the 'color-out' program options. | |
static Error * | process_map_out_opt (Option_arg arg) |
Processes the 'map-out' program options. | |
static Error * | process_edges_in_opt (Option_arg arg) |
Processes the 'edges-in' program options. | |
static Error * | process_edges_out_opt (Option_arg arg) |
Processes the 'edges-out' program options. | |
static Error * | process_begin_mag_thresh_opt (Option_arg arg) |
Processes the 'begin-mag-thresh' program options. | |
static Error * | process_end_mag_thresh_opt (Option_arg arg) |
Processes the 'end-mag-thresh' program options. | |
static Error * | process_break_dp_thresh_opt (Option_arg arg) |
Processes the 'break-dp-thresh' program options. | |
static Error * | process_break_dp_num_avg_opt (Option_arg arg) |
Processes the 'break-dp-num-avg' program options. | |
static Error * | process_sigma_opt (Option_arg arg) |
Processes the 'sigma' program options. | |
static Error * | process_sample_rate_opt (Option_arg arg) |
Processes the 'sample-rate' program options. | |
static Error * | process_min_len_opt (Option_arg arg) |
Processes the 'min-len' program options. | |
static Error * | process_seed_opt (Option_arg arg) |
Processes the 'seed' program options. | |
int | main (int argc, const char **argv) |
Main function for the edge_detector 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 * | map_fname = NULL |
Name of the edge map image to output. | |
static const char * | color_fname = NULL |
Name of the image with edges colored to output. | |
static const char * | edges_in_fname = NULL |
Name of the file to read the edge set from in ASCII. | |
static const char * | edges_out_fname = NULL |
Name of the file to write the edge set to in ASCII. | |
static float | begin_mag_thresh = DEFAULT_BEGIN_MAG_THRESH |
Gradient magnitude edge detection threshold for beginning hysterisis. | |
static float | end_mag_thresh = DEFAULT_END_MAG_THRESH |
Gradient magnitude edge detection threshold for ending hysterisis. | |
static float | break_dp_thresh = DEFAULT_BREAK_DP_THRESH |
Gradient vector dot product threshold for breaking edges. | |
static uint32_t | break_dp_num_avg = DEFAULT_BREAK_DP_NUM_AVG |
Number of gradient vectors to average when computing the dot product threshold for breaking edges. | |
static float | sigma = DEFAULT_SIGMA |
Sigma for smoothing the image. | |
static float | sample_rate = DEFAULT_SAMPLE_RATE |
Percentage of detected edge points to randomly sample from. | |
static uint32_t | min_len = DEFAULT_MIN_LEN |
Minimum edge length. | |
static uint32_t | seed = DEFAULT_MIN_LEN |
Random seed. | |
static uint8_t | random_color = DEFAULT_RANDOM_COLOR |
Boolean whether to randomly color edges. |
static void print_usage | ( | void | ) | [static] |
static Error* process_help_opt | ( | void | ) | [static] |
static Error* process_version_opt | ( | void | ) | [static] |
static Error* process_random_color_opt | ( | void | ) | [static] |
static Error* process_color_out_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_map_out_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_edges_in_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_edges_out_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_begin_mag_thresh_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_end_mag_thresh_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_break_dp_thresh_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_break_dp_num_avg_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_sigma_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_sample_rate_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_min_len_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_seed_opt | ( | Option_arg | arg | ) | [static] |
int main | ( | int | argc, |
const char ** | argv | ||
) |
Option_no_arg opts_no_arg[NUM_OPTS_NO_ARG] [static] |
Option_with_arg opts_with_arg[NUM_OPTS_WITH_ARG] [static] |
const char* map_fname = NULL [static] |
const char* color_fname = NULL [static] |
const char* edges_in_fname = NULL [static] |
const char* edges_out_fname = NULL [static] |
float begin_mag_thresh = DEFAULT_BEGIN_MAG_THRESH [static] |
float end_mag_thresh = DEFAULT_END_MAG_THRESH [static] |
float break_dp_thresh = DEFAULT_BREAK_DP_THRESH [static] |
uint32_t break_dp_num_avg = DEFAULT_BREAK_DP_NUM_AVG [static] |
float sigma = DEFAULT_SIGMA [static] |
float sample_rate = DEFAULT_SAMPLE_RATE [static] |
uint32_t min_len = DEFAULT_MIN_LEN [static] |
uint8_t random_color = DEFAULT_RANDOM_COLOR [static] |