hypermedia.video
Class Blob

java.lang.Object
  extended by hypermedia.video.Blob

public class Blob
extends java.lang.Object

A storage object containing a blob detected by OpenCV. Returned by blobs() method.

See Also:
OpenCV.blobs( int, int, int, boolean ), OpenCV.blobs( int, int, int, boolean, int )

Field Summary
 float area
          The area of the blob in pixels
 java.awt.Point centroid
          The centroid or barycenter of the blob
 boolean isHole
          Is this blob a hole inside of another blob?
 float length
          The length of the perimeter in pixels
 int[] pixels
          A list of color int, containing the image pixels created by loadPixels()
 java.awt.Point[] points
          The list of points defining the shape of the blob
 java.awt.Rectangle rectangle
          The containing rectangle of the blob
 
Constructor Summary
protected Blob()
          Create a new Blob with the default properties.
protected Blob(float area, float length, java.awt.Point centroid, java.awt.Rectangle rect, java.awt.Point[] points, boolean isHole)
          Create a new Blob with the given properties.
 
Method Summary
 processing.core.PImage image()
          Returns blob's image as PImage.
 void loadPixels()
          Generates an image from the current blob shape, using the current frame for pixel content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

area

public float area
The area of the blob in pixels


length

public float length
The length of the perimeter in pixels


centroid

public java.awt.Point centroid
The centroid or barycenter of the blob


rectangle

public java.awt.Rectangle rectangle
The containing rectangle of the blob


points

public java.awt.Point[] points
The list of points defining the shape of the blob


isHole

public boolean isHole
Is this blob a hole inside of another blob?


pixels

public int[] pixels
A list of color int, containing the image pixels created by loadPixels()

See Also:
loadPixels()
Constructor Detail

Blob

protected Blob()
Create a new Blob with the default properties.


Blob

protected Blob(float area,
               float length,
               java.awt.Point centroid,
               java.awt.Rectangle rect,
               java.awt.Point[] points,
               boolean isHole)
Create a new Blob with the given properties.

Parameters:
area - the shape area
length - the contour length
centroid - the shape barycentre point
rect - the shape rectangle
points - the contour points
isHole - true whether this blob is completly inside a bigger one
Method Detail

loadPixels

public void loadPixels()
Generates an image from the current blob shape, using the current frame for pixel content. After the loadPixels() call, pixels can by accessed via the pixels variable.

This method should be called directly after the blob detection process to retrieve the correct data values.

! NOT YET IMPLEMENTED

See Also:
pixels

image

public processing.core.PImage image()
Returns blob's image as PImage.

! NOT IMPLEMENTED YET

Returns:
PImage