projekte:vector_graphics_adapter_en

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
projekte:vector_graphics_adapter_en [2015/12/16 18:30] – [Software operation] da1l6projekte:vector_graphics_adapter_en [2024/12/30 12:18] (aktuell) da1l6
Zeile 17: Zeile 17:
 ==== Software operation ==== ==== Software operation ====
   * The vectorization is implemented as a set of [[https://mpv.io/|mpv]] video filters.   * The vectorization is implemented as a set of [[https://mpv.io/|mpv]] video filters.
-  * I made a [[https://github.com/da1l6/mpv|fork of mpv]] which contains these filters.+  * I made a [[https://gitlab.warpzone.ms/da1l6/vga|fork of mpv]] which contains these filters.
     - The input video (or image) is passed through the [[https://en.wikipedia.org/wiki/Canny_edge_detector|Canny edge detector]]     - The input video (or image) is passed through the [[https://en.wikipedia.org/wiki/Canny_edge_detector|Canny edge detector]]
-      * The fork contains a canny filter that uses the [[http://opencv.org/|OpenCV]]-Canny implementation (--vf canny). +    - The edgedetect filter from ffmpeg/libavfilter is used (-vf lavfi=edgedetect) to extract edges from the image
-      * The edgedetect filter from ffmpeg/libavfilter can also be used (-vf lavfi=edgedetect). This gives slightly better results but only works with ffmpeg, not libav+    - Following the edge detection a second filter is used to extract the contours from the image. The FindContours function from openCV takes the image and extracts its contours as paths of vectors (--vf vector).
-    - Follwing the edge detection a second filter is used to extract the contours from the image. The FindContours function from openCV takes the image and extracts its contours as paths of vectors (--vf vector).+
   * The vector filter also iterates over these paths to create a "vector image". In this image the red and green color channels of each pixel contain the coordinates of the edge path vectors.   * The vector filter also iterates over these paths to create a "vector image". In this image the red and green color channels of each pixel contain the coordinates of the edge path vectors.
-    * The availiable "pixels" of the vector image are distributed among the vectors to draw by writing the same value multiple times. This ensures the entire image and thus VGA scanout time is used.+    * The available "pixels" of the vector image are distributed among the vectors to draw by writing the same value multiple times. This ensures the entire image and thus VGA scanout time is used.
     * The ffmpeg edgedetect filter provides an intensity value in its output depending on how sharp an edge is.     * The ffmpeg edgedetect filter provides an intensity value in its output depending on how sharp an edge is.
       * This is used to give more vector image "pixels" to more prominent edges to make them brighter on the scope output.       * This is used to give more vector image "pixels" to more prominent edges to make them brighter on the scope output.
-      * Less prominent edges get less scanout time and will apear dimmer because the electron beam moves over these spots more quickly.+      * Less prominent edges get less scanout time and will appear dimmer because the electron beam moves over these spots more quickly.
       * This method works without the use of a dedicated intensity (Z) input on the oscilloscope.       * This method works without the use of a dedicated intensity (Z) input on the oscilloscope.
   * A problem of using the VGA port is the blanking periods during which the VGA Port will output 0 volts on all channels and thus move the electron beam to the lower left corner of the scope screen.   * A problem of using the VGA port is the blanking periods during which the VGA Port will output 0 volts on all channels and thus move the electron beam to the lower left corner of the scope screen.
-    * A bright dot appears there and can potentially damage the phosphor coating of the CRT. It should be moved outside the visible area using the horizonal/vertical controls of the scope.+    * A bright dot appears there and can potentially damage the phosphor coating of the CRT. It should be moved outside the visible area using the horizontal/vertical controls of the scope.
   * Example vector image for direct output on the VGA port: {{:projekte:vga-scope-vector-image.png?800|Example vector image}}   * Example vector image for direct output on the VGA port: {{:projekte:vga-scope-vector-image.png?800|Example vector image}}
  
Zeile 37: Zeile 36:
 xrandr --addmode VGA1 scope xrandr --addmode VGA1 scope
 xrandr --output VGA1 --mode scope --right-of <PRIMARY-MONITOR></code> xrandr --output VGA1 --mode scope --right-of <PRIMARY-MONITOR></code>
-  * ffmpeg is needed (libav lacks the edgedetect filter) +  * ffmpeg is needed 
-  * opencv is also needed +  * opencv3 is also needed 
-  * The modified mpv media player with the custom filters can retrived with ''git clone https://github.com/da1l6/mpv''+  * The modified mpv media player with the custom filters can retrived with ''git clone https://gitlab.warpzone.ms/da1l6/vga.git''
   * Example usage command:   * Example usage command:
-    * With ffmpeg edge detection:<code>/path/to/build/mpv --fs --geometry=<WIDTH-PRIMARY-MONITOR>:0 --loop --vf scale=576:512,lavfi=[edgedetect=high=0.04:low=0.03],vector:width=2048:height=200 <VIDEO></code> +    <code>/path/to/build/mpv --fs --geometry=<WIDTH-PRIMARY-MONITOR>:0 --loop --vf scale=576:512,lavfi=[edgedetect=high=0.04:low=0.03],vector:width=2048:height=200 <VIDEO></code> 
-    * With openCV edge detection:<code>/path/to/build/mpv --fs --geometry=<WIDTH-PRIMARY-MONITOR>:0 --loop --vf scale=576:512,canny:t1=128:t2=130,vector:width=2048:height=200 <VIDEO></code> +    * The optimal values for low and high can depend on video source. Just try a few.
-    * The optimal values for t1 (bzw. lowand t2 (bzw. highcan depend on source video. Just try a few.+
     * The canny edge detection is a CPU hog. Because of this ''--vf scale:w:h'' is used to scale down the image before running it.     * The canny edge detection is a CPU hog. Because of this ''--vf scale:w:h'' is used to scale down the image before running it.
  
  • projekte/vector_graphics_adapter_en.1450290647.txt.gz
  • Zuletzt geändert: 2017/03/01 19:04
  • (Externe Bearbeitung)