#include <math.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#include <sys\types.h>
#include "Segmentation.h"
#include "OrderedLists.h"
#include "DateTime.h"
Defines | |
#define | DECIMAL_POSITIONS 4 |
#define | ERROR_MESSAGE_LENGTH 80 |
#define | EXPECTED_PARENTS_NUMBER 1000 |
#define | LINE_WIDTH 120 |
#define | MAX_DIST 1.0 |
#define | MAX_RESULT_RGB (255.0 * sqrt(3)); |
#define | MIN_NORM 1.0 |
#define | NAME_LENGTH 80 |
#define | PI 3.14159265358979323846 |
#define | SHORT_AUXILIARY_STRING_LENGTH 20 |
#define | WORD_WIDTH 20 |
Functions | |
void | allocateFilesList (char **&filesList) |
int | changeBase (int iNumber, int *iBaseNumber, int iBase) |
int | changeCartesianVermis (int c, int r, int cols) |
void | changeRGBToHSV (double r, double g, double b, double &h, double &s, double &v) |
void | changeVermisCartesian (int vermis, int cols, int *c, int *r) |
int | compare_w (const void *, const void *) |
void | copyImageBW (PixelPlane final, PixelPlane initial, int rows, int cols) |
Copies the pixels in initial PixelPlane into final. | |
void | copyImageColour (PixelPlane finalr, PixelPlane finalg, PixelPlane finalb, PixelPlane initialr, PixelPlane initialg, PixelPlane initialb, int rows, int cols) |
void | displayInstructionsMessage (void) |
void | FatalError (char const *message) |
pixel_type | findminmaxw (edge_type *, int) |
int | FindSet (int, node_type *) |
void | freeFilesList (char **filesList) |
Frees memory allocated by allocateFilesList. | |
void | generateFileNames (char *filesList[], SegmentationParameters &parms) |
Generates the names of the output files. | |
void | getArgumentsFromUser (int argc, char *argv[], SegmentationParameters &parms, char *filesList[]) |
Stores the program arguments in their respective variables. | |
void | initializeOptionsViaDefine (SegmentationOptions &segmentation, OutputOptions &output) |
Initialize all options needed via data supplied through #DEFINES. | |
int | Link (int, int, node_type *, float) |
void | logbucketsort (edge_type *, edge_type *, int, int) |
double | mesureColourDistance (double r1, double g1, double b1, double r0, double g0, double b0) |
double | mesureDistance (PixelType *pixelA, PixelType *pixelB, ImageType type, unsigned nPlanes, PixelMetric metric) |
Returns the selected metric distance between 2 pixels. | |
double | mesureHueDistance (double r1, double g1, double b1, double r2, double g2, double b2) |
double | mesureToneDistance (double r1, double g1, double b1, double r2, double g2, double b2) |
double | MInt (int, int, node_type *, SegmentationParameters const &parms) |
double | norm3D (double x, double y, double z) |
double | obtainHueFromRGB (double r, double g, double b) |
double | productScalar (double r1, double g1, double b1, double r0, double g0, double b0) |
int | roundPositiveDoubleToNearest (double number) |
int | searchNeighborSpot (int iInitialPixel, node_type *F, int cols, int rows) |
size_t | segmentBWImage (SimplePixelImage &originalImage, SegmentationParameters const &parms, double *elapsedtime) |
size_t | segmentRGBImage (SimplePixelImage &originalImage, SegmentationOptions const &segmentation, double *elapsedtime, int *(**iSpotPixels), SpotStatistics *(*sSegmentationStatistics)) |
size_t | segmentSimplePixelImage (SimplePixelImage const &inputImage, int *(**iSpotPixels), SegmentationOptions const &segmentation, SpotStatistics *(*sSegmentationStatistics), FilesOptions const &files) |
Segments a Simple Pixel Image according to the SegmentationOptions. | |
double | sqr (double a) |
float | weightConnection () |
in void | writeSpotStatistics (char *spot_statistics_file, SpotStatistics *sSegmentationStatistics, size_t sizeTotalSegments) |
Writes into file the statistics for each segment. |
|
Allocates memory for files List and initializes them with the '\0' character |
|
Copies each PixelPlane into the corresponding one. that is: copies initialr into finalr, initialg into finalg, and so on. |
|
Generates the names of the output files.
From the full file name (path+name) -stored in SOURCE_FILE position of filesList- this function generates the rest of files names and stores them in filesList.
|
|
Stores the program arguments in their respective variables. These arguments must be introduced in the following order: Obligatory
Optional |
|
Initialize all options needed via data supplied through #DEFINES.
|
|
Segments a Simple Pixel Image according to the SegmentationOptions.
|
|
Writes into file the statistics for each segment.
|