amirnezameddin / webcamstudio

Automatically exported from code.google.com/p/webcamstudio
GNU General Public License v3.0
0 stars 0 forks source link

NoBackground doesn't work #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add e.g. a webcam via the box next to the list of attached devices
2. Click Start on the webcam box to see the input.
3. Under FX on Source Properties, scroll down and select NoBackground
4. Click + to add it to the list
5. leave the frame, and press "snapshot"
6. Perhaps fiddle with the rgb sliders.

What is the expected output?
To see a white or black screen as long as the webcam hasn't moved. The 
background that I took in the snapshot should be inverted and removed from the 
result that I'm seeing.

What do you see instead?
Nothing has changed. If I move the RGB sliders all the way to the right, then 
it seems the video just freezes.

The Operating system you are using (Linux, Windows etc)?
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

What version of WebcamStudio are you using?
Version: 0.71-425~201410071645~ubuntu14.04.1

What version of Java are you using?
Not sure which flavor is being loaded...
$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-4ubuntu1~0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

What is your Webcamera vendor, model and version?
Logitech Webcam (lsusb says c250)

For *nix users please enter the output from "sudo lsusb"?
Bus 002 Device 005: ID 046d:0804 Logitech, Inc. Webcam C250
Bus 002 Device 004: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 
Wireless Adapter
Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle 
(HCI mode)
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 192f:0616 Avago Technologies, Pte. ADNS-5700 Optical 
Mouse Controller (5-button)
Bus 003 Device 004: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Original issue reported on code.google.com by kLd...@gmail.com on 22 Oct 2014 at 5:02

GoogleCodeExporter commented 9 years ago
Hi, sorry for the late answer.
I know that the Nobackground filter isn't working, but I also don't find any 
reference to see the same filter in action. In WS 0.5x the filter seems to not 
work any more. I leave it in WS 0.7x only because maybe someone will try to fix 
the issue.
karl

Original comment by soylent...@gmail.com on 27 Oct 2014 at 4:04

GoogleCodeExporter commented 9 years ago
Thanks for the answer, karl. Is there any hope of someone attending to this 
issue? Or do you know any other *nix software capable of doing this?
Thanks.

Original comment by kLd...@gmail.com on 27 Oct 2014 at 5:39

GoogleCodeExporter commented 9 years ago
Sorry, but actually i'm the only person who works on the code ... Hope that 
someone can give an hand ...
If you explain me better how the filter have to act, maybe i can have a look in 
the NoBackground filter code ... Sorry, but from the issue description (That 
you have filled perfectly) i don't understand yet what NoBackground filter is 
supposed to do ... have you some example to submit?
Let me know.
Thanks.
karl.

Original comment by soylent...@gmail.com on 27 Oct 2014 at 6:16

GoogleCodeExporter commented 9 years ago
Ah, OK.
As far as I know, NoBackground is a "poor man's chorma key".
Chroma key is: replace a fixed color in the picture with a picture of your 
choice.

NoBackground would do the same, but based off a fixed picture. It currently has 
a "take a snapshot" function. The filter would then compare the live image to 
the snapshot. Anywhere it matched (I would expect it has to be more than 
single-pixel areas, to avoid coincidence) it would blank it to transparent or 
whatever chroma key does.
Obviously, this would only work for a stationary camera with a fixed 
background. (However, I don't know if webcams wobble by a few pixels.. I assume 
image stabilization might not be so easy to work into this...)

Original comment by kLd...@gmail.com on 28 Oct 2014 at 4:48

GoogleCodeExporter commented 9 years ago
Thanks,
 now it is more clear to me ... and maybe i can fix it :)
This weekend I will take a look into the filter code and let you know if i got 
something useful.
karl

Original comment by soylent...@gmail.com on 28 Oct 2014 at 5:28

GoogleCodeExporter commented 9 years ago
That sounds great, thanks!

Original comment by kLd...@gmail.com on 28 Oct 2014 at 5:36

GoogleCodeExporter commented 9 years ago
Hi,
 I just get something ... I can't believe it but seems to work ... :)
The code of NoBackground filter was the same as the one in WS 0.5x that worked 
Ok.
I make some modifications about how the background picture is taken ...
If you want I can post you an executable jar with the modifications, so you can 
test it.
Anyway I'll try to include this in the next WS build, but I don't know when 
I'll release it ...
Let me know.
Thanks for the feedback, without your help I will never make this.
karl.

Original comment by soylent...@gmail.com on 30 Oct 2014 at 5:10

GoogleCodeExporter commented 9 years ago
I installed on ubuntu 14.04 with Version: 0.71-426~201410221737~ubuntu14.04.1
If it's easy for me to test with the jar, then sure - just please tell me where 
to put it / what to do, and I'll test it.

Thanks!

Original comment by kLd...@gmail.com on 30 Oct 2014 at 5:36

GoogleCodeExporter commented 9 years ago
Ok,
 download this archive:
https://drive.google.com/file/d/0BxkZ_wh6t7jbdUxkcEtQMGhmUDg/view?usp=sharing
Extract where you want.
Open a terminal and navigate to the extracted folder.
Once in the folder type this:

$ java -jar WebcamStudio.jar

WS will pop up.
Test the Nobackground filter and please let me know if it works as expected.
I see that NobackGround works better if the background picture colours differ 
from the first person colours ... but hope this time works right .... You have 
to play with RGB levels ...
Sorry for bad English.
Thanks.
karl.

Original comment by soylent...@gmail.com on 30 Oct 2014 at 6:18

GoogleCodeExporter commented 9 years ago
OK the instructions to launch worked.
I was able to take a snapshot, and then bump up the rbg a few notches, and the 
background disappeared... but lots of me did, too. I thought maybe my shirt 
(white) matched too much of the background, so I tried covering that up with 
another color, but that didn't seem to help.
Oddly, the more of my white shirt I showed the camera, the more likely it was 
to NOT blank out the background.
SOMETHING is at least somewhat working here, but I don't quite understand it. 
Do you have any tips e.g. on colors in the background and the part that I don't 
want to disappear?

Original comment by kLd...@gmail.com on 31 Oct 2014 at 5:54

GoogleCodeExporter commented 9 years ago
Thanks man for the test.
My code approach is quite simple ... but this is a start.
You confirm that the code almost works ... but is not optimized at all.
Don't really know if this filter can works well as the chromakey one.
I will try to improve it and I'll let you know the results.
karl

Original comment by soylent...@gmail.com on 31 Oct 2014 at 4:38

GoogleCodeExporter commented 9 years ago
After some tests i got something that works better.
First you have to set the "Exposure, Auto" to manual mode for your webcam.
To do this use guvcview :

$ sudo apt-get install guvcview

Once you put it to manual close guvcview.
We need this to be sure that the background image is the same of the one 
captured later ...
Then try using this new testing jar:
https://drive.google.com/file/d/0BxkZ_wh6t7jbMTMxelVtR01DclU/view?usp=sharing
Let me know.
Have a good weekend.
karl.

Original comment by soylent...@gmail.com on 1 Nov 2014 at 8:17

GoogleCodeExporter commented 9 years ago
Wow, that's a significant improvement! Good catch on the auto-exposure.
It's *significantly* cleaned up, I put it up 2 notches on rgb and it basically 
works.
There's still some background occasionally showing up... and some black spots 
on my face, though. I'm not really sure what to say about that - blurring me 
out doesn't look so good. Is there a way to adjust the... sensitivity? Or the 
size of matching areas?
For whatever hardcoded formulas, are those just as easily exposed as sliders I 
can play with..?

Thanks for the time and very clear instructions!

Original comment by kLd...@gmail.com on 2 Nov 2014 at 4:20

GoogleCodeExporter commented 9 years ago
Hi,
 please when you have time, try this testing jar:

https://drive.google.com/file/d/0BxkZ_wh6t7jbVFhrVjFyT18tTmM/view?usp=sharing

I try to put more sensitivity on RGB and an enhanced image subtraction routine.
Thanks.
karl

Original comment by soylent...@gmail.com on 2 Nov 2014 at 11:52

GoogleCodeExporter commented 9 years ago
Implemented fixed NoBackground filter in WS 0.71 build 567.

Original comment by soylent...@gmail.com on 14 Nov 2014 at 4:20

GoogleCodeExporter commented 9 years ago
...

Original comment by soylent...@gmail.com on 14 Nov 2014 at 4:21