Peenoo / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

cvUpdateBGStatModel crashes #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

Hope you are doing well.
Yes it now gets past creating the model..
Unfortunately, I get a crash now in cvUpdateBGStatModel (see below).  As I said 
previously I'm just trying to port over the bgfg_segm.c from the samples.  
Hopefully, I'm not out of sync somewhere.  I do not want to be wasting your 
time.  

I can successfully run the bgfg_segm.c sample from an ecllipse cpp debugger.  
Is there anything I can do to help? 
Below the code is a thread stack dump of the crash.

Regards,
Greg.

           CvGaussBGStatModelParams params = new CvGaussBGStatModelParams();                

            params.win_size=2;  
            params.n_gauss=5;
            params.bg_threshold=0.7;
            params.std_threshold=3.5;
            params.minArea=15;
            params.weight_init=0.05;
            params.variance_init=30; 

            bg_model = v21.cvCreateGaussianBGModel( grey, null ); 
            //bg_model = cvCreateFGDStatModel( temp );
        }

        v21.cvUpdateBGStatModel(image, bg_model, update_bg_model ? -1 : 0);

Thread Stack @ cvUpdateBGStatModel

Current thread (0x997d3c00):  JavaThread "Thread-4" [_thread_in_native, 
id=11408, stack(0x05d0f000,0x05d60000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=2 (SEGV_ACCERR), 
si_addr=0x99572014

Registers:
EAX=0x00000003, EBX=0x026a1988, ECX=0x99572010, EDX=0x00000001
ESP=0x05d5e5b0, EBP=0x00000005, ESI=0x99571f01, EDI=0x99571fb0
EIP=0x02605dd0, CR2=0x99572014, EFLAGS=0x00010206

Top of Stack: (sp=0x05d5e5b0)
0x05d5e5b0:   3d4ccccd 00000000 00000000 00000000
0x05d5e5c0:   00000000 44610000 00000000 41c80000
0x05d5e5d0:   40800000 42080000 41c00000 42040000
0x05d5e5e0:   40600000 997814cb 00000059 99757d80
0x05d5e5f0:   3f000000 43610000 3f333333 000000a0
0x05d5e600:   00000004 00000140 00000081 9956e810
0x05d5e610:   05d5e85c 000003c0 000000f0 0000c800
0x05d5e620:   00220008 026a1988 000000f0 05d5e7e8 

Instructions: (pc=0x02605dd0)
0x02605dc0:   48 8d b4 26 00 00 00 00 89 c1 c1 e1 05 8d 0c 0f
0x02605dd0:   d9 41 04 d8 cb d9 51 04 de c2 d9 01 d8 cb d9 19 

Stack: [0x05d0f000,0x05d60000],  sp=0x05d5e5b0,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libcvaux.so+0x7bdd0]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j  
com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Obj
ect;+315
j  
com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)
Ljava/lang/Object;+214
j  
com.sun.jna.CallbackReference$NativeFunctionHandler.invoke(Ljava/lang/Object;Lja
va/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+198
j  
$Proxy13.callback(Lname/audet/samuel/javacv/jna/cxcore$IplImage;Lname/audet/samu
el/javacv/jna/cvaux$CvBGStatModel;D)I+27
j  
name.audet.samuel.javacv.jna.cvaux$v21.cvUpdateBGStatModel(Lname/audet/samuel/ja
vacv/jna/cxcore$IplImage;Lname/audet/samuel/javacv/jna/cvaux$CvBGStatModel;D)I+2
1
j  
com.myrobotlab.image.OpenCVFilterFGBG.process(Lname/audet/samuel/javacv/jna/cxco
re$IplImage;Ljava/util/HashMap;)Lname/audet/samuel/javacv/jna/cxcore$IplImage;+1
45
j  com.myrobotlab.service.OpenCV$VideoProcessor.run()V+204
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

Original issue reported on code.google.com by supert...@gmail.com on 8 Jul 2010 at 2:14

GoogleCodeExporter commented 9 years ago
Please disregard - although I have not been successful in porting the bgfg seg 
demo - the issue of crashing is no longer a problem.

The crash is associated with supplying the "grey" image 

Original comment by supert...@gmail.com on 15 Jul 2010 at 6:04

GoogleCodeExporter commented 9 years ago
completely disregard - bug is invalid
successfully got foreground & background working
sorry for the inconvenience - i should have looked deeper into it

Regards,
Greg.

Original comment by supert...@gmail.com on 15 Jul 2010 at 6:08

GoogleCodeExporter commented 9 years ago
Ok, good.. marking this issue as "invalid", but please share the solution in 
case someone else has the same problem, thanks!

Original comment by samuel.a...@gmail.com on 16 Jul 2010 at 2:49

GoogleCodeExporter commented 9 years ago
Embarrassingly, the solution is not to supply cvCreateGaussianBGModel with 
different image size as cvUpdateBGStatModel.  The sample in OpenCV 
bgfg_segm.cpp does not do this. It was a mistake on my part.

Original comment by supert...@gmail.com on 16 Jul 2010 at 3:16