binmorph_tool.h

Go to the documentation of this file.
00001 //
00002 // Binary image morphology tool
00003 //
00004 
00005 
00006 #ifndef MORPHOLOGY_TOOL_H
00007 #define MORPHOLOGY_TOOL_H
00008 
00009 #include <iostream>
00010 #include <cmath>
00011 #include <values.h>
00012 #include "image.h"
00013 #include "rgba.h"
00014 
00015 namespace mimas {
00016 
00017 
00026 class binmorph_tool //: public object
00027 {
00028   private:
00029     image<int> structElement; 
00030     enum operation {binmorph_dilation, binmorph_erosion};
00031     void morphology(image<int> &imagein, image<int> &imageout, binmorph_tool::operation op );
00032     int structElementOnes(void); 
00033     void labelConnectedGroup(image<int> &imagein, image<int> &imageout, int x, int y, int label); // private recursive function for connected components
00034 
00035   public:
00036     binmorph_tool(void); 
00037     ~binmorph_tool(void); 
00038     // void setStructElement(image<int> &structElem); ///< redefine the structuring element
00039     void setSizeStructElement(int size); 
00040     void greyToBinaryOtsu(image<int> &imagein, image<int> &imageout); 
00041     void greyToBinary(image<int> &imagein, image<int> &imageout, int threslevel); 
00042     void greyToBinary(image<int> &imagein, int threslevel); 
00043     void binaryToGrey(image<int> &imagein); 
00044     void normaliseToGrey(image<int> &imagein); 
00045     void normaliseToColour(image<int> &imagein, image< rgba< int > > &imageout); 
00046     void negate(image<int> &imagein); 
00047     image<int> image_and(image<int> &image1, image<int> &image2); 
00048     void erosion(image<int> &imagein, image<int> &imageout); 
00049     void dilation(image<int> &imagein, image<int> &imageout); 
00050     void closing(image<int> &imagein, image<int> &imageout); 
00051     void opening(image<int> &imagein, image<int> &imageout); 
00052     void difference(image<int> &imagein1, image<int> &imagein2, image<int> &imageout); 
00053     void boundaryExtract(image<int> &imagein, image<int> &imageout); 
00054     void connectedComponents(image<int> &imagein, image<int> &imageout); 
00055     void distanceTransform(image<int> &imagein, image<int> &imageout); 
00056 
00057     // supplementary functions
00058     void floodFill(image<int> &imagein, int x, int y, int newval, int oldval);; // flood fill. Replace oldval with newval starting from point x,y
00059 };
00060 
00061 };
00062 
00063 #endif
00064 
00065 

[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:16 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...