Ask Your Question

AR0x7E7's profile - activity

2020-07-08 05:19:53 -0600 received badge  Notable Question (source)
2018-04-22 03:05:56 -0600 received badge  Notable Question (source)
2017-03-20 21:47:47 -0600 received badge  Popular Question (source)
2017-02-17 21:07:17 -0600 received badge  Taxonomist
2016-08-02 01:53:08 -0600 received badge  Popular Question (source)
2015-04-10 07:21:12 -0600 received badge  Student (source)
2014-09-08 13:49:54 -0600 received badge  Nice Answer (source)
2014-06-25 05:55:27 -0600 asked a question Opencv 2.4.9 Videcapture 2 Two Multi PS3 Eye: cam selection error

Hello everybody,

using Opencv 2.4.9 on Windows 7 64 bit in combination with two Sony PS3 Eye Multi Webcams it seems like Opencv has problems to access both cams.

Clearly I installed Code Laboratories latest CL Eye Platform Driver and CL Eye Platform SDK.


USING CL Eye Platform

Running the provided CLEyeMulticamTest.exe both cams work flawlessly (see screenshot attached).

image description


USING OPENCV

However, using following simple OpenCV example it turns out only one PS3 Eye can be selected (see screenshot attached).

int main(int nargs, char** argv)
{
int id = std::stoi(argv[1]);

cv::VideoCapture cap(id); // open passed cam id
if(!cap.isOpened())  // check if we succeeded
    return -1;

cv::Mat edges;
cv::namedWindow("edges",1);
for(;;)
{
    cv::Mat frame;
    cap >> frame; // get a new frame from camera
    cvtColor(frame, edges, CV_BGR2GRAY);
    GaussianBlur(edges, edges, cv::Size(7,7), 1.5, 1.5);
    Canny(edges, edges, 0, 30, 3);
    imshow("edges", edges);
    if(cv::waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;

image description


USING OPENCV with two diffrent cams

When I plug in another Webcam (Logitech) Opencv can access both of them: image description


USB Hub Config

To make things clear I also made sure to identify USB Ports connected to different controllers (I read something about 100% bandwidth usage of a single cam leading to problems using more cams on same usb hub)

image description


the final question is

So can somebody qualified tell me whether this behavior is the current state of things when it comes to use OpenCV with two PS3 Eye Cams or is there some neath trick left?

I understand that using CL SDK I will be able to utilize both cameras. However, it would be nice to use OpenCV as a wrapper instead ;).

Kind regards AR

2014-05-05 14:55:25 -0600 received badge  Teacher (source)
2014-05-04 07:05:47 -0600 answered a question OpenCV move to begin frame position fail

For me its working (remember videos are 0-based indexed):

using namespace std;
using namespace cv;


int main() {
    VideoCapture cap("test.mp4");
    if( !cap.isOpened()){
        cout << "Cannot open the video file" << endl;
        return -1;
    }

int count = (int) cap.get(CV_CAP_PROP_FRAME_COUNT); //get total frame count
cout<< "Max frames: "<< count << endl;

Mat frame;
int index = 0;
while(cap.read(frame))
{
    cout << "the current frame: " << index << endl;
    index++;
}
cout << "exit first loop" << endl;
cap.set(CV_CAP_PROP_POS_FRAMES, 0); //Set index to 0 (start frame)
int index2 = 0;
while(cap.read(frame))
{
    cout << "the current frame: " << index2 << endl;
    index2++;
}
cout << "exit second loop" << endl;
cout << "index1: "<< index << " / index2: "<< index2 <<endl;
}

Output (see attached mp4 file C:\fakepath\test.mp4.jpg for own test, rename it to .mp4 ;-) ):

Max frames: 145
..
index1: 145 / index2: 145
2014-05-04 06:35:22 -0600 answered a question How to determine the image format ?

Note: I don't use Java in combination wit opencv, but it should work like this:

If the procedure you described really is in the same method scope you could simply extract the letters behind the last '.' of the path from the image path you pass to _imread_ - i.e. 'jpg' from "h:\opencv.jpg" - and then pass it on to _imencode_

For this to work you need to save the path of the image loaded, i.e.

String image_in = "h:/opencv.jpg";
Mat image = Highgui.imread(image_in);

Later you use i.e. String.split function

String[] image_in_splits = image_in.split(".");
String fileFormat = image_in_splits[image_in_splits.length - 1];
2014-05-03 09:48:13 -0600 received badge  Citizen Patrol (source)
2014-05-03 09:38:26 -0600 commented question Intensity value based tracking

sorry, but I don't think that I understand your question properly: do you want to draw a rectangle _around a pixel of certain value_ or around an _object_? It the latter one, how do you get/define that _object_?

2014-05-03 02:36:51 -0600 received badge  Self-Learner (source)
2014-05-03 02:15:10 -0600 commented question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

StevenPuttemans, can you please accept the answer below and close the question? I lack sufficient reputation ;D Of course you can check my solution first.

2014-05-03 02:13:07 -0600 answered a question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

In order to deactivate the right click context menu using opencv 2.4.9 namedWindow with Qt 5.2.1 search for file:

opencv\sources\modules\highgui\src\window_QT.cpp

find the following function (usually line 2514):

void DefaultViewPort::contextMenuEvent(QContextMenuEvent* evnt)
{
    if (centralWidget->vect_QActions.size() > 0)
    {
        QMenu menu(this);

        foreach (QAction *a, centralWidget->vect_QActions)
            menu.addAction(a);

        menu.exec(evnt->globalPos());
    }
}

set it to (alternatively just comment the inside of function):

void DefaultViewPort::contextMenuEvent(QContextMenuEvent* evnt)
{
    return;
}

recompile opencv, done.

2014-05-01 09:37:40 -0600 received badge  Supporter (source)
2014-05-01 09:33:28 -0600 answered a question Visual studio 10 and openCV ?

looks like your setup for "Additional Include Directories" at "Configuration Properties -> C/C++ -> General" is wrong - more information needed: what's your current PATH, where is your opencv directory?

I.e. my setup (Win7 64 bit, VS2012, opencv 2.4.9):

"Additional Include Directories": $(OPENCV_DIR)\include

Win7 System Variables:

OPENCV_DIR: C:\opencv\build PATH: %OPENCV_DIR%\bin;

You should not copy paths from tutorials blindly, but refactor them to your own system. Look out for '\' use everywhere instead of '/'.

2014-05-01 09:17:31 -0600 commented answer How to handle mouse wheel event in OpenCV?

Sorry, but how should the while loop ever terminate? I dont think this can work, as the loop exit condition will never be satisfied

2014-05-01 08:12:54 -0600 commented question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

so I found the appropriate part of code to comment =) Unfortunately, I have to wait until tomorrow until I can answer my own question :D

2014-05-01 04:47:59 -0600 commented question OpenCV Error: OpenGL API call (Can't load OpenGL extension [glBindBuffer]) in IntGetProcAddress, file sources\modules\core\src\gl_core_3_1.cpp, line 146

Hi wuling and thanks for your reply, while it would be surprising for me to see your suggestion work, I still gave it a try and disabled Cmake OpenGL (see Updated setup of mine with qt-opensource-windows-x86-msvc2010_opengl-5.2.1.exe) However, at runtime: OpenCV Error: No OpenGL support (Library was built without OpenGL support) ..

2014-05-01 04:34:02 -0600 received badge  Editor (source)
2014-05-01 02:53:32 -0600 commented question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

Yes, this might be plan B - however, I'm a programmer, this whole software is open source, so In my opinion it has to be possible and it might just be a few loc in need to be commented (i.e. the switch statement which handles the mousrightbuttonclick event triggering the context menu to appear) and my mission will be accomplished :P

2014-05-01 02:49:07 -0600 commented question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

Hi StevenPuttermans and thanks for your reply, unfortunately I'm in need of the Qt enhanced GUI functionalities (like resize window, zoom in/out, take picture). Therefore, building opencv with qt is a must.

2014-04-30 16:09:09 -0600 asked a question Opencv 2.4.9 highgui +qt: howto disable menu (right click context)

Hello all,

I'm looking for a way to disable the context menu when right clicking on namedWindow (see http://docs.opencv.org/modules/highgui/doc/qt_new_functions.html for clarification)

The reason is, I want to use the right mouse button for some user interaction but the menu keeps popping up and is therefore disturbing havily.

I also tried to identifiy the part of opencv source code (QT_window.cpp) where the callback function with rightbuttonup is set - as you might guess, unsuccessfully.

Thank you for any help.

Kind regards AR

2014-04-25 03:51:25 -0600 asked a question OpenCV Error: OpenGL API call (Can't load OpenGL extension [glBindBuffer]) in IntGetProcAddress, file sources\modules\core\src\gl_core_3_1.cpp, line 146

Hello all (see update below),

my spec:

Newest CMake 2.8.12.2, with config:

Checking for Windows Platform SDK
Checking for Visual Studio 2012
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 

General configuration for OpenCV 2.4.9 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       2.8.12.2
    CMake generator:             Visual Studio 11
    CMake build tool:            C:/PROGRA~2/MICROS~1.0/Common7/IDE/devenv.com
    MSVC:                        1700

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe  (ver 17.0.61030.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /MD /O2 /Ob2 /D NDEBUG  /Zi
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /arch:SSE2 /Oi /fp:fast  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:X86   /INCREMENTAL:NO  /debug
    Linker flags (Debug):        /machine:X86   /debug /INCREMENTAL 
    Precompiled headers:         YES

  OpenCV modules:
    To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu nonfree contrib stitching superres ts videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 androidcamera dynamicuda java ocl python viz

  Windows RT support:            NO

  GUI: 
    QT 5.x:                      YES (ver 5.2.1)
    QT OpenGL support:           YES (Qt5::OpenGL 5.2.1)
    OpenGL support:              YES (glu32 opengl32)
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.7)
    JPEG:                        build (ver 62)
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   NO
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 55.18.102)
      format:                    YES (ver 55.12.100)
      util:                      YES (ver 52.38.100)
      swscale:                   YES (ver 2.3.100)
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            NO
    XIMEA:                       NO
    Intel PerC:                  NO

  Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   NO
    Use TBB:                     NO
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              YES
    Use C=:                      NO
    Use Cuda:                    NO
    Use OpenCL:                  NO

  Python:
    Interpreter:                 C:/Program Files (x86)/Python27/python.exe (ver ...
(more)