2012-11-07 101 views
-3

可能重复:
OCR using openCV图像处理的OpenCV

我想灰度图像转换成黑白(具有良好的对比度)。我正在使用openCV。我从过去3天开始挣扎,但是我的输出图像并不清晰,如下所示。

感谢

原始图像: enter image description here

输出图像:

enter image description here

+0

@NickBull这是一个我的问题,我想我解释一些额外的问题,所以我再问这里 – QueueOverFlow

+1

你还没有提供任何额外的信息在这个问题上你的其他问题。你不应该因为你现有的答案没有答案而开一个新的问题。回到另一个问题,添加更多信息或回复评论中的问题来解释更多。 –

回答

0

试试这个它会帮助你得到适当的图像

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];