Skip to content

Instantly share code, notes, and snippets.

@jungbin-kim jungbin-kim/index.html

Last active Oct 3, 2018
Embed
What would you like to do?
Check OpenCV JS Object HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Check OpenCV JS Object</title>
</head>
<body>
<div id="textDiv">Loading...</div>
<script src="./js/opencv.js"></script>
<script>
cv['onRuntimeInitialized']=()=>{
opencvIsReady();
};
function opencvIsReady() {
console.log('OpenCV.js is ready');
let div = document.getElementById("textDiv");
let opencvBindingText =
'<table style="width:100%">' +
'<tr><th>CV Name</th><th>JS</th></tr>' +
'<tr><td>cv.ORB</td><td>' + variableToString(cv.ORB) + '</td></tr>' +
'<tr><td>cv.BFMatcher</td><td>' + variableToString(cv.BFMatcher) + '</td></tr>' +
'<tr><td>cv.NORM_HAMMING</td><td>' + variableToString(cv.NORM_HAMMING) + '</td></tr>' +
'<tr><td>cv.imread</td><td>' + variableToString(cv.imread) + '</td></tr>' +
'<tr><td>cv.imshow</td><td>' + variableToString(cv.imshow) + '</td></tr>' +
'<tr><td>cv.drawKeypoints</td><td>' + variableToString(cv.drawKeypoints) + '</td></tr>' +
'<tr><td>cv.drawMatches</td><td>' + variableToString(cv.drawMatches) + '</td></tr>' +
'<tr><td>cv.Mat</td><td>' + variableToString(cv.Mat) + '</td></tr>' +
'<tr><td>cv.cvtColor</td><td>' + variableToString(cv.cvtColor) + '</td></tr>' +
'<tr><td>cv.Scalar</td><td>' + variableToString(cv.Scalar) + '</td></tr>' +
'<tr><td>cv.CharVector</td><td>' + variableToString(cv.CharVector) + '</td></tr>' +
'<tr><td>cv.DMatch</td><td>' + variableToString(cv.DMatch) + '</td></tr>' +
'<tr><td>cv.DMatchVector</td><td>' + variableToString(cv.DMatchVector) + '</td></tr>' +
'<tr><td>cv.DMatchVectorVector</td><td>' + variableToString(cv.DMatchVectorVector) + '</td></tr>' +
'<tr><td>cv.KeyPoint</td><td>' + variableToString(cv.KeyPoint) + '</td></tr>' +
'<tr><td>cv.KeyPointVector</td><td>' + variableToString(cv.KeyPointVector) + '</td></tr>' +
'<tr><td>cv.KeyPointVectorVector</td><td>' + variableToString(cv.KeyPointVectorVector) + '</td></tr>' +
'<tr><td>cv.findHomography</td><td>' + variableToString(cv.findHomography) +
'</table>'
;
div.innerHTML = opencvBindingText;
}
function variableToString(val) {
if (val === undefined) return 'undefined';
return val.toString().split("{")[0];
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.