Git Product home page Git Product logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
The cause of this problem is most likely the same as the one for issue #10 
http://code.google.com/p/javacv/issues/detail?id=10 .. will keep you posted for 
something to try

Original comment by [email protected] on 7 Aug 2010 at 4:14

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi Samuel,

Thanks for your response. I tried adding setAutoSynch(false) to all CvSeq 
constructors, but that didn't actually fix the issue. To be certain, the error 
no longer appears, but the contours found, if at all, are 1-2 pixel radius 
circles randomly. Using your test2.java example, none of the contours found 
with the non-modified javacv.jar are found.

I'm mildly stumped, but would like to show you the exact error, on the off 
chance I didn't explain myself correctly:


Exception in thread "main" java.lang.StackOverflowError
    at com.sun.jna.Native.getNativeSize(Native.java:951)
    at com.sun.jna.Native.getNativeSize(Native.java:937)
    at com.sun.jna.Structure.getNativeAlignment(Structure.java:890)
    at com.sun.jna.Structure.calculateSize(Structure.java:823)
    at com.sun.jna.Structure.allocateMemory(Structure.java:282)
    at com.sun.jna.Structure.<init>(Structure.java:177)
    at com.sun.jna.Structure.<init>(Structure.java:167)
    at com.sun.jna.Structure.<init>(Structure.java:163)
    at com.sun.jna.Structure.<init>(Structure.java:154)
    at name.audet.samuel.javacv.jna.cxcore$CvArr.<init>(cxcore.java:2379)
    at name.audet.samuel.javacv.jna.cxcore$CvSeq.<init>(cxcore.java:3060)
    at name.audet.samuel.javacv.jna.cxcore$CvSeq$ByReference.<init>(cxcore.java:3092)
    at sun.reflect.GeneratedConstructorAccessor3.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.jna.Structure.newInstance(Structure.java:1159)
    at com.sun.jna.Structure.updateStructureByReference(Structure.java:486)
    at com.sun.jna.Pointer.getValue(Pointer.java:400)
    at com.sun.jna.Structure.readField(Structure.java:517)
    at com.sun.jna.Structure.read(Structure.java:419)
    at com.sun.jna.Structure.autoRead(Structure.java:1368)


loops the following infinitely:


    at com.sun.jna.Structure.updateStructureByReference(Structure.java:490)
    at com.sun.jna.Pointer.getValue(Pointer.java:400)
    at com.sun.jna.Structure.readField(Structure.java:517)
    at com.sun.jna.Structure.read(Structure.java:419)
    at com.sun.jna.Structure.autoRead(Structure.java:1368)


Thank you,
Nick

Original comment by [email protected] on 11 Aug 2010 at 12:52

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Once "auto-synch" is disabled, you need to use the readField() method to read 
the native values of the fields in the Structure. The values of the Java fields 
will not be correct.. Did you use readField() in your Java code? 

BTW, I modified CvSeq slightly in this test package to include a static 
autoSynch flag:
    http://www.ok.ctrl.titech.ac.jp/~saudet/javacv.jar
With that, something like the following should disable the default auto-synch 
behavior of any newly constructed CvSeq objects:
    CvSeq.autoSynch = false;
If that works, I plan to add the flag to all Structure in the next release... 
thanks

Original comment by [email protected] on 12 Aug 2010 at 3:04

  • Changed state: Started

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi Samuel,

Thanks for the advice. I'm not very familiar with JNA. Is there any way you 
could clarify on readField(). Am I to just replace read() with readField() in 
the cvSeq constructors?

Thank you,
Nick

Original comment by [email protected] on 12 Aug 2010 at 3:58

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
For each individual field, yes.. if you have a field "int number", then instead 
of something like 
    int n = someStructure.number
you replace that with 
    int n = (Integer)someStructure.readField("number")

Original comment by [email protected] on 12 Aug 2010 at 4:02

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Marking this long-standing issue as fixed, since it should work. If you still 
get stack overflows after setting CvSeq.autoSynch = false, please reopen the 
issue. Otherwise please mark it as /verified/, thank you.

Original comment by [email protected] on 4 Nov 2010 at 10:40

  • Changed state: Fixed

from javacv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.