Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-plugins-base gst-plugins-base
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 641
    • Issues 641
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 80
    • Merge requests 80
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gst-plugins-basegst-plugins-base
  • Merge requests
  • !626

WIP: Modify GstVideoFilter to filter a ROI

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Fabián Orccón requested to merge cfoch/gst-plugins-base:roieffect into master Apr 02, 2020
  • Overview 12
  • Commits 4
  • Pipelines 4
  • Changes 4

For now this is a WIP branch for #739 DO NOT MERGE. I would like someone can put an eye on it and give feedback, that is always helpful to at least know if I am going on the right way.

I have added a function gst_video_frame_cropped_map that given left, right, top, bottom values it maps a GstVideoFrame to just a section of the image.

For now, I am only supporting:

  • AYUV, RGB and GRAY colorspaces.
  • Buffers with GstVideoMeta in there.
  • base_transform->transform_ip (+)
  • base_transform->transform (but I think here there is something odd in my implementation) (++)

(+) base_transform->transform_ip vmethod support

Here an example applying a videobalance filter to gray out the detected face:

./cerbero-uninstalled run gst-launch-1.0 v4l2src ! videoconvert ! facedetect mouth-profile=haarcascade_mcs_mouth.xml eyes-profile=haarcascade_mcs_mouth-profile=haarcascade_mcs_mouth.xml display=false ! videoconvert ! videobalance saturation=0 only-roi=true ! videoconvert ! xvimagesink

Screenshot_from_2020-04-01_20-03-03

(++) base_transform->transform vmethod support

Here an example applying a videobalance filter to the detected face:

./cerbero-uninstalled run gst-launch-1.0 v4l2src ! videoconvert ! facedetect mouth-profile=haarcascade_mcs_mouth.xml eyes-profile=haarcascade_mcs_mouth-profile=haarcascade_mcs_mouth.xml display=false ! videoconvert ! videobalance warptv only-roi=true ! videoconvert ! xvimagesink

I think the filter in this case is not properly applied. While I am still not totally sure, I am more convinced that is wrongly applied.

Screenshot_from_2020-04-01_20-03-29

To get the xml files if you distribution of the opencv-contrib does not include it (in my case Fedora didn't include it) you can download the files from this link.

Edited Sep 24, 2021 by Tim-Philipp Müller
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: roieffect