-4

Possible Duplicate:
OCR using openCV

I wants to convert gray Image into Black and White (with good contrast). I am using openCV. I am struggling from last 3 days but my output image is not clear as show below.

Thanks

Original Image : enter image description here

Output Image :

enter image description here

Community
  • 1
  • 1
QueueOverFlow
  • 1,336
  • 5
  • 27
  • 48
  • @NickBull This is also my question, I think I explain little bit extra in that question, So i Ask again here – QueueOverFlow Nov 07 '12 at 10:12
  • 1
    You haven't provided any extra information in this question to your other question. You shouldn't open a new question just because you haven't got an answer on an existing one. Go back to the other question and add more information or respond to questions in the comments to explain more. – Nick Bull Nov 07 '12 at 10:15

1 Answers1

0

Try this it will help you to get the proper image

UIImage *image=[UIImage imageNamed:@"EUqAd.jpg"];
        UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(20, 20, 280, 150)];
        imageView.image=image;
        [self.view addSubview:imageView];

    CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextClipToMask(context, rect, image.CGImage);
    CGContextSetFillColorWithColor(context, [[UIColor whiteColor] CGColor]);
    CGContextFillRect(context, rect);
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    UIImage *flippedImage = [UIImage imageWithCGImage:img.CGImage
                                                scale:1.0 orientation: UIImageOrientationDownMirrored];

    UIImageView *imageView1=[[UIImageView alloc]initWithFrame:CGRectMake(20, 200, 280, 150)];
    imageView1.image=flippedImage;
    [self.view addSubview:imageView1];