We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi,
I am a noob of java and one error i don't understand is java.awt.Rectangle[]" does not match with "Rectangle[]"
my all code is here :
import hypermedia.video.*;
OpenCV opencv;
void setup() {
size( 320, 240 );
opencv = new OpenCV(this);
opencv.capture( width, height );
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load the FRONTALFACE description fil
}
void draw() {
class Rectangle {
};
opencv.read();
image( opencv.image(), 0, 0 );
// detect anything ressembling a FRONTALFACE
Rectangle[] faces = opencv.detect();
// draw detected face area(s)
noFill();
stroke(255,0,0);
for( int i=0; i<faces.length; i++ ) {
rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );
}
}
I want include why don't match.
Answers
Get rid of lines 16 and 17
package
.package
java.awt:http://Docs.Oracle.com/javase/8/docs/api/java/awt/Rectangle.html
package
from your localclass
inside draw()! :-&import java.awt.Rectangle;
datatype! >:)