OpenCV index
Name OpenCV
Examples
None available
Description find way on Mac cvLoadImage() to avoid memory leaks Open Source Computer Vision Library projet port for Processing.

for more details @ http://www.intel.com/technology/computing/opencv/

code:


	import hypermedia.video.*;
		
	OpenCV opencv;
		 
	void setup() {
		 
		size( 640, 480 );
		 
		opencv = new OpenCV( this, width, height );
		opencv.capture();
	}
		 
	void draw() {
		opencv.read();
		opencv.flip( OpenCV.FLIP_HORIZONTAL );
		image( opencv.image(), 0,0);
	}
 
Constructors
OpenCV();
OpenCV(parent);
Methods
ROI ( )   Sets image region of interest to the given rectangle.

absDiff ( )   Calculates the absolute difference between the image in memory and the current image.

allocate ( )   Allocate required buffer with the given size. Except for creating an empty buffer, this method should not be directly used.
capture(), movie() and loadImage() methods will automatically re-allocate the actual buffer.

blur ( )   Smoothes the image in one of several ways.

brightness ( )   Adjust the image brightness with the specified value (in range of -128 to 128).

capture ( )   Allocates and initialise resources for reading a video stream from the specified camera.
note : this method automatically update previous memory allocation

contrast ( )   Adjust the image contrast with the specified value (in range of -128 to 128).

convert ( )   Converts the actual image from one color space to another.

copy ( )   Copies a region of pixels from an image to the actual buffer at the specified position and with the given dimensions.

dispose ( )   Forget all OpenCV resources. This method is automatically called by Processing when the PApplet shuts down.

findContours ( )   Blob's detection

flip ( )   Flip the actual image around vertical, horizontal or both axises.

image ( )   Image

interpolation ( )   Set copy or effect interpolation method. By default the interpolation method is set to INTER_LINEAR.

invert ( )   Invert image.

jump ( )   MOVIE_FRAMES

loadImage ( )   Loads an image from the specified file with the given size dependin of the current scale interpolation method.

Currently the following file formats are supported:

  • Windows bitmaps - BMP, DIB
  • JPEG files - JPEG, JPG, JPE
  • Portable Network Graphics - PNG
  • Portable image format - PBM, PGM, PPM
  • Sun rasters - SR, RAS
  • TIFF files - TIFF, TIF

note : this method automatically update previous memory allocation



movie ( )   Allocates and initialise resources for reading a video file from the specified file name, with the given frames dimensions.
Movie must be located in the sketch's data directory, otherwise you must specified the full path to access to the movie file without an error.
notes : this method automatically update previous memory allocation, sound will not be available

Supported codecs and file formats depends on the video back end library :

  • Video for Windows (VfW) for Windows users
  • FFMPEG on Linux
  • QuickTime for Mac OS X

For more informations about video on OpenCV or to be able to read your video files on all platforms, see VideoCodecs



pixels ( )   Retrieve image data

read ( )   Grabs a new frame from the input camera or a movie file.

remember ( )   Place the current image in memory.

restore ( )   Restore the actual image data from the original image with the given color space.

stop ( )   Stop process.

threshold ( )   Applies fixed-level threshold to the current image using the THRESH_BINARY thresholding type and 255 as the maximum value.

Usage Application
Related