Median Search Demo
0.4
Median search demo (lib used by adaptive median image filter)
|
#include "medians_1D.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Go to the source code of this file.
Functions | |
void | swap (pixelvalue *a, pixelvalue *b) |
Pixel-swapping macro. More... | |
pixelvalue | quick_select (pixelvalue a[], int n) |
Function implementing quickselect algorithm. More... | |
pixelvalue | kth_smallest (pixelvalue a[], int n, int k) |
Function implementing kth_smallest() for Wirth macro. More... | |
pixelvalue | wirth (pixelvalue a[], int n) |
Function wrapper for kth_smallest to get Wirth's median. More... | |
pixelvalue | torben (pixelvalue m[], int n) |
Function implementing Torben's algorithm. More... | |
Variables | |
static const char | rcsid [] |
pixelvalue kth_smallest | ( | pixelvalue | a[], |
int | n, | ||
int | k | ||
) |
Function implementing kth_smallest() for Wirth macro.
Function : kth_smallest()
Definition at line 130 of file medians_1D.c.
References swap().
Referenced by wirth().
pixelvalue quick_select | ( | pixelvalue | a[], |
int | n | ||
) |
Function implementing quickselect algorithm.
Function : quick_select()
Definition at line 70 of file medians_1D.c.
References swap().
Referenced by bench().
void swap | ( | pixelvalue * | a, |
pixelvalue * | b | ||
) |
Pixel-swapping macro.
Macro left-over from initial implementation. Need to change to a real function and let the compiler do the workFunction implementing basic pixel swapping algorithm
Definition at line 53 of file medians_1D.c.
Referenced by kth_smallest(), and quick_select().
pixelvalue torben | ( | pixelvalue | m[], |
int | n | ||
) |
Function implementing Torben's algorithm.
Function : torben()
Definition at line 178 of file medians_1D.c.
Referenced by bench().
pixelvalue wirth | ( | pixelvalue | a[], |
int | n | ||
) |
Function wrapper for kth_smallest to get Wirth's median.
Function : wirth()
Definition at line 163 of file medians_1D.c.
References kth_smallest().
Referenced by bench().
|
static |
Definition at line 38 of file medians_1D.c.