This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def split_image_into_chars(img): | |
img_array = scipy.misc.imread(img, flatten=True) | |
print(img_array.shape) | |
rows = img_array.shape[0] | |
cols = img_array.shape[1] | |
img_data = 255.0 - img_array.reshape(rows * cols) | |
img_array = (img_data / 255.0 * 0.99) + 0.01 | |
img_array = np.array(img_array).reshape(rows, cols) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <random> | |
#include <algorithm> | |
#include <fstream> | |
#include <boost/numeric/ublas/matrix.hpp> | |
#include <boost/numeric/ublas/io.hpp> | |
using namespace boost::numeric; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() return int | |
{ | |
new arr = array of int(10); | |
repeat 10 { | |
arr[index] = index+1; | |
} | |
repeat 10 { | |
print arr[index]; | |
} |