Ask Your Question

Zekke's profile - activity

2015-10-07 09:35:13 -0600 commented question [OCR pre-processing] need tips

Actually it's the first project of "Introducing to marchine learning". Basically, the images are simple pictures of a character handwritten on a cardboard. Code side, I just have my "neuronal network" (classes with some methods using matrices etc...), for the pre-processing part I have nothing :

void    Test::preprocess(char* file)
{
    Mat img = imread(file, CV_LOAD_IMAGE_UNCHANGED);

    if (!img.empty())
    {
        namedWindow("OCR", CV_WINDOW_AUTOSIZE);
        imshow("OCR", img);
        waitKey(0);
        destroyWindow("OCR");
    }
}
2015-10-07 07:40:36 -0600 received badge  Editor (source)
2015-10-07 05:59:48 -0600 received badge  Organizer (source)
2015-10-07 05:15:21 -0600 asked a question [OCR pre-processing] need tips

Hi guys, For a school project, I have to do an OCR program. I implemented the neural network but now I have to pre-process the inputs (teacher said : use openCV and RTFM \o/). What I want to do is "simple" :

  1. I want to "clean" the image (white background, black character)
  2. Crop the image in 64px by 64px and resize character to make it fill the new image
  3. Convert image in a 64 by 64 matrix (black pixel = 1, white pixel = 0)

Since I'm very new with OpenCV (and I'm running out of time), I'm looking for some hints. Thank you very much !

(Sorry for my bad english)