OPENCV



Name OpenCV
Examples
import hypermedia.video.*;

OpenCV opencv;

void setup() {
    opencv = new OpenCV(this);
    opencv.capture(width,height);
}

void draw() {
    opencv.read();
    background( opencv.image() );
}

Description The main object for all computer vision processes.

To use OpenCV library in a PApplet directly in pure Java, start with this small integration sample
for more details about Processing see the home page


	import processing.core.*;
	import hypermedia.video.OpenCV;

	public class OpenCV_PApplet extends PApplet {

		OpenCV cv = null;  // OpenCV object

		// Initialise Objects
		public void setup() {
		    size( 640, 480 );              // set frame size
		    cv = new OpenCV( this );       // link OpenCV process to this PApplet
		    cv.capture( width, height );   // start video stream
		}

		// Display the input camera stream in frame
		public void draw() {
		    cv.read();
		    image( cv.image(), 0, 0 );
		}

		// Call the PApplet main method
		public static void main( String[] args ) {
		    PApplet.main( new String[]{"OpenCV_PApplet"} );
		} 
	}

 
Syntax OpenCV(parent);
Fields
BILATERAL Blur method
BLUR Blur method
BUFFER Type of Image
CASCADE_FRONTALFACE_ALT Standard Haar classifier cascade file used for object detection
CASCADE_FRONTALFACE_ALT2 Standard Haar classifier cascade file used for object detection
CASCADE_FRONTALFACE_ALT_TREE Standard Haar classifier cascade file used for object detection
CASCADE_FRONTALFACE_DEFAULT Standard Haar classifier cascade file used for object detection
CASCADE_FULLBODY Standard Haar classifier cascade file used for object detection
CASCADE_LOWERBODY Standard Haar classifier cascade file used for object detection
CASCADE_PROFILEFACE Standard Haar classifier cascade file used for object detection
CASCADE_UPPERBODY Standard Haar classifier cascade file used for object detection
FLIP_BOTH Flip mode
FLIP_HORIZONTAL Flip mode
FLIP_VERTICAL Flip mode
GAUSSIAN Blur method
GRAY Colorspace of image
HAAR_DO_CANNY_PRUNING Haar classifier flag
HAAR_DO_ROUGH_SEARCH Haar classifier flag
HAAR_FIND_BIGGEST_OBJECT Haar classifier flag
HAAR_SCALE_IMAGE Haar classifier flag
INTER_AREA Interpolation method
INTER_CUBIC Interpolation method
INTER_LINEAR Interpolation method
INTER_NN Interpolation method
MAX_VERTICES The maximum number of contour points available to blob detection (by default)
MEDIAN Blur method
MEMORY Type of Image
MOVIE_FRAMES Movie info selector (not yet implemented)
MOVIE_MILLISECONDS Movie info selector (not yet implemented)
MOVIE_RATIO Movie info selector (not yet implemented)
RGB Colorspace of image
SOURCE Type of Image
THRESH_BINARY Thresholding method
THRESH_BINARY_INV Thresholding method
THRESH_OTSU Thresholding method
THRESH_TOZERO Thresholding method
THRESH_TOZERO_INV Thresholding method
THRESH_TRUNC Thresholding method
height OpenCV image/buffer height
width OpenCV image/buffer width
Methods
ROI() Set image region of interest to the given rectangle.
absDiff() Calculate the absolute difference between the image in memory and the current image.
allocate() Allocate required buffer with the given size.
blobs() Blob and contour detection.
blur() Smooth the image in one of several ways.
brightness() Adjust the image brightness with the specified value (in range of -128 to 128).
capture() Allocate and initialize resources for reading a video stream from a camera.
cascade() Load into memory the descriptor file for a trained cascade classifier.
contrast() Adjust the image contrast with the specified value (in range of -128 to 128).
convert() Convert the current image from one colorspace to another.
copy() Copy the image (or a part of it) into the current OpenCV buffer (or a part of it).
detect() Detect object(s) in the current image depending on the current cascade description.
flip() Flip the current image around vertical, horizontal or both axes.
image() Return the current (or specified) OpenCV image
interpolation() Set global interpolation method.
invert() Invert image.
jump() Jump to a specified movie frame.
loadImage() Load an image from the specified file.
movie() Allocate and initialize resources for reading a video file from the specified file name.
pixels() Retrieve cuurent (or specified) image data.
read() Grab a new frame from the input camera or a movie file.
remember() Place the image (original or current) in memory.
restore() Revert to the original image.
stop() Stop OpenCV process.
threshold() Apply fixed-level threshold to the current image.
Usage Application