Ask Your Question

Kislay's profile - activity

2017-01-29 16:18:12 -0600 received badge  Famous Question (source)
2016-04-14 03:16:43 -0600 received badge  Notable Question (source)
2015-10-05 06:41:20 -0600 received badge  Popular Question (source)
2014-08-02 22:48:35 -0600 asked a question Memory Leak in CvTrainTestSplit

the csv file I am working on is this . Below is my code:

int main() {

CvMLData mlData;
mlData.read_csv("car.data");

Mat temp = mlData.get_values();
cout<<temp<<endl;
int numfeatures = temp.cols-1;
mlData.set_response_idx(numfeatures); 

CvTrainTestSplit spl((float)0.5, true);
mlData.set_train_test_split(&spl);

return 0;

}

This program compiles and run fine. But when I run valgrind on it, I get the following output:

==27065== HEAP SUMMARY:

==27065== in use at exit: 6,944 bytes in 2 blocks

==27065== total heap usage: 9,702 allocs, 9,700 frees, 1,415,503 bytes allocated

==27065==

==27065== 6,936 bytes in 1 blocks are definitely lost in loss record 2 of 2

==27065== at 0x4C2C857: malloc (vg_replace_malloc.c:291)

==27065== by 0x4F06B80: cv::fastMalloc(unsigned long) (in usr/local/lib/libopencv_core.so.2.4.9)

==27065== by 0x52CA8B2: CvMLData::set_train_test_split(CvTrainTestSplit const*) (in /usr/local/lib/libopencv_ml.so.2.4.9)

==27065== by 0x400CD4: main (knn_doubt.cpp:21)

==27065==

==27065== LEAK SUMMARY:

==27065== definitely lost: 6,936 bytes in 1 blocks

==27065== indirectly lost: 0 bytes in 0 blocks

==27065== possibly lost: 0 bytes in 0 blocks

==27065== still reachable: 8 bytes in 1 blocks

==27065== suppressed: 0 bytes in 0 blocks

==27065== Reachable blocks (those to which a pointer was found) are not shown.

==27065== To see them, rerun with: --leak-check=full --show-leak-kinds=all

==27065==

==27065== For counts of detected and suppressed errors, rerun with: -v

==27065== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

The line number 21(the one marked in bold above) is where valgrind says it has detected a memory leak. I have no clue what causes this and how to get it away. Please shed some light over this!

2014-08-02 21:58:20 -0600 answered a question License plates

I recently worked on this problem in OpenCV python. You can get it here. I have used Shogun toolbox for machine Learning purpose but you can always stick to the OpenCV's own ML class.

2014-07-09 03:24:43 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

Hey @berak. I removed all the builds. Re-installed 2.4.9. Instead of cv2.boxPoints().... I used cv2.cv.BoxPoints() and SUCCESS!!!! It's working like a charm

2014-07-09 03:20:40 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

yeah. By now I have tried the OpenCV 3.0 (as mentioned in the question). In that I was getting the error:"Too many values to unpack". Then I tried the master Now, which breaks even before that. I am doing mkdir build & cd build & cmake .. & make -j7 & sudo make install.

I still have a feeling that 2.4.9 should run this. It is there in its source code and Vim auto-completes it.

2014-07-09 02:56:02 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

Hey @berak. I tried the master. But now the code breaks even before that. Please check this http://pastebin.com/UCw4Xf32 . Earlier this code was breaking at boxPoints() but now it breaks even before that!!

2014-07-09 02:05:03 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

Hmm... I knew something like this would happen. Thats why I cloned the latest development repo too from Github. Let me build it! That should do, right?

2014-07-09 01:56:25 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9
2014-07-09 01:48:47 -0600 commented question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

cv2.drawContours(carsample, contours, -1, (0,255,0), 3)

cv2.imshow("contoured image", carsample)

for i in contours: rect=cv2.minAreaRect(i)

box=cv2.boxPoints(rect)

box=np.int0(box)

cv2.drawContours(carsample, [box], 0, (0,0,255),2)

cv2.waitKey(0)

cv2.destroyAllWindows()

This when run, shows the contoured image correctly. But after that I get this: box=cv2.boxPoints(rect)

AttributeError: 'module' object has no attribute 'boxPoints'

2014-07-09 01:29:34 -0600 asked a question AttributeError: 'module' object has no attribute 'boxPoints' in 2.4.9

There has been a previous question asked here (http://answers.opencv.org/question/32183/cv2boxpoints-used-in-tutorials-does-not-exist-in/) but I couldn't get the solution working in my case.

I am trying to use cv2.boxPoints() in python. I am pretty sure OpenCV 2.4.9 does have this method as I compared the files changed in the following pull-request ( https://github.com/Itseez/opencv/pull/1041/commits) regarding the boxPoints and I find all the code rightly placed. Even so, my Vim editor also auto-completes the cv2.boxPoints() method.

But it throws the same error again and again.I have tried using OpenCV 3.0 technical preview too, but it has not helped. If there's anyway in which I can correct this in the current 2.4.9 installed in my system?