No Chroma Keying with Gstreamer Alpha Plugin

Hi Honey_Patouceul,
thank you for your detailed explanations and for your offer to help me. I think the best solution will be nvivafilter, as you suggested. I will first read up and then like to come back to your offer.
Best regards,
Wilhelm

R-Pi4 with Ubuntu 18 has the same issue.

https://forum-raspberrypi.de/forum/thread/44691-ubuntu-19-10-auf-raspi-4/?postID=400937#post400937

@ Nvidia, the best solution would be nv-alpha.
Best regards,
Wilhelm

Hi,
We will review the request of nv-alpha implementation. Thanks.

1 Like

Thank you very much!
Best regards,
Wilhelm

hi all,
i actually discovered the same bug.
i am glad that wisi-tespilot described it here with all details and suggested fixing by developers.
i would love to get a notice here it here is any progress.
so i subscribed to the forum and this thread, hoping it is still alive…

regards,
toz

—not to forget: credits for the workaround for Honey_Patouceul

Hi toz,
I have programmed it with Python3 and Opencv. Finally it is easier to select the colour in the hsv colour space than in the rgb colour space of gstreamer.
Best regards,
Wilhelm

hsv = cv2.cvtColor(vishd, cv2.COLOR_BGR2HSV)
grasmaske = cv2.inRange(hsv, (30,20,0), (75,255,255))
inv_grasmaske = cv2.bitwise_not(grasmaske)

Hi,
Thank you for your effort to make alpha plugin works.
I have the same issue.
So, I look into commit log of GitHub - GStreamer/gst-plugins-good: 'Good' GStreamer plugins and helper libraries. This module has been merged into the main GStreamer repo for further development..
After I modified as the commit below.
It’s working better.
I hope it helps.

Author: Doug Nazar nazard@nazar.ca 2019-09-09 09:43:17
Committer: Doug Nazar nazard@nazar.ca 2019-09-09 13:51:53
Parent: 0a6a62aa7652f0b5a689d4cecbc031b763c2000a (docs: Port all docstring to gtk-doc markdown)
Child: 37c619f9954045602a61daf4bceff4cd0e4f70cf (plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types)
Branches: master, remotes/origin/1.18, remotes/origin/master
Follows: 1.16.0
Precedes: 1.17.1

alpha: Fix one_over_kc calculation

On arm/aarch64, converting from float directly to unsigned int uses
a different opcode and negative numbers result in 0. Cast to
signed int first.

----------------------------- gst/alpha/gstalpha.c -----------------------------
index 867e000…4a37b01 100644
@@ -2349,7 +2349,7 @@ gst_alpha_init_params_full (GstAlpha * alpha,
tmp = MIN (tmp, 255);
alpha->accept_angle_ctg = tmp;
tmp = 1 / (kgl);

  • alpha->one_over_kc = 255 * 2 * tmp - 255;
  • alpha->one_over_kc = (gint) (255 * 2 * tmp - 255);
    tmp = 15 * y / kgl;
    tmp = MIN (tmp, 255);
    alpha->kfgy_scale = tmp;
2 Likes

Thank you very much for the info.
Good to know.
Best regards,
Wilhelm