Saturday, December 7, 2013

Computer Learning Based Methods and Background Subtraction

Cascade Object Detector:
We tried using Cascade Object Detector function in Matlab. In this process first We must train the object detector to be able to detect hand. To train the detector, We must feed in positive images and the region that contains the object of interest and also feed in negative image that doesn't contain the object of interests. We tried feeding in around 16 images of pictures of just hand with different lighting, background, and sharpness and 15 images of background behind the picture of the hand. We use parameter FalseAlarmRate to be 0.00001 and TruePositiveRate, 0.99999 and NumCascadeStages to be 6. False alarm rate tells the fraction of negative images incorrectly classified as positive image. Lower false alarm rate will make the detector achieve fewer false detection. TruePositiveRate tells the fraction of positive image correctly classified as positive image. Higher true positive rate will make detector achieve greater number of correct detection. NumCascadeStages tells how many stages the detector will train. Higher number of stages can result more accurate detector. At each stage the function will learn to detect positive image and false positive imaging and pass those images to next stage, discarding any missed classified positive images and discarding true negative images. Since all of our positive and positive  images are correctly classified We can set FalseAlarmRate  to be very low and TruePositiveRate to be very high. However we only have around 15 images so we can't have many NumCascadeStages. After training, we tried to feed in the positive images we used to train. The result is that the detector detect something for only 4 out of 16 images, 2 of which are good detection, 1 ok detection and 1 bad detection. 

good 1
good 2


ok 1
bad 1
Therefore we tried changing the values around and none of them give satisfactory result. Increasing false alarm rate give 1 or 2 ok detection but mostly give too many false positive detection. Where as decreasing true positive rate the detector barely detect anything and the detection is always false positive.




False positive may came from having too little training images, so to test the feasibility of this method we tried the using the data of stop signs that Matlab have to train the detector. They have around 80 images to train and be able to get to 10 training stages. However the result isn't very satisfying. It can detect most of the stop signs but it also in the same image detect lots of other unrelated objects. Giving more training images to make the detector better however its still not reliable enough. To feeding in picture and region of interest data to trainer take lot of time and the result might not be very reliable. Also to make this work, we need to train different detector for each different finger configuration. So we conclude that this method isn't feasible.

ForegroundDetector:
We tried using ForegroundDetector in which use Gaussian mixture probabilistic models to compare video frames to determine which pixel is foreground or background.  The goal of this method is to extract foreground and remove background in order to improve hand detection. However the detector can't properly remove the background, most of the background remains. This is due to video constantly auto correcting the lighting and exposure. We notice this when we tried doing frame subtraction. The background constantly change slightly and normal image averaging and subtraction doesn't work well. We also tried moving object detection in which could detect different moving part in the hand, but it did not accurately detect the moving fingers. We tried couple of other methods from code online such as video averaging and foreground detection and blob analysis. The result isn't very accurate as expected and didn't give better result than the one we already have.
video averaging
blob detection
foreground detection
Background Subtraction:
We tried another method to gray scale the images and take the average of the beginning of the video until there're lot of change in the video and use that as background. Then we do frame - background subtraction. However the result is that only the part with white background remains whereas background  - frame any part inside the white background disappear. So we tried complementing the images before subtraction but it gives the same result. So we try adding frame - background and background  - frame to be my foreground differentiation. Then we filter out the location where the value in foreground differentiation is lesser than certain threshold. The result is ok but still need more work to filter image better. 
image- background

background-image
adding two subtraction
resulting filter




No comments:

Post a Comment