Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
For you

Computer Vision
Results will update as you type.
  • Digital Signal Processing
  • Einfache Algorithmen
  • Image Processing
  • Kinect
  • Klassen
  • Leap
  • Linksammlung
  • Marker Tracking
  • OpenCV
  • Processing Keystone
  • Resolume Arena
  • Sound als Input
  • Vektoren
  • Video Processing
  • Video Library 2.0
  • Arduino Portenta H7 + Vision Shield

    Two hearts overlapped with each other
    Welcome back
    Catch up on the top discussions and highlights from your team.
    /
    Marker Tracking
    Updated Feb 17, 2017

    Marker Tracking

    Feb 17, 2017

    Neben der Auswertung von Bildern und dem Erkennen von Bestimmten Mustern, wie Farben oder Gesichtern kann ein Computer Vision Algorithmus auch so programmiert werden, dass er ein Bild auf das Vorhandensein eines bestimmten, einfachen, grafischen Markers untersucht. In diesem Fall spricht man auch von Marker Tracking. Marker Tracking existiert in unterschiedlichen Varianten. Die für uns am besten zu verwendenden sind das Tracking von sog. Fiducials und den sehr weit verbreiteten QR-Markern.

    QR-Codes

    Folgende Beispiele benutzen die diewald_barcode library um QR-Codes zu generieren und zu lesen.

    QR-Code Generieren
    import diewald_bardcode.*; import diewald_bardcode.CONSTANTS.*; int size = 500; String content = "http://iad.zhdk.ch"; void setup() { size(500, 500); EncodingResult result = Barcode.encode(content, ENCODE.QR_CODE, size, size, CHARACTER_SET.DEFAULT, ERROR_CORRECTION.DEFAULT); if(result.encodingFailed()) { println( result.getEncodingException() ); } else { result.setBgColor(255, 255, 255, 255); result.setCodeColor(0, 0, 0, 255); PImage barcode = result.asImage(this); if (barcode != null) { image(barcode, 0, 0); barcode.save("qrcode.jpg"); } } } void draw() {}
    QR-Code Lesen
    import diewald_bardcode.*; import diewald_bardcode.CONSTANTS.*; import processing.video.*; Capture video; void setup() { size(640, 480); video = new Capture(this, 640, 480, 30); video.start(); } void draw() { if (video.available()) { background(0); video.read(); image(video, 0, 0); // DecodingResult result = Barcode.decodeMulti(video, CHARACTER_SET.DEFAULT, true, DECODE.values()); DecodingResult result = Barcode.decode(video, CHARACTER_SET.DEFAULT, true, DECODE.QR_CODE); // DecodingResult result = Barcode.decode(video, CHARACTER_SET.DEFAULT, true, DECODE.CODE_128); if (!result.decodingFailed()) { PVector center = getCenter(result); float rotation = getRotation(result); pushMatrix(); translate(center.x, center.y); rotate(rotation); stroke(0); strokeWeight(2); ellipse(0, 0, 50, 50); line(0, 0, -25, 0); popMatrix(); println(degrees(rotation)); } } } PVector getCenter(DecodingResult result) { PVector returnVector = new PVector(0, 0); for (int i = 0; i < result.getCorners ().length; i++) { returnVector.x += result.getCorners()[i].x; returnVector.y += result.getCorners()[i].y; } returnVector.x /= result.getCorners().length; returnVector.y /= result.getCorners().length; return returnVector; } float getRotation(DecodingResult result) { PVector p1 = new PVector(result.getCorners()[0].x, result.getCorners()[0].y); PVector p2 = new PVector(result.getCorners()[1].x, result.getCorners()[1].y); PVector p3 = p2.sub(p1); return p3.heading()+PI/2; }

    Fiducials

    Mehr Infos zum lesen von Fiducials findest du hier.



    {"serverDuration": 16, "requestCorrelationId": "e579228805484a0ab95ce4bb10684419"}