message tables的CvVideoCamera使用情况无法正常工作。在委托人的processImage
中修改的图像显示为完全不变。
ViewController.h:
#import <UIKit/UIKit.h>
#import <opencv2/videoio/cap_ios.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *btnStart;
@property (weak, nonatomic) IBOutlet UIImageView *myimg;
@end
ViewController.mm:
#import "ViewController.h"
#import <opencv2/videoio/cap_ios.h>
@interface ViewController ()<CvVideoCameraDelegate>
@property (strong, nonatomic) CvVideoCamera *videoCamera;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.videoCamera = [[CvVideoCamera alloc] initWithParentView:self.myimg];
[self.videoCamera setDelegate:self];
self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;
self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPresetHigh;
self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationPortrait;
self.videoCamera.defaultFPS = 30;
self.videoCamera.useAVCaptureVideoPreviewLayer = YES;
}
- (IBAction)actionStart:(id)sender {
[self.videoCamera start];
}
- (void)processImage:(cv::Mat &)image;
{
cv::Mat image_copy;
cvtColor(image, image_copy, CV_BGRA2BGR);
bitwise_not(image_copy, image_copy);
cvtColor(image_copy, image, CV_BGR2BGRA);
}
一旦我按下按钮,正常的摄像机流将呈现,没有任何干预的痕迹。我还尝试绘制形状,甚至在image.release()
内调用processImage
都无效。
我想我这里缺少明显的东西。 Simple example
答案 0 :(得分:0)
此行是问题的根源:
let myArray = []
if (this.parameter && this.search ?) {
myArray = this.parameter.filter((download) => {
return download.barcode.includes(this.search.toLowerCase())
})
}
return myArray
一旦删除,一切都会按预期进行。