Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't initialize openCV data types although i have imported the jar and dll files needed
    primarykey
    data
    text
    <p>Im using opencv 2.4.4 and I want to detect and track face with java. I found the example as follow in internet.</p> <p>example </p> <pre><code>import hypermedia.video.*; import java.awt.Rectangle; float last = millis(); float interval = 100; int startTime; int noFaces = 0; int noFacesPrev = 0; int dx = 0; int dy = 0; int dwidth = 400; int dheight = 400; OpenCV opencv; // contrast/brightness values int contrast_value = 0; int brightness_value = 0; void setup() { size( 800,800 ); opencv = new OpenCV( this ); opencv.movie( "egypt.mov", 320, 240 ); // load movie file opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load detection description, here-&gt; front face detection : "haarcascade_frontalface_alt.xml" // print usage println( "Drag mouse on X-axis inside this sketch window to change contrast" ); println( "Drag mouse on Y-axis inside this sketch window to change brightness" ); } void stop() { opencv.stop(); super.stop(); } void draw() { // grab a new frame opencv.read(); opencv.contrast( contrast_value ); opencv.brightness( brightness_value ); // proceed detection Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 ); // 40,40 is the smallest size its looking for // draw face area(s) noFaces = faces.length; if (faces.length &gt;=1 &amp;&amp; noFaces &gt; noFacesPrev) { startTime = millis(); println(startTime); println(noFaces); println(noFacesPrev); noFacesPrev = noFaces; } if (faces.length == 0) { // if there is no face, start over println("no face"); startTime = 0; noFacesPrev = 0; } if (startTime &gt; 0) { println("started"); if(millis() - startTime &gt;interval &amp;&amp; (faces.length &gt;=1)) { for ( int i = 0; i= 800){ dy = dy+400; dx = 0; } if (dy &gt;= 800){ dy = 0; dx = 0; } } startTime=0; println ("clock reset"); noFacesPrev=0; } } } // Changes contrast/brigthness values void mouseDragged() { contrast_value = (int) map( mouseX, 0, width, -128, 128 ); brightness_value = (int) map( mouseY, 0, width, -128, 128 ); } void keyPressed() { if (key == 's') { opencv.stop(); super.stop(); } } </code></pre> <p>When I want to try this code in my project, I cannot initialize "<code>OpenCV opencv;</code>" !! also, I cannot import "hypermedia.video" !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload