-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about an alpha channel? #6
Comments
my major hurdle so far is allocating new memory for the a lot of the problem (and resources) is colorspace conversion, if I can allocate new memory and put the RGBA in there, and set the but so far i couldn't get the mem allocation down. i need to do some more research but you're welcome to try it.. |
I'll take a look when I have some time. I just wanted to check if you had looked at it. Good to know that the color space conversion is the challenge. Feel free to close this one out. |
Hi @royshil. First thanks for building this plugin, it works really well! As @troypesola suggested, I'm too trying to create an alpha output directly from obs-backgroundremoval plugin. Using it together with Chroma Key creates a "color border" effect when I try to make smooth edges. I already have a working development setup and made some modifications to I'm new to obs plugin development (actually only a few hours) and tried a few combinations of video formats on If you have time, can you point the modifications necessary to make it work from a obs-plugin perspective? By this time I'm not concerned about memory issues, as you point out in a previous comment. But I'll take it in consideration if I submit a PR. Best regards! |
@brunodoamaral I think the new built in scalers can do this very easily. The mem allocation is trivial. |
@royshil thanks for your fast response. I added a new feature for mask offset (it uses morphological operation to dilate or erode the mask). Combined with the feather feature, it create a nice fade affect. |
@troypesola @brunodoamaral You can get a transparent background out of this plugin by placing video source in it's own scene, adding the plugin as a filter, then placing that scene in your scene and filtering that with the ChromaKey filter. |
Hi, @royshil ! First of all, thank you for the wonderful plugin! Do you still have plans of implementing the alpha channel? That would be an awesome feature because it would allow smoother contours with transparent backgrounds. Currently when using a chroma key filter that's not possible because the contour would get tinted with the color used for the chroma key. |
@mhcerri I'm working on the alpha channel right now as well as a 27.1.3 (latest) OBS version |
* Add obs-plugintemplate files (#1) * Add obs-plugintemplate files * Rename * Update CMakeLists.txt * Update main.yml * files * Update CMakeLists.txt * Fix * Update .Brewfile * Update main.yml * Update main.yml * check-cmake.sh * Update main.yml * Update main.yml * Build my opencv (#2) * BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * check-cmake * Update main.yml * Update buildspec.json * Update CMakeLists.txt * Build my onnxruntime (#3) * fix * Update BuildMyOnnxruntime.cmake * Enable arm64 * 0.5.2 * Update BuildMyOnnxruntime.cmake * Update .Brewfile * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * fix * Fix * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * a * Create .gitmodules * Create onnxruntime * Update onnxruntime * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * fix * Update BuildMyOnnxruntime.cmake * ARCHITECTURE * Apply * Update BuildMyOnnxruntime.cmake * fix * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * aaa * Enable Windows build (#4) * Enable Windows build * Update main.yml * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Fix linkage * Remove /WX * Update ObsPluginHelpers.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update CMakeLists.txt * Fix * Update CMakeLists.txt * a * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Disable DML * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update background-filter.cpp * Update BuildMyOnnxruntime.cmake * Disable DML * Fix segfault (#6) * Update Model.h * 0.5.6 * Ccache macos (#8) * Ccache * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Revert "Update BuildMyOnnxruntime.cmake" This reverts commit 44d9caa. * Revert "Update BuildMyOnnxruntime.cmake" This reverts commit 9294106. * Direct ml (#7) * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * dml * 0.5.7 * Update CMakeLists.txt * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * a * Update main.yml * Update BuildMyOnnxruntime.cmake * Update main.yml * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Fix * Update BuildMyOnnxruntime.cmake * Update main.yml * Linux build (#9) * linux * 0.5.8 * Update BuildMyOnnxruntime.cmake * Update setup_ccache (#10) * bump version (#11) * Use ninja on windows (#12) * Update main.yml * Update main.yml * Use Ninja * Update BuildMyOnnxruntime.cmake * Update main.yml * ccache * Update BuildMyOpenCV.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update BuildMyOnnxruntime.cmake * Update main.yml * Update main.yml * Update CMakeLists.txt * Update BuildMyOnnxruntime.cmake * Long path * Update main.yml * Update BuildMyOnnxruntime.cmake * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Update BuildMyOnnxruntime.cmake * Windows opencv ccache (#13) * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update BuildMyOpenCV.cmake * Update main.yml * Update BuildMyOpenCV.cmake * bump 0.5.10 (#14) * Cleanup (#15) * Cleanup * bump version * Fix ep (#16) * Update BuildMyOnnxruntime.cmake * Update BuildMyOpenCV.cmake * Update main.yml (#18) * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * 0.5.12 * Fix * Update package-macos.zsh * Update package-linux.zsh * Update CMakeLists.txt * ci * Fix * Update background-filter.cpp * Fix * clang-format * cmake-format * Update BuildMyOpenCV.cmake * Update BuildMyOnnxruntime.cmake * Fix errors * Use -isystem * Use list in set_target_properties * INTERFACE_INCLUDE_DIRECTORIES must be on IMPORTED TARGET * Update ObsPluginHelpers.cmake
Did you test out adding transparency with an alpha channel instead of setting the color?
There is an Alpha YUV format. So it seems like it wouldn't be too hard to add a parameter for transparency, convert to an AYUV, apply the mask, then convert back to the proper output format.
Thoughts? I can fork and give it a shot, but wanted to see if you had tried going direct to transparent already.
The text was updated successfully, but these errors were encountered: