I’m in a hurry. Help. This is the OPEN CV’contour’ question.
I want to get the x,y coordinate values for’contour’.
Please tell me a way to get the x,y coordinates. Please.
int x =?
int y =?
import gab.opencv.;
import processing.video.;Movie video;
OpenCV opencv;void setup() {
size(1920, 1080);
// size(720, 480);
video = new Movie(this, “test_video_2.mp4”);opencv = new OpenCV(this, 720, 480);
opencv.startBackgroundSubtraction(5, 3, 0.5);
video.loop();
video.play();
while (video.height==0) delay(2);}
void draw() {
image(video, 0, 0); image(video, 720, 0);
opencv.loadImage(video);
opencv.updateBackground();
opencv.dilate();
opencv.erode();
noFill();
stroke(255, 0, 0);
strokeWeight(3);for (Contour contour : opencv.findContours()) {
contour.draw();
int num = contour.numPoints();
float sizes = contour.area();
print(contour.getPoints());
}}
void movieEvent(Movie m) {
m.read();
}