Our Product InsightsUSB Cameras

Working with See3CAM – USB3 Cameras and OpenCV

OpenCV is an open source BSD licensed image processing bundle that contains functions for basic image decoding, enhancement, color space conversion, object detection/tracking, etc. See all the tools and software you must install to access frames from e-con’s See3CAM cameras through OpenCV.

Working-with-See3CAM

Brief on OpenCV

Open Computer Vision (OpenCV) is an open source BSD licensed image processing bundle that contains functions for all type of image processing functionality from basic image decoding, enhancement, color space conversion, object detection, object tracking and so on. It even has capability to perform complex decision making through mathematical models like Eigen Vectors, Support Vector Machine are few.

Prerequisites

This section explains tools and software to be installed for accessing frames from See3CAM through OpenCV. Since all e-con USB cameras are UVC compatible, there needs no additional drivers to be installed.

It is always recommended to install e-con USB 3.0 camera streaming application prior to evaluating with OpenCV.

Installing e-con Systems™’ streaming application

i. For Windows – Installing eCAMView (Mandatory)

Install eCAMView received in the deliverable. Extract the package and run the setup inside windows package. This will register all required Directshow filters and e-CAMView application. Launch e-CAMView and verify whether the camera is streaming.

ii. For Linux – Installing see3camguvcview

Install see3camguvcview received in the deliverable. Follow the installation procedure specified in the document (See3CAM-GUVCView_Build_&_Install_Guide_Rev_1_8.pdf). Launch see3camguvcview and verify whether the camera is streaming.

Installing OpenCV

Download latest OpenCV for package

Refer to http://docs.opencv.org/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html for installing OpenCV on Windows and Linux.

Accessing See3CAM USB cameras through OpenCV (Common for Windows and Linux)

OpenCV has an underlying media device access layer written in Directshow for Windows and V4L2 for Linux to access all media data and information. It is easier to access camera through OpenCV with just few lines of code. OpenCV starts streaming with default supported resolution by camera.

Accessing See3CAM-USB cameras-through OpenCV

Application Layer

Underlying media framework

Code Sample

This is a sample OpenCV code that opens the first available camera device, retrieves the frame and converts to gray scale.

     #include "opencv2/video/tracking.hpp"
     #include "opencv2/imgproc/imgproc.hpp"
     #include "opencv2/highgui/highgui.hpp"
 
     #include <iostream>
     #include <ctype.h>
 
     using namespace cv;
     using namespace std;
 
    int main()
    {
    Mat CameraFrame;
    Mat Grey;
 
    VideoCapture cap;
    char keypressed;
 
    //Opens the first imaging device.
    cap.open(0);
 
    //Check whether user selected camera is opened successfully.
    if( !cap.isOpened() )
    {
    cout << "***Could not initialize capturing...***\n";
   return -1;
   }
 
   //Create a windows to display camera preview.
   namedWindow("Camera Preview", CV_WINDOW_AUTOSIZE);
   namedWindow("Camera Preview - Grayscale", CV_WINDOW_AUTOSIZE);
 
   //Loop infinitely to fetch frame from camera and display it.
   for(;;)
   {
   //Fetch frame from camera. So simple, isn't;-)
   cap >> CameraFrame;
 
   //Check whether received frame has valid pointer.
   if( CameraFrame.empty() )
   break;
 
   cvtColor(CameraFrame, Grey, CV_RGB2GRAY);
 
   //Display the received frame
   imshow("Camera Preview", CameraFrame);
   //Display the grey scale converted frame
   imshow("Camera Preview - Grayscale", Grey);
 
   //Wait for Escape keyevent to exit from loop
   keypressed = (char)waitKey(10);
   if( keypressed == 27 )
   break;
   }
 
   //Release the camera interface.
   cap.release();
 
   return 0;
   }

Screenshots

Live streaming from camera

Related posts

18 comments

Yuri Rzhanov May 16, 2016 at 11:38 pm

Hello, where can I find an example how to trigger the acquisition for See3CAM_CU30 and how to access data after that? Does it require specialized DirectShow filters?
Thanks in advance.

Reply
Anitha Jothiprakash December 21, 2016 at 6:24 pm

Hi Yuri, The still image after a trigger will be sent through the still pin of directshow source filter. You can find more information here : https://msdn.microsoft.com/en-us/library/windows/desktop/dd318622(v=vs.85).aspx

Reply
Raymond Pidor September 26, 2016 at 11:43 am

I will be processing near-infrared (NIR) images. what would be the code when converting captured NIR images to grayscale?

Reply
Anitha Jothiprakash December 21, 2016 at 6:19 pm

No specific algorithm required for NIR to grayscale conversion. It is same as in any format. Bayer demosaic (RGB888) to Monochrome (RGB8)

Reply
Trevor October 11, 2017 at 2:20 am

How can I do trigger acquisition on Linux with a See3Cam_CU135 in OpenCv

Reply
Anitha Jothiprakash October 11, 2017 at 2:45 pm

Trigger is not OS or Platform specific as in trigger mode, the frames will be output from the camera similar to free running mode (master mode) but only when external trigger pulse is received in HW. We have an application note explaining how to provide trigger pulse which explains the Hardware part of it. And we can refer QtCAM source to know how it is handled in software.

Reply
Enoch October 31, 2017 at 4:01 am

Regarding “Anitha Jothiprakash” reply on October 11, 2017.
“And we can refer QtCAM source to know how it is handled in software.”
Where can I find that source you are referring to?

Reply
Anitha Jothiprakash October 31, 2017 at 3:31 pm Reply
Carolina February 16, 2018 at 7:00 pm

Regarding Anitha reply on October 11, 2017.

Once I am using the usb camera on opencv and I grab a frame and retrieve it is in master mode. So how can I exit from it, so when I grab a frame it only sends me once I use the trigger?

Reply
Anitha Jothiprakash February 20, 2018 at 8:13 pm

We’ve forwarded your query to technical support team. They will create the support ticket for your query and provide the solution.

Reply
Hariharan May 3, 2018 at 4:02 pm

Hi,
Is there any way to show NIR Images in browser or Android Platform?

Reply
Anitha Jothiprakash May 8, 2018 at 6:41 pm

We have OV4682 – RGB-IR module for Propus running on android (https://www.e-consystems.com/tegra-k1-development-board.asp#accessories). Other combinations are also possible with lens customization, For more information please contact sales@e-consystems.com

Reply
Valentin August 10, 2018 at 2:43 pm

Hello, is it possible (and if it is, then how) to capture See3CAM_CU30 stream at lower than 60 fps (using opencv)? Ideally at 15 fps or 5 fps.

Reply
Anitha Jothiprakash August 17, 2018 at 4:01 pm

The camera does support multiple frame rates in UYVY resolutions (Though not as less as 5 fps). And Open CV doesn’t support changing frame rates by default. Please refer the resolution table available here – https://www.e-consystems.com/ar0330-lowlight-usb-cameraboard.asp to know about the frame rates supported in the See3CAM_CU30. Any frame rate required apart from the default list shall be supported through firmware customization.

Reply
behzad ehsani December 13, 2018 at 10:09 am

I need to be able to integrate this e-con camera into our system.
I need SDKs or other available methods to able control different aspects of the camera. WE use LabVIEW for development. But, if have to we will try to use what is available. Such as DLL and appropriate header files. or other form of function calls.
Please me at 408-667-8202 (USA-California) or provide me with a phone number of tech person to call

Reply
Anitha Jothiprakash December 18, 2018 at 3:09 pm

Please contact sales@e-consystems.com. One of our camera expert will get back to you shortly.

Reply
Aladdin Hijaz September 9, 2019 at 10:38 pm

is there a python package I can use to access the See3Cam_12CUNIR frames from python-opencv?

Reply
Anitha Jothiprakash September 24, 2019 at 3:00 pm

Please contact sales@e-consystems.com for Python-based OpenCV package.

Reply

Leave a Comment