Ask Your Question

Brixus's profile - activity

2018-12-04 16:23:34 -0500 received badge  Popular Question (source)
2018-03-02 01:53:14 -0500 received badge  Famous Question (source)
2017-08-09 13:08:13 -0500 received badge  Notable Question (source)
2017-03-28 08:59:31 -0500 received badge  Popular Question (source)
2015-04-13 09:24:31 -0500 received badge  Famous Question (source)
2014-11-06 06:08:38 -0500 commented answer How to use a camera to get single frames?

Thank you :-)

2014-11-05 16:52:36 -0500 asked a question How to use a camera to get single frames?

Hi,

I would like to use my webcam as a photo camera.

I would like to have a function like "Mat GetOneFrame();" which I can call in short distances to deliver just one up to date frame.

This is my try:

void TakeOneFrame()
{
    namedWindow("Video");
    namedWindow("Picture");
    Mat frame;
    Mat picture;

    VideoCapture cap (0);
    for(int i=0; i<=2;i++)
       {
        if(char(waitKey(1)) != 'q' &&cap.isOpened())
            {cap.operator >>(frame);}
        frame.copyTo(picture);
        imshow("Video", frame);
       }
    cap.release();


   while(1)
    {
        imshow("Picture",picture);
    }
}

I found out, that I need to grab a few frames until there is one sharp one. The Video window produces the desired frame, but when the window "Picture" opens up, there is no image showing. Even if I chance the position of frame.copyTo(picture); this makes no change.

Why is that and is there a better solution for my problem?

Thank you very much :-)

2014-11-05 16:37:49 -0500 commented answer How to put colors over a 1 channel gray image?

Thanks, this works, but is to much work ;-) I just needed to convert my image as FooBar stated and then I used drawContours on that :-)

2014-10-31 06:16:56 -0500 commented answer How to put colors over a 1 channel gray image?

Thank you very much. :-) Sometimes one does not see all the trees because of the forest ;-)

2014-10-31 05:21:55 -0500 asked a question How to put colors over a 1 channel gray image?

Hello,

I have a grayscale image (CV_8UC1) and I use findContours to identify contours. These contours I would like to draw colored into the grayscale image.

I tried to merge two empty Mats(CV_8UC1) together with the grayscale image and this works not really well. So I have my wished colors, but the original image is blue, red or green depending on the merged channel position.

How can I achieve the grayscale image staying gray with having colored contoures on top?

Thank you very much :-)

2014-08-22 17:43:21 -0500 received badge  Notable Question (source)
2014-08-07 10:33:08 -0500 asked a question OpenCv on Raspberry shows no images and gives no errors

Hi,

I just installed OpenCV on a RaspberryPi.

I tried the tutorial given here: http://docs.opencv.org/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html#linux-gcc-usage

Futhermore I compiled this code also with QMake and added some console outputs.

I get no errors and the console outputs are working, but in general there shows no picuture or even a frame up when I run the executable file.

Do you have any idea why it is like this and how to solve it?

Thank you very much :-)

2014-07-10 10:02:15 -0500 commented question Usage of createTrackbar for QT control panel possible?

No, I am using Ubuntu.

The error is: "terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid"

If it is really a linker problem, how can I solve it? I use OpenCV a lot with the C++ functions and there are no other errors.

2014-07-10 07:16:35 -0500 asked a question Usage of createTrackbar for QT control panel possible?

Hello,

I would like to use the function "createTrackbar" for creating a trackbar on the QT control panel.

The info about this feature you can find here: http://docs.opencv.org/modules/highgui/doc/qt_new_functions.html

If I use "cvCreateTrackbar" with NULL as window everything works fine but with createTrackbar it ist not working.

Has anybody an idea how to fix this?

This is a working minimal:

#include "opencv2/core/core.hpp"
#include <opencv2/highgui/highgui.hpp>

using namespace cv;    

const int slider_1_max  = 255;
      int slider_1 = 0;
const int slider_2_max  = 255;
      int slider_2 = 0;

Mat test;


void on_trackbar_1(int pos)
{
pos=slider_1;    
}

void on_trackbar_2(int pos, void*)
{    
}


int main ()
{
    namedWindow("Test");

     cvCreateTrackbar("One",NULL, &slider_1,slider_1_max, on_trackbar_1);

     //Not working:
     //createTrackbar("Two",NULL, &slider_2,slider_2_max, on_trackbar_2);


 while (char(waitKey(1)) != 'q'){}
 return 0;
}

Thank you very much :-)

2014-07-05 09:59:13 -0500 commented question How to access points from convexHull-vector?

Thank you very much :-)

2014-07-05 08:32:26 -0500 asked a question How to access points from convexHull-vector?

Hello,

I use the function "convexHull" and I would like to know how I can access every vector point of a convex hull object.

For example I use this code:

              /// Find the convex hull object for each contour  
                 vector<vector<Point> >hull( contours_vec.size() );
                 for( int i = 0; i < contours_vec.size(); i++ )
                    {  convexHull( Mat(contours_vec[i]), hull[i], false ); }

              /// Draw contours + hull results Mat
                 Mat drawing = Mat::zeros( Dilated.size(), CV_8UC3 );  
                 for( int i = 0; i< contours_vec.size(); i++ )
                    {
                      Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
                      drawContours( drawing, contours_vec, i, color, 1, 8, vector<Vec4i>(), 0, Point() );
                      drawContours( drawing, hull, i, color, 1, 8, vector<Vec4i>(), 0, Point() );

If I now use "cout << hull[i] << endl;" I get something like this for every contour:

[812,176; 810,182; 805,190; 812, 173].

How can I access just for example the point 805, 190?

I tried hull[i].something, but it did not work.

Thank you very much. :-)

2014-07-05 08:14:23 -0500 received badge  Scholar (source)
2014-07-05 08:14:01 -0500 commented answer cvtColor RGB to HSV, different look???

Thank you very much. This sounds logical :-)

2014-06-03 08:25:07 -0500 received badge  Self-Learner (source)
2014-05-16 09:48:06 -0500 received badge  Popular Question (source)
2014-05-03 20:36:11 -0500 received badge  Student (source)
2014-04-12 14:03:34 -0500 asked a question Artefacts while copying pixelvalues

Hi everybody, I would like to blend pictures manually using a loop. In detail I want to copy the white pixels from a binary image (0==black, 255==white, not other values possible) to a new Picture which is at the beginning a Mat just including black pixels.

My code works fine if I use a Mat created with white pixels. But if I use my binary images I load into OpenCV I get artefacts. I cannot understand why this is happening. If I look in the source image in OpenCV the pixels have just 0 or 255, but if I vary with the thresholdvalue I get different Artefacts.

Normaly intensity >=1 should work well, but If I use for example 100 I get still differend artefacts.

This is the code I use:

#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace std;
using namespace cv;

void Vblend(Mat src, Mat blend)
 {   int colu, row;
     int intensity;
     for (row=0; row<=480; row++)
     {
         for (colu=0; colu<=640; colu++)
         {
             intensity = src.at<uchar>(row, colu);
             if(intensity >=1) {blend.at<uchar>(row, colu)=255;}
         }
     }
 }


int main()
{
   Mat src= imread("pic.jpg",CV_LOAD_IMAGE_GRAYSCALE);
   Mat blend(480,640,CV_8UC1,Scalar(0));

    namedWindow("src");
    namedWindow("blend");

   Vblend(src,blend);

   imshow("src", src);
   imshow("blend",blend);
   while(char(waitKey(1)) != 'q') {}
   return 0;
}

In this picture you can see the original on the left and the artefacts on the right.

blend.PNG

How can I eliminate the artefacts?

Thank you very much for your help :-)

2014-03-31 03:25:44 -0500 asked a question Bad argument in cvMeanShift (Input window neg. size)

Hello,

I try to get familiar with OpenCV. Therefore I am playing with the Camshift demo included in the documentation.

I would like to improve the code thats if the tracked object leaves the window I dont get an error. The goal is that a tracked object leaves the window and that the tracking stopps until the object is present again in the window.

Sadly I don't habe any idea how to solve this as I am a beginner in OpenCV.

At the moment I get the following error if the object leaves the window:

"Bad Argument (Input window has non-positive sizes) in cvMeanShift, camshift.cpp, line 8."

Has anybody an idea how to solve this problem?

Thank you very much :-)

2014-03-29 08:08:39 -0500 asked a question cvtColor RGB to HSV, different look???

Hello, I would like to convert a stream from my webcam to HSV colorspace.

Therefore I used cvtColor in the following code:

int main()
{
VideoCapture cap(0);
if(!cap.isOpened())
{
cout << "Capture could not be opened succesfully" << endl;
return -1;
}
namedWindow("RGB");
namedWindow("HSV");

while(char(waitKey(1)) != 'q' && cap.isOpened())
{
Mat frame, frame_hsv;
cap >> frame;
cvtColor(frame, frame_hsv, CV_RGB2HSV);

imshow("RGB", frame);
imshow("HSV", frame_hsv);

}
return 0;
}

First I am wondering because if I change CV_RGB2HSV to CV_BGR2HSV there is no difference in the shown images.

In the attached file you can see the output.

Why are the colors in the new "HSV-image" wrong? And what can I do to solve this?

I thougt cvtColor would calculate the matching colors for the new color space.

Thank you :-)

RGBtoHSV.PNG

2013-10-24 06:43:27 -0500 answered a question How to set the path to QT5 in cmake?

Thank you very much.

Your answer gave me the right hint.

Qt5 was not installed correct. On Ubuntu it is not enough to use the Qt installer.

This guide here solved my problems: Guide

Ater this I could install OpenCv without problems. :)

2013-10-21 16:06:17 -0500 commented answer How to set the path to QT5 in cmake?

Thank you very very much :-) I forgot to tell that I use Linux, my fault. Sorry for this :-/

2013-10-21 12:37:13 -0500 asked a question How to set the path to QT5 in cmake?

Hello,

I am not able to install OpenCV 2.4.6.1 properly. Poorly Cmake does not find the QT stuff and I get the following warning:

"CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Gui" with any of the following names:

Qt5GuiConfig.cmake
qt5gui-config.cmake"

I know the correct path to this things, but I do not know how to tell it Cmake. Also with google I found no solution.

This is the normal command I use: cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

How can I add the path to the Qt sources or is there another solution?

Thank you very much :)

2013-10-21 06:15:03 -0500 received badge  Editor (source)
2013-10-20 05:25:53 -0500 commented answer Debugging error in Visual Studio 11 Win8 X64

Thanks for the answers. I just saw them now. I switched to linux ;-)

2013-10-20 05:24:32 -0500 asked a question OpenCV 2.4.6 on Ubuntu 13.04 with QT shows no images

Hi everybody,

I installed OpenCV 2.4.6 on Ubuntu 13.04 using this guide on two computers: Guide

On one computer everything worked fine (Ubuntu on VMware). But with the second computer I have a big problem.

Is is a computer just using Ubuntu without a virtual machine.

I installed OpenCv but its not working properly.

If I try to open a video stream or to open an image OpenCV resp. QT produces no error, opens a command line but no video or image shows up.

I think OpenCV is working, because if I try to load a picture with a wrong path it tells me that the path is wrong, as I have programmed it to tell me. And with the right path the image resp. the video or whatever does not show up.

My nerves are quite frayed. What can I try to solve the problem?

Thank you very much!

Edit: Now I noticed that Cmake is producing a lot of warnings, but no errors.

Could somebody please check my Cmake protocol?

Thanks a lot :)


desktop:~/Downloads/opencv-2.4.6.1/build$ cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON .. -- Detected version of GNU GCC: 47 (407) -- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Core" with any of the following names:

Qt5CoreConfig.cmake
qt5core-config.cmake

Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:397 (include)

CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Gui" with any of the following names:

Qt5GuiConfig.cmake
qt5gui-config.cmake

Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:397 (include)

CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with any of the following names:

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a ... (more)

2013-08-05 03:56:56 -0500 commented answer Debugging error in Visual Studio 11 Win8 X64

Thanks, but in the linker options for debugging everything has got the "d", but it is still not working. I guess its a problem with .dll files, but I dont know.

He just says Programpath\Progname.exe cannot be started. Unknown Mistake in Framework of Windows-Webservices"

Maybe the first part of the error which I forgot to mention earlier os also important ;) Thanks!

2013-08-04 11:19:36 -0500 commented answer Debugging error in Visual Studio 11 Win8 X64

Thank you very much for your answer.

I tried a lot of different guides and ended up with this guide: http://4someonehelp.blogspot.in/2013/06/solved-install-opencv-245-using-visual.html I replaced 245 with 246 in the .lib files to make it compatible.

Your suggestion was quiet good. I changed the dir and OpenCV is still creating working .exe files, but in Debug-Mode I get still the same error as mentioned above.

2013-08-04 10:13:21 -0500 asked a question Debugging error in Visual Studio 11 Win8 X64

Hi everyone,

I am a complete beginner with programming and OpenCV. I managed to install OpenCV 2.4.6. on Win 8 x64 with Visual Studio 11 and it took me round about 10 hours ;)

If I tried to compile a project in ReleaseMode I could not start the .exe because of a missing .dll. But the correct path is added to the systems variables! Than I just copied the dlls to the Windows Systems folder and now the release .exe works.

But if I try to run OpenCV-Code in VS in Debug Mode I get an error. Freely translated it just says:"Unknown Mistake in Framework of Windows-Webservices".

What can I do to solve this problem?

Sorry for my bad english and thank you very much :-)