|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.berkeley.guir.ptk.PTK
edu.berkeley.guir.ptk.abstraction.Abstractor
edu.berkeley.guir.ptk.abstraction.PeopleCountAbstractor
Performs abstraction of PlanarImages from input.CamperInput
to determine how many people are in the image. The algorithm used is approximate:
it looks for skin-colored blobs (tested mainly with light- and tan-colored skin),
determines the size of the blobs (in number of pixels), and counts the blobs that
are larger than some threshold as people. This assumes that faces will be the
biggest blobs (i.e., that people will not be wearing sleevless shirts or shorts).
In an IMAGE event, adds the number of people counted in the image frame, which is saved as a DataNumber object. Can remove and replace the image data if you set replace_data to true.
This abstractor is much more accurate with high quality digital images.
Inexpensive webcams can be used, but the count will be less accurate due to
noise in the camera and poor color quality (which is required for recognizing
skin colors). To tweak the skin color ranges the abstractor will find, modify
valies in the isSkin or isSkinHighQualityImage (the
former is used for inexpensive webcams and the latter is for high quality
camera images).
The image processing performed in this class require a large amount of memory and processor time. It is preferable that it be run on a machine that is not being used for other processing purposes (e.g., do not run it on the user's machine). Set the input's time between event dispatch to a high number to reduce the amount of processing required for this class.
| Nested Class Summary | |
class |
PeopleCountAbstractor.ConnectedComponent
Inner class for encapsulating connected component information. |
| Field Summary | |
static int |
B
|
boolean |
debug_feedback
If true, the people counter abstractor will show feedback on what it is doing: skin blobs counted as people will be colored in the images taken by the camera and displayed. |
static int |
G
|
static int |
R
|
static int |
skin_blob_size
Set this to customize the size of skin blobs (in number of pixels) the abstractor will count as people. |
| Fields inherited from class edu.berkeley.guir.ptk.abstraction.Abstractor |
data_ids_I_want, replace_data |
| Fields inherited from class edu.berkeley.guir.ptk.PTK |
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG |
| Constructor Summary | |
PeopleCountAbstractor()
|
|
| Method Summary | |
javax.media.jai.PlanarImage |
checkSkinColor(javax.media.jai.PlanarImage pi)
Uses common skin colors to detect skin. |
void |
displayFeedback(javax.media.jai.PlanarImage pi)
|
boolean |
doAbstract(Event e,
History h)
Performs the abstraction of the event e as specified by the class that implements this interface. |
int |
getNumPeople(javax.media.jai.PlanarImage img)
|
PeopleCountAbstractor.ConnectedComponent[] |
labelConnectedComponents(javax.media.jai.PlanarImage marked,
int[][] label_matrix)
Checks each pixel of an image and if it is not black, adds it to some ConnectedComponent. |
| Methods inherited from class edu.berkeley.guir.ptk.abstraction.Abstractor |
addMetadataIWant, canIAbstract, getAllMetadata, getFirstMetadata |
| Methods inherited from class edu.berkeley.guir.ptk.PTK |
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int R
public static final int G
public static final int B
public boolean debug_feedback
public static final int skin_blob_size
| Constructor Detail |
public PeopleCountAbstractor()
| Method Detail |
public boolean doAbstract(Event e,
History h)
Abstractor
doAbstract in class Abstractore - h -
public int getNumPeople(javax.media.jai.PlanarImage img)
public void displayFeedback(javax.media.jai.PlanarImage pi)
public javax.media.jai.PlanarImage checkSkinColor(javax.media.jai.PlanarImage pi)
public PeopleCountAbstractor.ConnectedComponent[] labelConnectedComponents(javax.media.jai.PlanarImage marked,
int[][] label_matrix)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||