Class: Ocarina::Config

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/ocarina/config.rb

Overview

OCR configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

#char_to_binary_string, #filename_for_noise_image, #filename_for_quantized_image, #filename_for_training_image, #int_to_binary_string, #is_lower?, #is_upper?, #noise_image_for_char, #pixel_number_to_col, #pixel_number_to_row, #pixel_to_bit, #quantize_image, #reference_image_for_char, #sigma

Constructor Details

#initialize(char_set, num_outputs, char_width, char_height) ⇒ Config

chars_set : the string of characters to be recognized num_outputs : the number of output nodes for the network (# of bits to designate a recognized character) char_width : width in pixels of the input samples char_height : height in pixels of the input samples



19
20
21
22
23
24
# File 'lib/ocarina/config.rb', line 19

def initialize(char_set, num_outputs, char_width, char_height)
  @char_set    = char_set
  @num_outputs = num_outputs
  @char_width  = char_width
  @char_height = char_height
end

Instance Attribute Details

#char_heightObject (readonly)

Returns the value of attribute char_height.



10
11
12
# File 'lib/ocarina/config.rb', line 10

def char_height
  @char_height
end

#char_setObject (readonly)

Returns the value of attribute char_set.



10
11
12
# File 'lib/ocarina/config.rb', line 10

def char_set
  @char_set
end

#char_widthObject (readonly)

Returns the value of attribute char_width.



10
11
12
# File 'lib/ocarina/config.rb', line 10

def char_width
  @char_width
end

#num_outputsObject (readonly)

Returns the value of attribute num_outputs.



10
11
12
# File 'lib/ocarina/config.rb', line 10

def num_outputs
  @num_outputs
end

Instance Method Details

#num_inputsObject

the number of inputs for the network



28
29
30
# File 'lib/ocarina/config.rb', line 28

def num_inputs
  @char_width * @char_height
end