Main Page | Namespace List | Compound List | File List | Compound Members | File Members

main.cpp File Reference

#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <iostream>
#include <stdlib.h>
#include <list>
#include <fstream>
#include <string.h>
#include "Histogram_element.h"
#include "Constants.h"
#include "Color.h"
#include "Image.h"
#include "Matrix.h"
#include "Html_cluster.h"

Functions

ImagegetImage (char *fileName)
Region_infoparsePolyRegion (DOMElement *start, char *ellipse_region_label)
void parseTexture (Image *i, DOMDocument *doc, DOMElement *root)
void parseColor (Image *i, DOMDocument *doc, DOMElement *root)
Colorhex_to_color (char *color)
void parseStructure (Image *i, DOMDocument *doc, DOMElement *root)
Histogram_elementmakeHistogram (Line_cluster *cluster, int divisions)
void write_html_file (char *fileName, int numOfClusters, int image_size, Html_cluster **clusters)
int write_structure_classes (Image *i, ofstream *outFile)
void write_length_angle_gif (Image *i)
void processStructure (Image *i)
bool endsInXML (char *name)
void draw_lines (int rows, int cols, int **canvas, Line_cluster cluster)
void fill_lines (int rows, int cols, int **canvas)
void draw_clusters_gif (Image *i)
void kmeans_classify ()
int main (int argc, char *argv[])

Variables

vector< Image * > * ls = new vector<Image *>()

Function Documentation

void draw_clusters_gif Image i  ) 
 

Name: draw_clusters_gif

Purpose: draws the picture of the symbolic signatures

void draw_lines int  rows,
int  cols,
int **  canvas,
Line_cluster  cluster
 

Name: draw_lines

Purpose: To draw the lines of each cluster onto the canvas of ints--if a point about to be written overlaps with another labelled point, then the new label will be placed to both the immediate right and left of the original point

bool endsInXML char *  name  ) 
 

Name: endsInXML

Purpose: ensures that the string passed in ends in ".xml"

void fill_lines int  rows,
int  cols,
int **  canvas
 

Image* getImage char *  fileName  ) 
 

Name: getImage

Purpose: to see if an image with the same name has been evaluated previously

Color* hex_to_color char *  color  ) 
 

Name: hex_to_color

Purpose: Convert hex colors to RGB and return a Color object

Notes: this function is used for the structure regions, where color is encoded in hex

void kmeans_classify  ) 
 

Name: kmeans_classify

Purpose: use Viet's k-means function to classify the images that have been processed

int main int  argc,
char *  argv[]
 

main

Histogram_element* makeHistogram Line_cluster cluster,
int  divisions
 

Name: makeHistogram

Purpose: divides the line segments of a cluster into |divisions| buckets according to orientation and stores that information in an array of Histogram elements

void parseColor Image i,
DOMDocument *  doc,
DOMElement *  root
 

Name: parseColor

Purpose: get all the color attributes into the Image object

Region_info* parsePolyRegion DOMElement *  start,
char *  ellipse_region_label
 

Name: parsePolyRegion

Purpose: gets all the information for the region of a polygon and puts it into the Image including ellipse into that approximates the region, and more specific contour info

Notes: passes in a label for the name of the ellipse region because in some files it is "polygon-region" and in others it is "region-info"

void parseStructure Image i,
DOMDocument *  doc,
DOMElement *  root
 

Name: parseStructure

Purpose: get all the structure attributes into the Image object

void parseTexture Image i,
DOMDocument *  doc,
DOMElement *  root
 

Name: parseTexture

Purpose: get all texture attributes into the Image object

void processStructure Image i  ) 
 

Name: processStructure

Purpose: writes the html and histograms for the Images that had a structure XML file

void write_html_file char *  fileName,
int  numOfClusters,
int  image_size,
Html_cluster **  clusters
 

Name: write_html_file

Purpose: writes an html file for the data from the structure regions the file has the name of the Image concatenated with "_structure_data.html"

void write_length_angle_gif Image i  ) 
 

Name: write_length_angle_gif

Purpose: creates a length-angle histogram for each line cluster, writing it to a gif file

Notes: creates a ppm file initially, to represent the length-angle histogram for each cluster converts that to a gif file and deletes the ppm file that was written currently, the maxval is set at 255 for each RGB element, but that could be changed

int write_structure_classes Image i,
ofstream *  outFile
 

Name: write_structure_classes

Purpose: writes to a text file that is used to classify each cluster region

Notes:

When in CLASSIFY mode:

for sal ruiz's classifiers, the output file is in the format: class_number(GROUP) feature_number_1:value_1 feature_number_2:value_2 ... is now outputting in a sparse format, i.e., if value_n = 0, nothing is printed (ex-- feature_n-1:value_n-1 feature_n+1:value_n+1)

When in KMEANS mode:

the output file is in the format: N K vector_1 vector_2 vector_3 ... vector_m where each vector_i is of length N, N is the number of features that are being used to classify each cluster, and K is the number of classes that I want the clusters divided into


Variable Documentation

vector<Image *>* ls = new vector<Image *>()
 


Generated on Thu Sep 4 14:59:31 2003 for Content-Based Image Retrieval by doxygen 1.3.3