OpenCV Error: Assertion failed in unknown function,

后端 未结 2 1588
遇见更好的自我
遇见更好的自我 2021-01-26 15:54

I read alot from other solution but i still confused what should i do with mine...

#include 
#include 

        
相关标签:
2条回答
  • 2021-01-26 15:58

    Okay, I think I know what happened. I tried running the program and it worked perfectly.

    You have probably not linked the required DLL's.. Make sure (in case you are using Windows) your opencv/bin is included in your environment variables. This is my CMakeLists.txt file to make things easier for you,

    cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
    project(SO_example)
    
    FIND_PACKAGE(OpenCV REQUIRED)
    
    SET (SOURCES
        #VTKtoPCL.h
        main.cpp
        )
    
    add_executable(so_example ${SOURCES})
    target_link_libraries(so_example ${OpenCV_LIBS})
    
    0 讨论(0)
  • 2021-01-26 16:10

    It seems like VideoCapture can't grab frame from your camera. Add this code to check result of frame grabbing:

    //create a loop to capture and find faces
    while (true)
    {
        //capture a new image frame
        captureDevice >> captureFrame;
        if (captureFrame.empty())
        {
            cout << "Failed to grab frame" << endl;
            break;
        }
        ...
    

    If it is a problem of VideoCapture check that you installed drivers for your camera.

    0 讨论(0)
提交回复
热议问题