hello everyone, i am running the code for face recognition but in that the camera capture part gives me error...when i execute the code it gives me ==> OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /home/sachin/opencv/sachin/opencv-2.4.10/modules/core/src/persistence.cpp, line 4991 terminate called after throwing an instance of 'cv::Exception' what(): /home/sachin/opencv/sachin/opencv-2.4.10/modules/core/src/persistence.cpp:4991: error: (-2) The node does not represent a user object (unknown type?) in function cvRead Aborted (core dumped) anyone know how to resolved it??
OpenCV Error: Unspecified error (The node does not represent a u
Use OpenCV to Access USB Camera
The full name of "OpenCV" is Open Source Computer Vision Library and it is
a cross platform vision library.
When the NanoPi 2 runs Debian users can use OpenCV APIs to access a USB
Camera device
Here is a guideline on how to use OpenCV with C++ on the NanoPi 2
1. Preparations
---Firstly you need to make sure your NanoPi 2 is connected to the
internet.
Login to your NanoPi 2 via a serial terminal or SSH. After login type in
your username(root) and password(fa):
---Run the following commands:
#apt-get update
(The OS images we provide for the NanoPi 2 by default have the vi utility.
However we suggest you install the vim utility)
#apt-get install vim
#apt-get install libcv-dev libopencv-dev2. Make sure your USB camera works
with the NanoPi 2. You can test your camera with NanoPi 2's camera utility.
3. Check your camera device:
#ls /dev/video + "Tab" key (This lists available USB camera devices. )4.
OpenCV's code sample:
#cd /home/fa
#vim test.cpp
#include "opencv2/opencv.hpp"
using namespace cv;
int main(int, char**)
{
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;
Mat edges;
namedWindow("edges",1);
for(;;)
{
Mat frame;
cap >> frame; // get a new frame from camera
cvtColor(frame, edges, CV_BGR2GRAY);
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
Canny(edges, edges, 0, 30, 3);
imshow("edges", edges);
if(waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture
destructor
return 0;
}Compile the code sample:
#g++ test.cpp -o test -lopencv_core -lopencv_highgui -lopencv_imgprocIf it
is compiled successfully a "test" executable will be generated:
5. Connect NanoPi 2 to USB Keyboard & Run the Following Command:
#./test

