“Detektor Kode QR” Kode Jawaban

Detektor Kode QR

    import cv2
    decoder = cv2.QRCodeDetector()
    data, points, _ = decoder.detectAndDecode(img) # size 250 * 250 np.array
    qr_code = data
    print('Decoded data: ' + data)
    if points is not None:
        print('Decoded data: ' + data)
    
        points = points[0]
        for i in range(len(points)):
            pt1 = [int(val) for val in points[i]]
            pt2 = [int(val) for val in points[(i + 1) % 4]]
            cv2.line(img, pt1, pt2, color=(255, 0, 0), thickness=3)
    
        cv2.imshow('Detected QR code', img)
Evil Echidna

KODE QR

let scanner = new Instascan.Scanner({
  video: document.getElementById('preview'),
  mirror: false
});

Instascan.Camera.getCameras().then(function(cameras) {
  if (cameras.length > 0) {
    scanner.start(cameras[0]);
  } else {
    console.error('No cameras found.');
    alert('No cameras found.');
  }
}).catch(function(e) {
  console.error(e);
  alert(e);
});


$(function() {
  const re = /(\d+-\d+)\s+(.*)/;
  scanner.addListener('scan', function(content) {
    console.log(content);
    if (!re.test(content)) {
      console.log("malformed strings")
      return;
    }
    const [_, id, name] = content.match(re);
    $(".idnum").val(id);
    $(".idname").val(name.trim());
  });
})
Annoying Alligator

Jawaban yang mirip dengan “Detektor Kode QR”

Pertanyaan yang mirip dengan “Detektor Kode QR”

Lebih banyak jawaban terkait untuk “Detektor Kode QR” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya