Frei0r perspective filter usage
Antonio Ospite
ao2 at ao2.it
Thu Feb 2 07:47:54 UTC 2017
On Wed, 1 Feb 2017 14:27:54 -0800 (PST)
josvanr <josvanr at gmail.com> wrote:
> Hello!
>
Hi,
> I'm trying to de-perspective the images from my webcam with the frei0r
> perspective filter. I'm trying this:
>
> gst-launch -v v4l2src device=/dev/webcam1
> ! video/x-raw-yuv,width=1600,height=1200 ! ffmpegcolorspace
> ! frei0r-filter-perspective, top-left-X=0, top-left-Y=0,
> top-right-X=0.1, top-right-Y=0.1, bottom-left-X=0.2, bottom-left-Y=1,
> bottom-right-X=0.8, bottom-right-Y=1 ! ffmpegcolorspace ! xvimagesink
>
Apart from the fact that you should really update to GStreamer 1.x,
there are a couple of issues in the pipeline:
1. extra commas in the part referring to the frei0r-filter-perspective
element and its properties, remove them;
2. the X properties apparently need to be spelled with a lower case 'x'
(e.g. top-left-x instead of top-left-X and so on), not sure why this
is tho.
> There are no error massages, but there doesn't seem to be any
> perspectiving going on.
gst-launch-1.0 does give errors, update if you can.
> I'm not sure this is the way to invoke the filter. How do I find out
> how to do that?
gst-inspect-1.0 frei0r-filter-perspective
> I can remember looking at the sources a couple of years ago and thats
> how i came up with these parameters. But not sure if this is
> correct.....
This pipeline seems to work here:
gst-launch-1.0 -v \
videotestsrc ! \
videoconvert ! \
frei0r-filter-perspective \
top-left-x=0 \
top-left-Y=0 \
top-right-x=0.1 \
top-right-Y=0.1 \
bottom-left-x=0.2 \
bottom-left-Y=1 \
bottom-right-x=0.8 \
bottom-right-Y=1 ! \
videoconvert ! \
autovideosink
and BTW there is also a standard "perspective" element in GStreamer 1.x
which accepts a "matrix" property, IIRC it can only be set via source
code and not via gst-launch-1.0 but it's a more convenient form if you
are reusing a perspective matrix created by some other means (e.g.
OpenCV), check out "gst-inspect-1.0 perspective", and
https://git.ao2.it/experiments/gstreamer.git/blob/HEAD:/c/gst-perspective-example/gst-perspective-example.c
Ciao ciao,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
More information about the gstreamer-devel
mailing list