A port of https://github.com/tonywry/Credit-Card-Number-Recognition to opencv.js as a proof of concept for reading credit card numbers
start using npx live-server
in this folder
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h2>Hello OpenCV.js</h2> | |
<div> | |
<div class="inputoutput"> | |
<img id="imageSrc" src="barclays-bank_card.jpg" alt=""> | |
</div> | |
<div class="inputoutput"> | |
<canvas id="canvasOutput" ></canvas> | |
<div class="caption">canvasOutput</div> | |
</div> | |
</div> | |
<script async src="https://docs.opencv.org/3.4.0/opencv.js" onload="cvread();" type="text/javascript"></script> | |
<script src="script.js"></script> | |
</body> | |
</html> |
A port of https://github.com/tonywry/Credit-Card-Number-Recognition to opencv.js as a proof of concept for reading credit card numbers
start using npx live-server
in this folder
(function (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(function () { | |
return (root.cv = factory()); | |
}); | |
} else if (typeof module === 'object' && module.exports) { | |
// Node. Does not work with strict CommonJS, but | |
// only CommonJS-like environments that support module.exports, | |
// like Node. | |
module.exports = factory(); | |
} else if (typeof window === 'object') { | |
// Browser globals | |
root.cv = factory(); | |
} else if (typeof importScripts === 'function') { | |
// Web worker | |
root.cv = factory; | |
} else { | |
// Other shells, e.g. d8 | |
root.cv = factory(); | |
} | |
}(this, function () { | |
var cv = (function() { | |
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; | |
return ( | |
function(cv) { | |
cv = cv || {}; | |