My imagem has a "light reflection", the two first zeros on the image has some light different of the rest of the image. Whe I convert this to a binary image, this part becomes white, and I need to get the exact contour of the number and this hinders. ow I could solve this by using OpenCV?
the original image https://docs.google.com/file/d/0BzUNc6BOkYrNNlE3U04wWEVvVE0/edit?usp=sharing
the binary version https://docs.google.com/file/d/0BzUNc6BOkYrNeEE0U3NvOElqa1E/edit?usp=sharing
If I increase the value of the threshold, I lose the numbers on the right side of the image. My code:
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main ( int argc, char **argv )
{
Mat im_gray = imread("img2.jpg",CV_LOAD_IMAGE_GRAYSCALE);
Mat im_rgb = imread("img2.jpg");
cvtColor(im_rgb,im_gray,CV_RGB2GRAY);
Mat img_bw = im_gray > 90;
imwrite("image_bw2.jpg", img_bw);
return 0;
}