Skip to content

Instantly share code, notes, and snippets.

@SnosMe
Created November 4, 2023 12:26
Show Gist options
  • Save SnosMe/45d221ee1ac866447d7415e41c3db5c0 to your computer and use it in GitHub Desktop.
Save SnosMe/45d221ee1ac866447d7415e41c3db5c0 to your computer and use it in GitHub Desktop.
Building OpenCV for APT
# Classes and methods whitelist
core = {
'': [
'absdiff', 'add', 'addWeighted', 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'cartToPolar',
'compare', 'convertScaleAbs', 'copyMakeBorder', 'countNonZero', 'determinant', 'dft', 'divide', 'eigen',
'exp', 'flip', 'getOptimalDFTSize','gemm', 'hconcat', 'inRange', 'invert', 'kmeans', 'log', 'magnitude',
'max', 'mean', 'meanStdDev', 'merge', 'min', 'minMaxLoc', 'mixChannels', 'multiply', 'norm', 'normalize',
'perspectiveTransform', 'polarToCart', 'pow', 'randn', 'randu', 'reduce', 'repeat', 'rotate', 'setIdentity', 'setRNGSeed',
'solve', 'solvePoly', 'split', 'sqrt', 'subtract', 'trace', 'transform', 'transpose', 'vconcat',
'setLogLevel', 'getLogLevel', 'findNonZero'
],
'Algorithm': [],
}
imgproc = {
'': [
'cvtColor',
'matchTemplate',
'rectangle',
'resize',
'threshold',
'pyrDown',
],
}
objdetect = {
'': ['groupRectangles'],
}
white_list = makeWhiteList([core, imgproc, objdetect])
# git clone https://github.com/opencv/opencv.git --depth 1 --branch 4.7.0
# cd ./opencv
podman run --rm -v $(pwd):/src -u $(id -u):$(id -g) docker.io/emscripten/emsdk \
emcmake python3 ./platforms/js/build_js.py build_js --build_wasm --simd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment