Ask Your Question

jk89's profile - activity

2013-11-18 05:04:17 -0600 commented answer ORB crashes on specific image.... how do I handle this correctly?
2013-11-15 09:26:22 -0600 received badge  Supporter (source)
2013-11-15 08:48:45 -0600 asked a question ORB crashes on specific image.... how do I handle this correctly?

My code:

#0rb test
img=cv2.imread("training_data/positives/img3348.jpg",0)
print img,type(img),img.shape,type(img[0][0])

OrbParams={"nfeatures":500,"scaleFactor":1.5,"nlevels":8,"edgeThreshold":31,"firstLevel":0,"WTA_K":2,
"scoreType":0,"patchSize":31}
ShinyMysteriousOrb=cv2.ORB(**OrbParams)

print ShinyMysteriousOrb.detectAndCompute(img,None)

Now this works fine for most images, but there is a specific one which triggers inconsistent behaviour.... Infrequently it works, mostly it crashes with either of the following errors:

  • python: malloc.c:3637: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed. Aborted (core dumped)
  • Segmentation fault (core dumped)
  • * Error in `/usr/bin/python': corrupted double-linked list: 0x0000000004814ed0 *

On that last one there are three *'s on either side... but opencv answers interprets two of these as bold. Also note that with the third error the console hangs and won't release control back to me i have to control z it.

Console vomit:

jonathan@jonathan-laptop:
[[0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 ..., 
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]] <type 'numpy.ndarray'> (240, 320) <type 'numpy.uint8'>
*** Error in `/usr/bin/python': corrupted double-linked list: 0x0000000004814ed0 ***
jonathan@jonathan-laptop:
[[0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 ..., 
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]] <type 'numpy.ndarray'> (240, 320) <type 'numpy.uint8'>
jonathan@jonathan-laptop:
[[0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 ..., 
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]] <type 'numpy.ndarray'> (240, 320) <type 'numpy.uint8'>
([<KeyPoint 0x3ecde40>, <KeyPoint 0x3ece030>, <KeyPoint 0x3ece120>, <KeyPoint 0x3ece060>, <KeyPoint 0x3ece180>, <KeyPoint 0x3ece150>, <KeyPoint 0x3ece1b0>, <KeyPoint 0x3ece1e0>, <KeyPoint 0x3ece240>, <KeyPoint 0x3ece270>, <KeyPoint 0x3ece2d0>, <KeyPoint 0x3ece7b0>, <KeyPoint 0x3ece840>, <KeyPoint 0x3eceb70>, <KeyPoint 0x3ed57e0>, <KeyPoint 0x3c1b450>, <KeyPoint 0x3976b70>, <KeyPoint 0x39768a0>, <KeyPoint 0x3976840>, <KeyPoint 0x3976a20>, <KeyPoint 0x3976870>, <KeyPoint 0x39769f0>, <KeyPoint 0x3976960>, <KeyPoint 0x3ed69f0>, <KeyPoint 0x3ed6a20>, <KeyPoint 0x3ed6a50>, <KeyPoint 0x3ed6a80>, <KeyPoint 0x3ed6ae0>, <KeyPoint 0x3ed6b10>, <KeyPoint 0x3ed6b40>, <KeyPoint 0x3ed6b70>, <KeyPoint 0x3ed6bd0>, <KeyPoint 0x3ed6c00>, <KeyPoint 0x3ed6c30>, <KeyPoint 0x3ed6c60>, <KeyPoint 0x3ed6c90>, <KeyPoint 0x3ed6cc0>, <KeyPoint 0x3ed6cf0>, <KeyPoint 0x3ed6d20>, <KeyPoint 0x3ed6d50>, <KeyPoint 0x3ed6d80>, <KeyPoint 0x3ed6db0>, <KeyPoint 0x3ed6de0>, <KeyPoint 0x3ed6e10>, <KeyPoint 0x3ed6e40>, <KeyPoint 0x3ed6e70>, <KeyPoint 0x3ed6ea0>, <KeyPoint 0x3ed6f00>, <KeyPoint 0x3ed6f60>, <KeyPoint 0x3ed6f90>, <KeyPoint 0x3ed6fc0>, <KeyPoint 0x3eda060>, <KeyPoint 0x3eda0c0>, <KeyPoint 0x3eda120>, <KeyPoint 0x3eda180>, <KeyPoint 0x3eda1b0>, <KeyPoint 0x3eda240>, <KeyPoint 0x3eda270>, <KeyPoint 0x3eda2d0>, <KeyPoint 0x3eda300>, <KeyPoint 0x3eda330>, <KeyPoint 0x3eda360>, <KeyPoint 0x3eda390>, <KeyPoint 0x3eda3c0>, <KeyPoint 0x3eda3f0>, <KeyPoint 0x3eda4b0>, <KeyPoint 0x3eda510>, <KeyPoint 0x3eda540>, <KeyPoint 0x3eda570>, <KeyPoint 0x3eda5a0>, <KeyPoint 0x3eda5d0>, <KeyPoint 0x3eda600>, <KeyPoint 0x3eda630>, <KeyPoint 0x3eda660>, <KeyPoint 0x3eda6c0>, <KeyPoint 0x3eda6f0>, <KeyPoint 0x3eda750>, <KeyPoint 0x3eda780>, <KeyPoint 0x3eda7b0>, <KeyPoint 0x3eda7e0>, <KeyPoint 0x3eda810>, <KeyPoint 0x3eda840>, <KeyPoint 0x3eda8a0>, <KeyPoint 0x3eda8d0>, <KeyPoint 0x3eda930>, <KeyPoint 0x3eda9c0>, <KeyPoint 0x3edaa50>, <KeyPoint 0x3edaa80>, <KeyPoint 0x3edaab0>, <KeyPoint 0x3edaae0>, <KeyPoint 0x3edab10>, <KeyPoint 0x3edab40>, <KeyPoint 0x3edab70>, <KeyPoint 0x3edaba0>, <KeyPoint 0x3edac00>, <KeyPoint 0x3edac60>, <KeyPoint 0x3edac90>, <KeyPoint 0x3edacc0>, <KeyPoint 0x3edad80>, <KeyPoint 0x3edadb0 ...
(more)
2013-10-25 10:06:07 -0600 commented answer Pickle background subtractor

I've notice that there is a getbackgroundimage function on some of these subtractors which outputs the background model as an image. However I cannot seem to find a setbackgroundimage function. I guess it is not going to be possible without implementing my own custom subtractor where I have to persist its state myself . Thanks for your answer.

2013-10-25 04:26:35 -0600 received badge  Scholar (source)
2013-10-24 12:08:29 -0600 asked a question Pickle background subtractor

Hi!

I am wondering... is it possible to pickle/serialize/store some how a subtractor object? I have a program which has a mode where it handles one frame and then quits... Seeing that the subtractor I'm using (mog) learn's it would seem like a waste to throw it away on exit. Could it be pickled for future use?