Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

identifier 'imshow' and 'waitkey' is undefined

Hi,

I am trying to open the camera through opencv using 'uwp c++ blank template' in vs 2015. but i am getting error identifier 'imshow' is undefined and identifier 'waitkey' is undefined . i also install nuget package .which package did i exactly missing. code below

include "pch.h"

include<opencv2\opencv.hpp>

include "MainPage.xaml.h"

using namespace OpenCam_22aug;

using namespace Platform; using namespace Windows::Foundation; using namespace Windows::Foundation::Collections; using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Controls::Primitives; using namespace Windows::UI::Xaml::Data; using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 using namespace cv; MainPage::MainPage() { InitializeComponent(); } int main(int argc, char** argv) { VideoCapture cap; // open the default camera, use something different from 0 otherwise; // Check VideoCapture documentation. if (!cap.open(0)) return 0; for (;;) { Mat frame; cap >> frame; if (frame.empty()) break; // end of video stream imshow("this is you, smile! :)", frame); if (waitKey(1) == 27) break; // stop capturing by pressing ESC } // the camera will be closed automatically upon exit // cap.close(); return 0; }

identifier 'imshow' and 'waitkey' is undefined

Hi,

I am trying to open the camera through opencv using 'uwp c++ blank template' in vs 2015. but i am getting error identifier 'imshow' is undefined and identifier 'waitkey' is undefined . i also install nuget package .which package did i exactly missing. code below

include "pch.h"

include<opencv2\opencv.hpp>

include "MainPage.xaml.h"

using namespace OpenCam_22aug;

#include "pch.h"
#include<opencv2\opencv.hpp>
#include "MainPage.xaml.h"


using namespace OpenCam_22aug;

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;

Windows::UI::Xaml::Navigation; // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 using namespace cv; MainPage::MainPage() { InitializeComponent(); } int main(int argc, char** argv) { VideoCapture cap; // open the default camera, use something different from 0 otherwise; // Check VideoCapture documentation. if (!cap.open(0)) return 0; for (;;) { Mat frame; cap >> frame; if (frame.empty()) break; // end of video stream imshow("this is you, smile! :)", frame); if (waitKey(1) == 27) break; // stop capturing by pressing ESC } // the camera will be closed automatically upon exit // cap.close(); return 0; }

}