小编mub*_*ary的帖子

如何使用 opencv 和 C++ 在图像的特定区域找到轮廓?

我是 opencv 的新手。我正在尝试检测特定图像中的车辆,例如大小为 (300, 400) 的图像的 x=0 到 139 和 y=0 到 300。

那么我应该使用什么条件在特定区域进行检测并在车辆通过后进入框架进行计数?

enter code herevoid processVideo(char* videoFilename) {
//create the capture object
`VideoCapture capture(videoFilename);
if(!capture.isOpened()){
    //error in opening the video input
    cerr << "Unable to open video file: " << videoFilename << endl;
    exit(EXIT_FAILURE);
}
//read input data. ESC or 'q' for quitting
while( (char)keyboard != 'q' && (char)keyboard != 27 ){
    //read the current frame
    if(!capture.read(frame)) {
        cerr << "Unable to read next frame." << endl;
        cerr …
Run Code Online (Sandbox Code Playgroud)

c++ opencv image-processing

4
推荐指数
1
解决办法
3781
查看次数

标签 统计

c++ ×1

image-processing ×1

opencv ×1