this.roiPts = roiPts.clone();
}
public static void main(String[] args) throws Exception {
CanvasFrame frame = new CanvasFrame("Virtual Ball Test");
IplImage image = IplImage.create(640, 960, IPL_DEPTH_8U, 3);
cvSetZero(image);
double[] roiPts = { 0,0, 640,0, 640,480, 0,400 };
cvFillConvexPoly(image, new CvPoint((byte)16, roiPts), roiPts.length/2, CvScalar.WHITE, CV_AA, 16);
VirtualBall virtualBall = new VirtualBall(new Settings(roiPts));
for (int i = 0; i < 1000; i++) {
Thread.sleep(100);
cvSetZero(image);
if (i == 50) {
roiPts[5] -= 100;
}
if (i > 100 && i < 1200) {
roiPts[3] += 1;
roiPts[5] += 1;
}
//if (i > 103) {
// System.out.println(i);
//}
cvFillConvexPoly(image, new CvPoint((byte)16, roiPts), roiPts.length/2, CvScalar.WHITE, CV_AA, 16);
virtualBall.draw(image, roiPts);
frame.showImage(image);
}
}