2013-04-09 54 views
1

我想識別寫入圖像中的文本,所以我想裁剪此圖像以僅在所需部分上製作處理而不是所有圖像。 因此,任何想法我怎麼能做到這一點? 下面是使用圖像上的代碼時:裁剪圖像以對結果進行處理

NSString*ret= [self DoProcess:capturedImage]; 

這是我要裁剪所拍攝的圖像,使上它的進程。

回答

0

您可以定義爲的CGRect要提取,然後用下面的方法圖像的一部分:

CGRect cropRect = ...; 
UIImage *cropped = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([fullImage CGImage], cropRect) scale:fullImage.scale orientation:fullImage.imageOrientation];