Hexagon Cells (hCell)
is a C++ dynamic link library, which allows representing raster images with hexagonical paches. In contrast to the state-of-the-art quadratic representation, it does not suffer from washer-shaped objects paradox, described in A. Rosenfeld, "Connectivity in Digital Pictures", Journal of the ACM, Vol 17, pp 146-160, 1970. An additional disadvantage of the square pixel is that the 8 neighbors around the center pixel are not equidistant, which causes the accuracy for the diagonal and off diagonal directions to be reduced in their magnitude.
The hexagonocal representation is definied by the hexagon outer radius \( R \) and must be larger than 1 pixel. The inner hexagon radius is calculated as follows: \( r = \frac{\sqrt{3}}{2}R \). Thus the hexagon area \(S = 3rR = \frac{3\sqrt{3}}{2}R^2\). For additional information please refere to Regular hexagon.
The library consists of the following classes:
Installation
Installing OpenCV
This library is based on OpenCV library v.2.4.11. In order to use the DGM library, the OpenCV library should be also installed.
- Download the OpenCV library from sourcefourge
- Install the OpenCV library. You may follow the installation guide
Installing hCell
- Download the DGM library from Project X Research
- Unzip it to your local folder (for example to disk C:\, so the library path will be C:\hCell\)
- In case you want to rebuild the library from the "Win32" / "x64" packages or you use the "Source" package follow these instructions, otherwise - skip this step
- Configure the paths in the hCell Visual Studio solution to match your installed OpenCV paths
- Perform Build -> Batch Build
- If you want to run the demo applications, you may need to copy OpenCV dll files to the C:\hCell\bin\Release and/or C:\hCell\bin\Debug folders
- Specify the following paths and library
- Add to Configuration Properties -> C/C++ -> General -> Additional Include Directories the path C:\hCell\include\
- Add to Configuration Properties -> Linker -> General -> Additional Library Directories the path C:\hCell\lib\Release\ and C:\hCell\lib\Debug\ for Release and Debug configurations accordingly
- Add to Configuration Properties -> Linker -> Input -> Additional Dependencies the libraries hCell111.lib and hCell111d.lib for Release and Debug configurations accordingly
- Copy the DGM dll files hCell111.dlll from C:\hCell\bin\Release and hCell111d.dll from C:\hCell\bin\Debug to your project's Relese and Debug folders.
How to use the code
The documentation for hCell consists of one demo, introducing the basic functionality of the library:
- Demo Code : An introduction to hCell library.
- Author
- Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de