Comments (4)
Huh, I didn't know that. I'm on Arch too, and I didn't realize it! Added it to the list.
As for the other issue. I see you have python3.9, so that shouldn't be the issue.
Ah I know what it is. You didn't provide a replacement background, and I didn't properly implement the function overloading.
I think I can fix that
from bgrm.
Should be fixed now. Tested with and without bg argument. Basically combined:
def getFrame(self):
_success, frame = self._vidFeed.read()
noBgFrame = self._segmentor.removeBG(
frame, self._settings.fillColor,
threshold = self._settings.rmThresh
)
return (frame, noBgFrame)
def getFrame(self, bgImg):
_success, frame = self._vidFeed.read()
noBgFrame = self._segmentor.removeBG(
frame, bgImg,
threshold = self._settings.rmThresh
)
return (frame, noBgFrame)
which isn't correct because that just gets rid of the first one into:
def getFrame(self, bgImg = None):
_success, frame = self._vidFeed.read()
if shape(bgImg) == ():
noBgFrame = self._segmentor.removeBG(
frame, self._settings.fillColor,
threshold = self._settings.rmThresh
)
else:
noBgFrame = self._segmentor.removeBG(
frame, bgImg,
threshold = self._settings.rmThresh
)
return (frame, noBgFrame)
from bgrm.
Thanks for the quick fix!
By the way, an unrelated idea: do you think it could be possible to implement the "blur background" functionality in this program or would that be off-scope?
If it is, then perhaps we could provide an example of how to pass a still blurred image of the background directly to bgrm
, using convert $(shot of current bg) -blur 0x7 "image to be passed to bgrm"
for example
from bgrm.
It's probably possible to do.
Basically in the main loop:
# Loop over feed
while True:
# Get cam feed
if settings.bgImg == '':
frame, noBgFrame = cam.getFrame()
else:
frame, noBgFrame = cam.getFrame(bgImg)
# Write to virtual camera
virtCam.write(cvtColor(noBgFrame, COLOR_BGR2YUV_I420))
# Display
stackFrame = cam.stackFrames(frame, noBgFrame)
if not cam.display(stackFrame):
break
In between the frame, noBgFrame setting and the virtCam write, you'd insert something like (i.e. not exactly this):
if settings.blur:
background = frame - noBgFrame
blurred = GausianBlur(background, settings.blurAmount)
noBgFrame += blurred
And of course make sure to run with no background provided
from bgrm.
Related Issues (14)
- Request: compile using nuitka HOT 4
- Error on Fedora 34: OSError: [Errno 25] Inappropriate ioctl for device HOT 1
- OSError:invalid argument on gentoo(again) HOT 5
- On wayland: could not connect to display HOT 3
- low fps when using HOT 2
- Inappropriate ioctl for device error HOT 7
- Not compatible with python 3.10 (current stable) HOT 3
- Current numpy/selected opencv won't install HOT 4
- reporting a few issues I have had on openSuse tumbleweed HOT 25
- Python 3.11 Support HOT 3
- Cannot install with pipx HOT 4
- Operands could not be brodcasted together HOT 5
- Error on gentoo : TypeError: unsupported operand type(s) for +: 'range' and 'list' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgrm.