Ask Your Question

Julius's profile - activity

2019-06-08 16:04:37 -0600 received badge  Notable Question (source)
2018-10-17 07:24:29 -0600 received badge  Popular Question (source)
2017-03-28 01:28:59 -0600 asked a question TrainCascade: Choise of parameters and positive image

Hello, ​

I want to detect an pen and I used juliu5.com/full.jpg as the positive image. To generate a few hundred positives I used these github.com/handaga/tutorial-haartraining/tree/master/data/negatives and this command.

opencv_createsamples.exe -info C:\TrainingMarker\positives\positives.txt  -bg C:\NegativeImages\negatives\bg.txt -img C:\TrainingMarker\images\full.jpg -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -bgcolor 255 -bgthresh 8 -num 1000 -w 132 -h 30

For the -w and -h parameters I divided the with and height of my original positive image. Now I have 1000 positives and 2000 negatives so I am ready to train the classifier. (Linux Server)

opencv_traincascade -data TrainingMarker/cascade/ -vec TrainingMarker/objects.vec -bg NegativeImages/negatives/bg.txt -numStages 20 -numPos 1000 -numNeg 2000 -w 132 -h 30 -featureType LBP -minHitRate 0.995 -maxFalseAlarmRate 0.5

However in each Stage there are 3 lines (trained features?) max and my tracking results are really bad...

I am still confused by the -w and -h parameters although I read several explanations within the forum. Are my parameters alright? When I was using -featureType HOG I got about 8 lines of features in each Stage. However this Type is not supported in OpenCV > 3.0.

Is my test object just not detailed enough?

Thank you really much for your help!

2017-03-14 02:09:50 -0600 received badge  Enthusiast
2017-03-09 06:13:19 -0600 commented question findContours: Assertion failed

Just to make sure: Additional Library Directories: build/lib/Debug (directory contains several libs) and Additional Dependencies: *d.lib files that are present in build/lib/Debug?

Alright, I forgot to use INSTALL for Debug in the VS Solution... Thank you!

2017-03-09 05:48:26 -0600 commented question findContours: Assertion failed

Thank you for your input. So for debug purposes I should use the libs ending with "d", right? However in this path: "build\install\x64\vc15\lib" there aren't those files. I guess I should use the files from build\lib\Debug and build\lib\Release?

2017-03-09 04:34:18 -0600 asked a question findContours: Assertion failed

Hi, I am using the latest OpenCV 3 Version with Visual Studio 2017. x64, Compiled using CMake and opencv_contrib.

My program crashes when I call findContours. I saw that some people have problemes with this function, but I wasn't able to fix my problem with theire solutions... Hopefully I did something wrong with my Includes etc...

C/C++ -> General-> Additional Include Directories: build\install\include

Linker -> General -> Additional Library Directories: build\install\x64\vc15\lib

Linker -> Input -> Additional Dependencies: everything from the directorie above

Exception:

include\xmemory0

template<class _alloc,="" class="" _ptr="typename" _wrap_alloc<_alloc="">::pointer> inline
    void _Destroy_range1(_Ptr _First, _Ptr _Last, _Wrap_alloc<_Alloc>& _Al, false_type)
    {   // destroy [_First, _Last), no special optimization
    for (; _First != _Last; ++_First)
        _Al.destroy(_Unfancy(_First)); //Exception thrown: read access violation.

    }

Call Stack

opencv_core320.dll!std::_Destroy_range1<std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > >,std::vector<unsigned char,std::allocator<unsigned="" char=""> > * __ptr64>(std::vector<unsigned char,std::allocator<unsigned="" char=""> > * _First, std::vector<unsigned char,std::allocator<unsigned="" char=""> > * _Last, std::_Wrap_alloc<std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > > > & _Al, std::integral_constant<bool,0> __formal) Line 1201  C++
[Inline Frame] opencv_core320.dll!std::_Destroy_range(std::vector<unsigned char,std::allocator<unsigned="" char=""> > *) Line 1218 C++
[Inline Frame] opencv_core320.dll!std::vector<std::vector<unsigned char,std::allocator<unsigned="" char=""> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > > >::_Destroy(std::vector<unsigned char,std::allocator<unsigned="" char=""> > *) Line 1885 C++
opencv_core320.dll!std::vector<std::vector<unsigned char,std::allocator<unsigned="" char=""> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > > >::_Resize<<lambda_b962d82acf8d40dd69d8706383060581> >(const unsigned __int64 _Newsize, std::vector<std::vector<unsigned char,std::allocator<unsigned="" char=""> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > > >::resize::__l2::<lambda_b962d82acf8d40dd69d8706383060581> _Udefault_or_fill) Line 1484 C++
[Inline Frame] opencv_core320.dll!std::vector<std::vector<unsigned char,std::allocator<unsigned="" char=""> >,std::allocator<std::vector<unsigned char,std::allocator<unsigned="" char=""> > > >::resize(const unsigned __int64) Line 1496 C++
opencv_core320.dll!cv::_OutputArray::create(int d, const int * sizes, int mtype, int i, bool allowTransposed, int fixedDepthMask) Line 2421 C++
opencv_core320.dll!cv::_OutputArray::create(int _rows, int _cols, int mtype, int i, bool allowTransposed, int fixedDepthMask) Line 2322 C++
opencv_imgproc320.dll!cv::findContours(const cv::_InputOutputArray & _image, const cv::_OutputArray & _contours, const cv::_OutputArray & _hierarchy, int mode, int method, cv::Point_<int> offset) Line 1922 C++
Tracker.exe!getMainContour(cv::Mat mask) Line 33 C++

Thank you really much for your help! Greetings!

2017-03-06 08:01:27 -0600 commented question g_object_set: assertion 'G_IS_OBJECT (object)' failed

You are right, I am using gstreamer. I installed some additional plugins and now I get an other error:

GStreamer Plugin: Embedded video playback halted; module avidemux0 reported: Could not demultiplex stream.
OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /usr/src/ports/opencv/opencv-2.4.11-1.x86_64/src/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp, line 773

Webm Format is working fine...The error message is still cryptic to me :/

2017-03-06 07:39:48 -0600 asked a question g_object_set: assertion 'G_IS_OBJECT (object)' failed

Hello, I am using OpenCV (2.4.11) on Windows (Cygwin). I want to open a video file but I get this error message:

GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

Editing images works great, so my installation in general should be fine. Maybe I am missing a Codec? My code looks like this:

VideoCapture cap(argv[1]);
if(cap.grab()){
    cout<<"success"<<endl;
}


./test.exe video.avi

I already searched for a solution, but I didn't found any useful ideas... Thank you for your help!