@@ -14,11 +14,9 @@ @interface IRLCameraView () <AVCaptureVideoDataOutputSampleBufferDelegate> {
1414
1515 CIContext * _coreImageContext;
1616 GLuint _renderBuffer;
17- GLKView* _glkView;
18-
17+
1918 BOOL _isStopped;
2019
21- CGFloat _imageDedectionConfidence;
2220 NSTimer * _borderDetectTimeKeeper;
2321 BOOL _borderDetectFrame;
2422 CIRectangleFeature * _borderDetectLastRectangleFeature;
@@ -44,6 +42,10 @@ @interface IRLCameraView () <AVCaptureVideoDataOutputSampleBufferDelegate> {
4442@property (nonatomic , readwrite ) NSUInteger maximumConfidenceForFullDetection; // Default 100
4543@property (readwrite , strong ) UIImageView* transitionSnapsot;
4644
45+ @property (atomic , readwrite ) GLKView* glkView;
46+ @property (nonatomic , readwrite ) CGFloat imageDedectionConfidence;
47+
48+
4749@end
4850
4951@implementation IRLCameraView
@@ -426,7 +428,7 @@ - (void)captureImageWithCompletionHander:(void(^)(UIImage* image))completionHand
426428 }
427429
428430 // crop and correct perspective
429- if (rectangleDetectionConfidenceHighEnough (_imageDedectionConfidence )) {
431+ if (rectangleDetectionConfidenceHighEnough (weakSelf. imageDedectionConfidence )) {
430432 CIRectangleFeature *rectangleFeature = [CIRectangleFeature biggestRectangleInRectangles: (NSArray <CIRectangleFeature *>*)[[weakSelf detector ] featuresInImage: enhancedImage]];
431433
432434 if (rectangleFeature) {
@@ -463,8 +465,9 @@ - (void)enableBorderDetectFrame {
463465}
464466
465467- (void )hideGLKView : (BOOL )hidden completion : (void (^)(void ))completion {
468+ __weak typeof (self) weakSelf = self;
466469 [UIView animateWithDuration: 0.1 animations: ^{
467- _glkView .alpha = (hidden) ? 0.0 : 1.0 ;
470+ weakSelf. glkView .alpha = (hidden) ? 0.0 : 1.0 ;
468471
469472 } completion: ^(BOOL finished) {
470473 if (completion) completion ();
0 commit comments