huningxin / opencv

Open Source Computer Vision Library
opencv.org
Apache License 2.0
21 stars 11 forks source link

[ImgProc] some functions should be in the white list #76

Closed ganwenyao closed 7 years ago

ganwenyao commented 7 years ago
Function Name Location
cv.getRotationMatrix2D() Geometric Transformations
cv.getPerspectiveTransform() Geometric Transformations
cv.filter2D() Smoothing Images
cv.morphologyEx() Morphological Transformations
cv.getStructuringElement() Morphological Transformations
cv.convertScaleAbs() Image Gradients
cv.isContourConvex() Contours
cv.minAreaRect() Contours
cv.minEnclosingCircle() Contours
cv.fitLine() Contours
cv.minMaxLoc() Contours
cv.convexityDefects() Contours
cv.pointPolygonTest() Contours
cv.matchShapes() Contours
cv.createCLAHE() Histograms
cv.dft() Image Transforms
cv.getOptimalDFTSize() Image Transforms
cv.HoughLines() Hough Transform
cv.HoughLinesP() Hough Transform
cv.HoughCircles() Hough Transform
huningxin commented 7 years ago

@ganwenyao , thanks for reporting this issue. Could you please specify the usages or references to python tutorials which are using these functions?

ganwenyao commented 7 years ago

@huningxin

huningxin commented 7 years ago

As discussed in sync meeting, we will expose them. Let's follow up like this:

  1. @huningxin will implement them in binding and report the file size difference.
  2. @ganwenyao , please mark these functions in the google spreadsheet with specific color and notes in a column.
  3. @sajjadt , please follow up with Vadim about these new functions.
huningxin commented 7 years ago

opencv.js size without and with these functions: 7039927 vs. 7211107 bytes

It increases about 167 KB.

huningxin commented 7 years ago

minEnclosingCircle is tricky, as http://docs.opencv.org/3.2.0/d3/dc0/group__imgproc__shape.html#ga8ce13c24081bbc7151e9326f412190f1, the third parameter is float& which returns the radius. However, according to https://github.com/kripken/emscripten/issues/611, embind doesn't support the non-const ref out parameters.

We may need to provide a wrapper to change the API signature in JS. Track it by https://github.com/huningxin/opencv/issues/126

huningxin commented 7 years ago

Similar issue to minMaxLoc http://docs.opencv.org/3.2.0/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707, it uses double* as return value. It's unfriendly for JS developer to provide the emscripten pointer to this API.

We may need to provide a wrapper to change the API signature in JS. Track it by https://github.com/huningxin/opencv/issues/127

huningxin commented 7 years ago

createCLAHE will be exposed as constructor of CLAHE object.

ganwenyao commented 7 years ago

These functions are marked with red color in the following google spreadsheet: https://docs.google.com/spreadsheets/d/1BGsasC0Afd_sS2lljt7GVx1cl8VUwAfBlVtddtXsfYM/edit?usp=sharing