@@ -103,14 +103,14 @@ - (void)drawTextRect:(CIImage*)image{
103
103
// text
104
104
VNDetectTextRectanglesRequest *textLandmarks = [VNDetectTextRectanglesRequest new ];
105
105
textLandmarks.reportCharacterBoxes = YES ;
106
- VNSequenceRequestHandler *faceLandmarksDetectionRequest = [VNSequenceRequestHandler new ];
107
- [faceLandmarksDetectionRequest performRequests: @[textLandmarks] onCIImage: image error: nil ];
106
+ VNSequenceRequestHandler *handler = [VNSequenceRequestHandler new ];
107
+ [handler performRequests: @[textLandmarks] onCIImage: image error: nil ];
108
108
for (VNTextObservation *observation in textLandmarks.results ){
109
109
// find text rectangle
110
110
for (VNRectangleObservation* box in observation.characterBoxes ){
111
111
// draw rect on each char of the text
112
112
CGRect boundingBox = box.boundingBox ;
113
- NSLog (@" |-%@ " , NSStringFromCGRect(boundingBox));
113
+ // NSLog(@" |-%@", NSStringFromCGRect(boundingBox));
114
114
CGSize size = CGSizeMake (boundingBox.size .width * self.sourceImgView .bounds .size .width , boundingBox.size .height * self.sourceImgView .bounds .size .height );
115
115
CGPoint origin = CGPointMake (boundingBox.origin .x * self.sourceImgView .bounds .size .width , (1 -boundingBox.origin .y )*self.sourceImgView .bounds .size .height - size.height );
116
116
@@ -186,7 +186,7 @@ - (IBAction)useCamera:(id)sender {
186
186
[self presentViewController: picker animated: YES completion: NULL ];
187
187
}else {
188
188
UIAlertController* alert = [UIAlertController alertControllerWithTitle: @" No camera found!"
189
- message: @" Are you on simlulator ? Use an actual device or try picking an image from gallery"
189
+ message: @" Are you on simulator ? Use an actual device or try picking an image from gallery"
190
190
preferredStyle: UIAlertControllerStyleAlert];
191
191
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle: @" OK" style: UIAlertActionStyleDefault
192
192
handler: ^(UIAlertAction * action) {}];
0 commit comments