Ask Your Question

BT's profile - activity

2016-04-26 06:44:50 -0500 received badge  Scholar (source)
2016-04-26 05:16:43 -0500 commented question Line segment detector crashes when no keylines found?

Thanks for the prompt answer! now, do we fight this on our own, or declare a bug? I wouldn't want to break more things :P Also (spoiler alert!) similar bugs probably exist in other descriptors, e.g. surf, but i have not confirmed it 100% yet.

2016-04-26 04:36:48 -0500 asked a question Line segment detector crashes when no keylines found?

For a particularly small .png image (i.e 200x200) which does not have any keylines, the algorith used to detect them crashes. Both cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); and LSDdet = cv::line_descriptor::LSDDetector::createLSDDetector(); detectors. I expected a more graceful behavior, if the only problem is that no keylines are detected. The code fails at line 2475 of binary_descriptor.cpp, with an

Access violation writing location 0x0000000000000000

error. The image producing the error is the following: image description Note that this is not the only image that produces the exact same error. Can someone please reproduce the problem, and confirm that it is not just mine? Is there something i missed about how to handle the descriptor, or a requirement it might have about image sizes?

Pasting a minimal example that reproduces the error here:

cv::Mat Image = cv::imread("Image filename here", CV_LOAD_IMAGE_COLOR);
 std::vector<cv::line_descriptor::KeyLine> keylines;
 Ptr<cv::line_descriptor::BinaryDescriptor> LINES = cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); 
 LINES->detect(Image, keylines);
2015-05-04 02:58:32 -0500 received badge  Teacher (source)
2015-05-04 02:56:37 -0500 received badge  Necromancer (source)
2015-05-04 02:56:37 -0500 received badge  Self-Learner (source)
2015-05-04 02:37:05 -0500 answered a question Opencv 3.0 SVM crashes for large number of iterations

As of the latest opencv version, this crash does no longer happen! (i can no longer reproduce it, though not tested exhaustively. Also, i didn't test if the accuracy of the resutls is the same, only that there is no crash issue.) Many thanks to the people who solved this problem!

2015-03-24 05:22:14 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

I have reproduced this error with various data by now, and it always depends on number of iterations. Also, in every case, libsvm is able to work properly, and so does liblinear ( but with more unstable results)

2015-02-19 07:36:05 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

Whoever can, please either help here or go to http://code.opencv.org/issues/4207 to bring attention to the issue. Thanks.

2015-02-19 06:22:12 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

Thanks a lot eitherway! Shall i post it as a bug then?

2015-02-19 05:33:25 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

if you have any first thoughts or want me to help somehow, by all means ask :) At first i thought it was a problem related to the LibSVM "cache size" parameter, but at the default value ( 100M) i have no problem in LibSVM...

2015-02-19 05:11:49 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

its constant at 10.

2015-02-19 05:05:09 -0500 received badge  Student (source)
2015-02-19 04:08:20 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

Can i possibly link you to a file (binary or xml) of my train data, if you think reproducing it will help you solve it? It's not that big, about 24198x2 of floats.

2015-02-19 03:22:45 -0500 commented question Opencv 3.0 SVM crashes for large number of iterations

Its kind of different for every problem, but the 3000 iterations in my kind of problems, will almost surely fail. Please remember that LibSVM can easily solve the same problems which seem to require ~6-8K iterations.

2015-02-19 03:21:29 -0500 received badge  Editor (source)
2015-02-19 02:47:02 -0500 asked a question Opencv 3.0 SVM crashes for large number of iterations
SVM::Params params;
params.svmType    = SVM::C_SVC;
params.kernelType = SVM::LINEAR;
params.C=10;
params.termCrit.type =TermCriteria::EPS+TermCriteria::MAX_ITER;
params.termCrit.maxCount =3000;
params.termCrit.epsilon = 0.001;
Ptr<TrainData> svm1;
Ptr<SVM> svm;
svm1= TrainData::create(Tdata2,ROW_SAMPLE,Clbl);     
svm=ml::SVM::create(params);
            svm->train(svm1,0);

This is the simplest example that fails. Works like a charm for almost all of my train data (Tdata2), except some. The error is an "Access violation writing location" error, on line 173 of svm.cpp, which is this piece of code:

 void calc_non_rbf_base( int vcount, int var_count, const float* vecs,
                        const float* another, Qfloat* results,
                        double alpha, double beta )
{
    int j, k;
    for( j = 0; j < vcount; j++ )
    {
        const float* sample = &vecs[j*var_count];
        double s = 0;
        for( k = 0; k <= var_count - 4; k += 4 )
            s += sample[k]*another[k] + sample[k+1]*another[k+1] +
            sample[k+2]*another[k+2] + sample[k+3]*another[k+3];
        for( ; k < var_count; k++ )
            s += sample[k]*another[k];
        results[j] = (Qfloat)(s*alpha + beta); // this is line 173
    }
}

The error can be reproduced with any kind of data, if it is forced to execute for a large number of iterations in order to achieve desired accuracy. However, opencv states nothing anywhere about a "maximum number of iterations".

Note that LibSVM gives me correct results on the same data with same epsilon, but it requires ~8K iterations, which then executes without a problem.

Any ideas on how to solve the problem? It is a very weird problem, since it seems as a bad programming kind of error. As a side-note, i use visual studio 2010 on win7 x64 [32gb ram]. The labels file is Clbl.jpg and the Tdata2 file is Tdata2.jpg. Don't be alarmed by the .jpg extension, just Donwload, save as, and rename to .xml and they are in the standard format that opencv is accepting! This particular dataset crashes for 2709 iterations on my machine. For 2708 its ok.