Hello everyone,
I would like to inform you that I am newbie to Tegra K1 development kit.
Nowadays I just would like to use opencv and write image processing code with Logitech c310 model web cam.I connected it directly to usb which is one available on tegra k1.
I sucessfully installed Cuda and opencv4tegra with jetpack.
I checked the version of them and respectively the outputs are ;
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Tue_Feb_17_22:53:16_CST_2015
Cuda compilation tools, release 6.5, V6.5.45
-I/usr/include/opencv
Also I checked this topic : https://devtalk.nvidia.com/default/topic/943129/jetson-tx1/highgui-error-v4l-v4l2-while-opening-camera-with-opencv4tegra-l4t-r24/
According to this topic I tried sample program in c++ like this ;
#include "opencv2/opencv.hpp"
using namespace cv;
int main(int, char**)
{
VideoCapture cap(0); // open the default camera
if(!cap.isOpened())
return -1;
namedWindow("Preview",1);
Mat frame;
for(;;)
{
cap >> frame; // get a new frame from camera
imshow("Preview", frame);
if(waitKey(2) >= 0) break;
}
return 0;
}
I downloaded Gtk2.0 and gst1.0
ii libgtk2.0-0:ar 2.24.23-0ubu armhf GTK+ graphical user interface lib
gir1.2-gstreamer-1.0 1.2.4-0ubuntu1
Also I installed V4L drivers.After all, I run above code with this command;
g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib/ -g -o binary main.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_stitching
The I tried to run the code for logitech web cam with
Videocapture ("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")
But it did not work either.
./binary
The program did not give any errors, but entered the program and immediately closed.It didn’t show any image stream.
Also Videocapture(0) gives this error:
HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
(Preview:7785): Gtk-WARNING **: cannot open display:
The version of the open cv is : 2.4.13
Any help will be apreciated