You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.7 KiB
Java

//class ClearScreen {
//
// int timeElapsed, timeCurrent, timeInitial, euglenaCountInitial, euglenaCount, roiCornerX, roiCornerY, roiWidth, roiHeight;
// float euglenaReduction, targetReduction;
//
// opencv = new OpenCV(this, roiWidth, roiHeight);
// opencv.startBackgroundSubtraction(7, 3, .35);
// roiFrame = new PImage(roiWidth, roiHeight);
// break;
//
// /* Identify Euglena in a certain portion of the camera feed */
// void countEuglena() {
// roiFrame = get(roiCornerX, roiCornerY, roiWidth, roiHeight); // Get pixels of interest and saves as image for valid image path
// opencv.loadImage(roiFrame); // Input proper pixels into cv processing
// opencv.updateBackground(); //Necessary for background subtraction
// opencv.useGray(); //Create grayscale image
// opencv.dilate(); //Clean up image
// opencv.erode();
// opencv.blur(3);
// dst = opencv.getOutput(); //Save computer vision as separate image path
// contours = opencv.findContours(); //Find outline of moving objects - euglena
// euglenaCount = contours.size(); // Count number of outlines
// }
//
// void reset() {
// timeInitial = millis();
// timeElapsed = 0;
// identifyEuglena();
// euglenaCountInitial = euglenaCount;
// }
//
// ClearScreen(targetReduction){
// this.reset();
// }
//
// void mouseClicked(float x, float y){
// if (!point1complete){
// lineinprogress.x1 = x;
// lineinprogress.y1 = y;
// point1complete = true;
// } else {
// lineinprogress.x2 = x;
// lineinprogress.y2 = y;
// lineinprogress.visible = true;
// lines.add(lineinprogress);
//
// lineinprogress.draw();
// this.reset();
// }
// }
//}
void clearScreen(){
clearDisplay();
arduino.digitalWrite(left, arduino.HIGH);
leftArrow = 204;
noFill();
strokeWeight(15); // Controls thickness of blue border
stroke(color(0, 0, 255));
if (t<10000){
beginShape(); // Draws shape
vertex(convertXCoord(1200), convertYCoord(200));
vertex(convertXCoord(500), convertYCoord(200));
vertex(convertXCoord(500), convertYCoord(800));
vertex(convertXCoord(1200), convertYCoord(800));
endShape();
t=t+1;
} else {
beginShape();
vertex(convertXCoord(1200), convertYCoord(200));
vertex(convertXCoord(500), convertYCoord(200));
vertex(convertXCoord(500), convertYCoord(800));
vertex(convertXCoord(1200), convertYCoord(800));
endShape(CLOSE);
}
}