|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.mcgill.cim.sre.cv4hci.VideoCapture
public class VideoCapture
VideoCapture is a wrapper class for the HighGUI capture API of OpenCV. It comes with a few additional features, such as a maximum width for captured images and an automatic shrinking of captured images that are larger than this maximum. It can also flip images, effectively rotating the camera 180 degrees. It also keeps in memory a status of its performance in frames per second (FPS). One can serialize it as well to keep capture source information such as the camera number and the video filename.
The run() method is used to grab images, and notifications are sent to objects who have registered with the StateMonitor. Use an instance of this class as a parameter to a Thread object. The capture will then take place automatically on another thread.
Constructor Summary | |
---|---|
VideoCapture(java.io.File videoFile)
VideoCapture constructor specifiying the video file to capture from. |
|
VideoCapture(java.io.File videoFile,
int maximumWidth)
VideoCapture constructor specifiying the video file to capture from and the maximum width of captured images. |
|
VideoCapture(int cameraNumber)
VideoCapture constructor specifiying the camera number to capture from. |
|
VideoCapture(int cameraNumber,
int maximumWidth)
VideoCapture constructor specifiying the camera number to capture from and the maximum width of captured images. |
|
VideoCapture(java.lang.String videoFile)
VideoCapture constructor specifiying the video filename to capture from. |
|
VideoCapture(java.lang.String videoFile,
int maximumWidth)
VideoCapture constructor specifiying the video filename to capture from and the maximum width of captured images. |
Method Summary | |
---|---|
int |
getCameraNumber()
Gets the camera number this object was constructed with. |
double |
getFPS()
Gets the current performance of the capture in frames per second. |
java.util.Observable |
getStateMonitor()
Gets the StateMonitor (an Observable object) with which other objects implementing the Observer interface can register with. |
java.lang.String |
getVideoFile()
Gets the video filename we are capturing from. |
boolean |
isFlip()
Gets the flip (like a 180 degree rotation) property of this object. |
void |
run()
Runs the capture in an internal loop. |
void |
setFlip(boolean doFlip)
Sets the flip (like a 180 degree rotation) property of this object. |
void |
stop()
Stops the capture loop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VideoCapture(int cameraNumber)
public VideoCapture(java.lang.String videoFile)
public VideoCapture(java.io.File videoFile)
public VideoCapture(int cameraNumber, int maximumWidth)
public VideoCapture(java.lang.String videoFile, int maximumWidth)
public VideoCapture(java.io.File videoFile, int maximumWidth)
Method Detail |
---|
public void setFlip(boolean doFlip)
doFlip
- if true, flip the captured imagespublic boolean isFlip()
public int getCameraNumber()
public java.lang.String getVideoFile()
public double getFPS()
public java.util.Observable getStateMonitor()
public void stop()
public void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |