Comments (6)
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.
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.
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.
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.
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.
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)
- JavaCv on android doesen't work HOT 5
- Access violation and like that HOT 2
- Face Recognition using Eigen and Fisher Face. HOT 8
- problems to acces data from all the detected patterns with singleTracker HOT 4
- Encoded H264 video using FFmpegFrameRecorder missing last few frames HOT 8
- sample RecordActivity broken version 0.5 HOT 3
- Dependent Libraries opencv_legacy HOT 18
- Can't compile JavaCV from source code HOT 2
- cvCalcOpticalFlowPyrLK method will cause fatal error HOT 2
- no jnivideoInputLib in java.library.path HOT 1
- Javacv 0.5 linux-x64 requires new glibc HOT 5
- Using Javacv And Opencv in same project HOT 1
- Null pointer error(native method ) HOT 2
- JavaFX Media Player can not play output video created by Javacv 0.5 HOT 1
- How to grab keyframe from a video with javacv? HOT 23
- [Android + FFMpeg] Encoding error while using FFMpegRecorder in RecordActivity.java HOT 6
- canvas.showimage opens empty window on Mac OS Lion HOT 9
- FFmpegFrameGrabber won't grab till the end of video. HOT 12
- Conversion of audio in FFMpegFrameGrabber HOT 6
- Cached value of CvMat.fullSize and *Buffer fields might get incorrect HOT 34
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacv.