#include <OptIm15.h>
Inheritance diagram for Conjecture::OptIm15:
This class provides functionality and data for analyzing features of tiny images (size 16x16 or less).
One bit is used to represent each pixel, and is either on (black) or off (white). Information about each row and column is maintained, including the number of holes and the number of black pixels. This information will hopefully allow for the implementation of efficient methods related to feature extraction.
The 'str' method is a useful debugging tool that shows the information maintained within an instance of this class in a very concise fashion. An example of the output for the call: optim->str('#','.',7) will be 0111110 0 #...... 1 0 #...... 1 0 #...... 1 0 #...... 1 1 #.###.. 4 1 ##...#. 3 1 #.....# 2 1 #.....# 2 0 .#####. 5 8222222 assuming that 'optim' represents the 'b' shown. The numbers around the borders are interpreted as follows:
IMPORTANT: A "hole" in a line is a sequence of contiguous zero's (off or white bits) enclosed in 1's (on or black bits) on both ends.
Public Member Functions | |
OptIm15 (const Image *image, const ImageArgs &config) | |
OptIm15 (const std::vector< unsigned int > &rows, unsigned char width=15) | |
const uint8_t & | width () const |
const std::vector< PixelLine15 > & | cols () const |
const std::vector< PixelLine15 > & | rows () const |
void | init (const std::vector< unsigned int > &rows, unsigned char width) |
int | rblack (unsigned char i) const |
Number of black pixels in row 'i'. | |
int | rholes (unsigned char i) const |
Number of holes in row 'i'. | |
int | cblack (unsigned char i) const |
Number of black pixels in column 'i'. | |
int | choles (unsigned char i) const |
Number of holes in column 'i'. | |
std::string | str (char on= '#', char off= '.') const |
Static Public Member Functions | |
static void | test (int argc=0, const char *argv[]=NULL) |
Protected Member Functions | |
void | widthIs (const uint8_t &width) |
void | colsIs (const std::vector< PixelLine15 > &cols) |
void | rowsIs (const std::vector< PixelLine15 > &rows) |
std::string | rawstr (const std::vector< PixelLine15 > &vec, char on= '1', char off= '0', unsigned char size=15) const |
|
Create printable representation of this OptIm15. See the class comments for more details. |