LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to remove background present bhind face from image taken by webcam?

I am a student. I am working with ni vision module from some days.I want to remove background other than face form the image taken by the webcam. How can I do it? Can I get any VI to reach my goal?

0 Kudos
Message 1 of 9
(3,711 Views)

To do this, you would first have to setup the background environment in your room by a uniform color screen while capturing the image. Once that is done, you have to take the pixel values in a certain range of the background color, and replace them with either 0 or 1.

This way, you only get the face and no background.

 

Other way around, which is not recommended, is to have a reference image of the background, with no face, and use IMAQ Subtract with the image having face.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 2 of 9
(3,707 Views)

Having uniform color in background is not possible practically right? I am going to put the webcam in the car to track the face of driver. Its not possible to have uniform background in the car. Is there any other way to remove it?

0 Kudos
Message 3 of 9
(3,700 Views)

@saran19 wrote:

Having uniform color in background is not possible practically right? I am going to put the webcam in the car to track the face of driver. Its not possible to have uniform background in the car. Is there any other way to remove it?



No, it isn't possible if you are going to try this in a car.

I meant you could use a single color and then filter out a certain range of that color, but that is a different point now, since you want to do this in a car.

You can try the IMAQ subtract method which I mentioned. You must keep the camera FOV fixed for this. The problem you could face in this method is different lightning at different time of the day, which you might need to handle in your code.

 

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Message 4 of 9
(3,695 Views)

Thanks a lot for suggestion.. In matlab we can isolate constant objects from moving objects using a code. I saw a demonstration of the code where a car is moving on the road and using that code except car, road,divider etc were removed from the continuous snapshots taken on the moving car. I thought something of that sort can be worked out in labview.. Can we run matlab code in labview? should we have to install any interface for that?

One more doubt:

We were able to find the position of eyes using pattern recognition and graphical representation of pixel value of gray scale equivalent. But when the head movements vary a lot i.e., when the head takes a turn left or right (not completely) pattern recognition is not working. Read in few IEEE papers that some threshold can be set up so that a near matching of the pattern can be tracked easily. But we couldn't find a way to do it using Labview. Also read that UKF filter can be used in order to avoid head movements or movements caused due to improper roads. Can you give me any info abt these?

0 Kudos
Message 5 of 9
(3,685 Views)

If you have a moving object you can activly remove an object with a confidence map (change in pixel values from previous frame)  the more the object moves the easier it is to find the moving object.  This can be as simple as comparing image i with i-1, i-2, ....  and calculating the statistical deviation.  Also lighting tricks can help alot (i.e. inducing red-eye with correct lighting can help find eyes). 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 9
(3,682 Views)

How to use red eye in labview??  Can I  get VI to remove moving objects? Or atlest steps to be followed to do it?

0 Kudos
Message 7 of 9
(3,677 Views)

Redeye is not a feature of labview, it is an optical effect where you can look for it in your image.

As for removing moving objects, do an Imaq absolute difference between frames (you will need to keep a history of several frames in memory),  The larger the difference (I ususally normalize the difference) the more likely the pixel has changed, the you can threshold the image.

 

These are not necessarly LabView principals but can be implemented using the VDM relativly easily.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 8 of 9
(3,670 Views)

How to use a open CV code in labview?

0 Kudos
Message 9 of 9
(3,660 Views)