iphone - ios face detection fails in landscape mode -
i using opencv framework detection of face. have blocked auto rotation. using method face.
detectmultiscale(frame_gray, faces, 1.1, 2, 0 | cv_haar_scale_image, cv::size(100, 100)); when hold iphone in portrait mode face detection working fine when rotate iphone landscape mode face detection fails. implantation of cvvideocamera
self.videocamera = [[cvvideocamera alloc] initwithparentview:self.imageview]; self.videocamera.defaultavcapturedeviceposition = avcapturedevicepositionfront; self.videocamera.defaultavcapturesessionpreset = avcapturesessionpreset352x288; self.videocamera.defaultavcapturevideoorientation = avcapturevideoorientationportrait; self.videocamera.defaultfps = 30; self.videocamera.grayscalemode = no; self.videocamera.delegate = self;
quick fix before initialize cvvideocamera add these these lines
nsnumber *value = [nsnumber numberwithint:uiinterfaceorientationportrait]; [[uidevice currentdevice] setvalue:value forkey:@"orientation"];
self.videocamera = [[cvvideocamera alloc] initwithparentview:self.previewimage]; self.videocamera.delegate = self;
Comments
Post a Comment