Giter Site home page Giter Site logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
This is most likely caused by the "auto-synch" feature in JNA, details here 
under "Large Structure": 
https://jna.dev.java.net/javadoc/overview-summary.html#performance

Unfortunately, functions like cvFindContours() and cvApproxPoly() create CvSeq 
objects and the programmer does not get a chance to setAutoSynch(false) before 
they get read... I'll think about what could be done to keep things clean. You 
may however modify the source code of cxcore.java, as a quick fix, by adding 
setAutoSynch(false) to constructors of the CvSeq class.

Samuel

Original comment by [email protected] on 16 Jul 2010 at 3:01

  • Changed state: Accepted

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
To answer some of the other questions, the number of parameters to the 
cvContourArea() method changes with the version of OpenCV, so you need to 
import one of the subclasses based on the version of OpenCV you wish to use.

The problem with blobslib is that it's written in C++.. It's quite hard to use 
C++ interfaces from other languages. Someone would need to produce an interface 
in C first.

Original comment by [email protected] on 16 Jul 2010 at 3:10

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
Great,
Thanks, I will try your suggestion.

Additionally, I was wondering why cvContourArea was commented out?

Original comment by [email protected] on 16 Jul 2010 at 3:18

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
Sorry, did not see your last reply before I posted my last comment.
Makes sense regarding parameter numbers changing.

I'll experiment with the setAutoSynch too. I'd assume that all the fields would 
be null until forcefully read into - not sure how to do that, but I'll look.
Thanks for pointing me in the right direction.

Greg.

Original comment by [email protected] on 16 Jul 2010 at 8:29

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
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;
Once "auto-synch" is disabled, you need to call the readField() method to read 
the native values of the fields in the Structure. The values of the Java fields 
will not be correct.. 

If that works, I plan to add the flag to all Structures in the next release... 
Please let me know if it works, thanks

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

  • Changed state: Started

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
I am having the same problem. Blob detection is a pain using javaCV. I have 
turned to opencv for processing and it works quite good, but it would be nice 
to see a fix or improvement on the javaCV side.

that jar file did not work for me. Did not notice a difference.

Original comment by [email protected] on 25 Oct 2010 at 12:07

from javacv.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 13, 2024
You have to put this line somewhere before your blob detection:
    CvSeq.autoSynch = false;
If you did put this line and it did not improve the performance, then please 
let me know. Otherwise, I am considering this problem fixed, thank you.

Original comment by [email protected] on 25 Oct 2010 at 2:03

  • 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.