-
Notifications
You must be signed in to change notification settings - Fork 0
/
Finder.java
40 lines (35 loc) · 1.12 KB
/
Finder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg2014vision;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bytedeco.javacpp.opencv_core;
/**
*
* @author Jared "Jär Bär" Gentner
*/
public class Finder {
private static boolean reading = false;
private static opencv_core.IplImage image;
public static synchronized void main(String[] argv) {
reading = true;
image = CameraFeed.getFeed("rtsp://10.0.20.11/axis-media/media.amp?videocodec=h264&resolution=320x240").getImage();
for(;;){
reading = true;
image = CameraFeed.getFeed().getImage();
reading = false;
try {
Thread.sleep(50);
} catch (InterruptedException ex) {
Logger.getLogger(Finder.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
static synchronized opencv_core.IplImage getImage() {
while(reading){}
return image;
}
}