Code Monkey home page Code Monkey logo

Comments (4)

berak avatar berak commented on May 19, 2024

due to the Algorithm removal, a new BasicFaceRecognizer class was introduced there, but it seems, the python wrappers can't handle more than one level of inheritance.

(btw, the java wrappers (currently not enabled) work fine !)

from opencv_contrib.

mshabunin avatar mshabunin commented on May 19, 2024

Looks like this problem only exists for modules inside nested namespaces. I've checked cv::StereoBM -> cv::StereoMatcher -> cv::Algorithm, and it works as expected, i.e. creates full inheritance chain and all parent methods.

class StereoBM(StereoMatcher)
 |  Method resolution order:
 |      StereoBM
 |      StereoMatcher
 |      Algorithm
 |      __builtin__.object

Nested modules members (I've checked ml and face) are shown like first level objects:

class ml_Boost(__builtin__.object)

I'll take a look into generator script to see how it can be fixed.

from opencv_contrib.

mshabunin avatar mshabunin commented on May 19, 2024

@berak, can you, please, check if the issue has been fixed for you with the latest master version (opencv + contrib)?

from opencv_contrib.

berak avatar berak commented on May 19, 2024

yes, excellent, works now, thanks a lot !


>>> help(cv2.face)
Help on module cv2.face in cv2:

NAME
    cv2.face

FILE
    (built-in)

FUNCTIONS
    createEigenFaceRecognizer(...)
        createEigenFaceRecognizer([, num_components[, threshold]]) -> retval

    createFisherFaceRecognizer(...)
        createFisherFaceRecognizer([, num_components[, threshold]]) -> retval

    createLBPHFaceRecognizer(...)
        createLBPHFaceRecognizer([, radius[, neighbors[, grid_x[, grid_y[, thres
hold]]]]]) -> retval


>>> fr = createEigenFaceRecognizer()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'createEigenFaceRecognizer' is not defined
>>> fr = cv2.face.createEigenFaceRecognizer()
>>> help(fr)
Help on face_BasicFaceRecognizer object:

class face_BasicFaceRecognizer(face_FaceRecognizer)
 |  Method resolution order:
 |      face_BasicFaceRecognizer
 |      face_FaceRecognizer
 |      Algorithm
 |      __builtin__.object
 |
 |  Methods defined here:
 |
 |  __repr__(...)
 |      x.__repr__() <==> repr(x)
 |
 |  getEigenValues(...)
 |      getEigenValues() -> retval
 |
 |  getEigenVectors(...)
 |      getEigenVectors() -> retval
 |
 |  getLabels(...)
 |      getLabels() -> retval
 |
 |  getMean(...)
 |      getMean() -> retval
 |
 |  getNumComponents(...)
 |      getNumComponents() -> retval
 |
 |  getProjections(...)
 |      getProjections() -> retval
 |
 |  getThreshold(...)
 |      getThreshold() -> retval
 |
 |  setNumComponents(...)
 |      setNumComponents(val) -> None
 |
 |  setThreshold(...)
 |      setThreshold(val) -> None
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __new__ = <built-in method __new__ of type object>
 |      T.__new__(S, ...) -> a new object with type S, a subtype of T
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from face_FaceRecognizer:
 |
 |  getLabelInfo(...)
 |      getLabelInfo(label) -> retval
 |
 |  getLabelsByString(...)
 |      getLabelsByString(str) -> retval
 |
 |  load(...)
 |      load(filename) -> None
 |
 |  predict(...)
 |      predict(src) -> label, confidence
 |
 |  save(...)
 |      save(filename) -> None
 |
 |  setLabelInfo(...)
 |      setLabelInfo(label, strInfo) -> None
 |
 |  train(...)
 |      train(src, labels) -> None
 |
 |  update(...)
 |      update(src, labels) -> None

trying on vs2008 (!) i encountered another tiny issue:
it tried to wrap e:\code\opencv\modules\objdetect\include\opencv2\objdetect\detection_based_tracker.hpp , and the class is #idef'ed out (because no threading available).

the wrapper ofc. is not able to see the #ifdefs there, and it failed to compile/link.

adding the header to the blacklist in opencv\modules\python\common.cmake( ~line 31), like:

 ocv_list_filterout(opencv_hdrs "detection_based")

fixed this locally.

from opencv_contrib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.