What can I do to eliminate the "light reflection" of an image? using opencv

My imagination has a "light reflection", the first two zeros in the image have some light different from the rest of the image. I convert this to a binary image, this part turns white, and I need to get the exact outline of the number, and it gets in the way. ow Could I solve this with OpenCV?

source image https://docs.google.com/file/d/0BzUNc6BOkYrNNlE3U04wWEVvVE0/edit?usp=sharing

binary version https://docs.google.com/file/d/0BzUNc6BOkYrNeEE0U3NvOElqa1E/edit?usp=sharing

If I increase the threshold value, I lose the numbers on the right side of the image. My code is:

#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;
}  
+5
2

- . .

- . , :

  • , , (, ),
  • (cvSobel )
  • , .
+2

All Articles