projekte:vector_graphics_adapter_en

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
projekte:vector_graphics_adapter_en [2015/12/13 01:04] – angelegt da1l6projekte:vector_graphics_adapter_en [2017/03/01 19:19] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 {{ :projekte:vga-miku.jpg?direct&200|Vectorgraphics output on an Oscilosscope using the PC VGA Port}}==== VGA: Vector Graphics Adapter ==== {{ :projekte:vga-miku.jpg?direct&200|Vectorgraphics output on an Oscilosscope using the PC VGA Port}}==== VGA: Vector Graphics Adapter ====
  
-Using an Oscilloscope for Vector graphcis is propably an idea as old as the X/Y-Mode. Apart from  [[https://en.wikipedia.org/wiki/Lissajous_curve|Lissajous-Curves]] the PC soundcard has become a popular method for drawing [[https://www.youtube.com/watch?v=s1eNjUgaB-g|vector graphics on oscilloscopes]]. Left and right channel of the soundcard are connected to the x and y inputs of the scope to drive the electron beam.+Using an Oscilloscope for Vector graphcis is propably an idea as old as the X/Y-Mode. Apart from  [[https://en.wikipedia.org/wiki/Lissajous_curve|Lissajous-Curves]]the PC soundcard has become a popular method for drawing [[https://www.youtube.com/watch?v=s1eNjUgaB-g|vector graphics on oscilloscopes]]. Left and right channel of the soundcard are connected to the x and y inputs of the scope to drive the electron beam.
  
-While a sound card is essentiall a digital to analog converter, it also includes low pass filters and coupling capacitors for remving the DC part of the signal. This improve the audio quality and save your speakers from harmful DC. Howerver for our purpose it is harmful because the low pass filter limits the speed at which the beam can move and the loss of the DC offset makes the animation whobble around on the screen. The animation must be carefully designed to work around these limitations.+While a sound card is essentially a digital to analog converter, it also includes low pass filters and coupling capacitors for removing the DC part of the signal. This improve the audio quality and save your speakers from harmful DC. Howerverfor our purpose these are harmful because the low pass filter limits the speed at which the beam can move and the loss of the DC offset makes the animation whobble around on the screen. The animation must be carefully designed to work around these limitations.
 {{ :projekte:vga-scope-hallo-welt.png?180|Vector output using VGA}} {{ :projekte:vga-scope-hallo-welt.png?180|Vector output using VGA}}
  
-The solution comes from the other analog to digital converter still commonly found on modern PCs: The VGA-Port.+The solution comes from the other digital to analog converter still commonly found on modern PCs: The VGA-Port.
 While it may be intended to drive raster screens, it essentially a 3 Channel, High-speed (> 100MHz) DAC. While it may be intended to drive raster screens, it essentially a 3 Channel, High-speed (> 100MHz) DAC.
 Using 2 of these channels (Red and Green) the electron beam of an Oscolloscop can be driven in X and Y directions much like the soundcard method, but much faster and without the harmful filter stages. This makes it almost ideal for drawing vector graphics on a scope. Using 2 of these channels (Red and Green) the electron beam of an Oscolloscop can be driven in X and Y directions much like the soundcard method, but much faster and without the harmful filter stages. This makes it almost ideal for drawing vector graphics on a scope.
Zeile 22: Zeile 22:
       * 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.       * 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.
     - 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).     - 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 same filter 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 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 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.
Zeile 43: Zeile 43:
     * 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>     * 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>
     * 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>     * 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 t1 (bzw. low) and t2 (bzw. high) can depend on source video. Just try a few.+    * The optimal values for t1 (or low) and t2 (or high) can 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.
  
Zeile 58: Zeile 58:
 <code>/path/to/build/mpv --fs --geometry=<PRIMARY-MONITOR-WIDTH>:0 --loop --vf scale=256:256,vectorraster:width=2048:height=300 <VIDEO></code> <code>/path/to/build/mpv --fs --geometry=<PRIMARY-MONITOR-WIDTH>:0 --loop --vf scale=256:256,vectorraster:width=2048:height=300 <VIDEO></code>
  
 +==== Screen Capture ====
 +{{ :projekte:vga-scope-raster-smb1.jpg?200|}} mpv can capture the screen contents with the help of ffmpeg. This way it is possible to show screen contents (e.g. Games) on the oscilloscope screen.
 +
 +This works with both raster and pure vector mode. The Image on the right is made using raster mode.
 +
 +<code>/path/to/build/mpv av://x11grab::0 --demuxer-lavf-o='video_size=<WIDTH>x<HEIGHT>,grab_y=<XPOS>,grab_x=<YPOS>,framerate=30' ...</code>
 +
 +Video input devices like TV, Webcams and more can be accessed as well:
 +<code>/path/to/build/mpv tv:// ...</code>
  
 ===== Digital oscilloscopes ===== ===== Digital oscilloscopes =====
Zeile 75: Zeile 84:
   * Use a low memory depth (e.g. ~7kPoints).   * Use a low memory depth (e.g. ~7kPoints).
   * Try adjust the DSO sample rate to find the spot of minimal noise.   * Try adjust the DSO sample rate to find the spot of minimal noise.
 +
 +===== Our other VGA to Oscilloscope Projects =====
 +  * [[https://github.com/ands/vga2scope|An OpenCV-based video player/webcam video streamer]]
  
  • projekte/vector_graphics_adapter_en.1449968688.txt.gz
  • Zuletzt geändert: 2017/03/01 19:04
  • (Externe Bearbeitung)