Ask Your Question

Mattpiz's profile - activity

2019-05-02 04:09:13 -0600 edited question How to decode an image using Emscripten?

How to decode an image using Emscripten? Hi, I've been trying to use OpenCV as a dependency in an Emscripten project. Cu

2019-05-02 04:07:02 -0600 commented question How to decode an image using Emscripten?

Ok, so from reading parts of OpenCV.js tutorial, I realized that reading images was always done from already decoded dat

2019-05-01 03:10:51 -0600 received badge  Enthusiast
2019-04-30 17:04:05 -0600 commented question How to decode an image using Emscripten?

"main question i have here: why start from scratch ?" Ah yes, well I had already read the Build OpenCV.js tutorial

2019-04-30 16:54:13 -0600 commented question How to decode an image using Emscripten?

Ah yes, thanks for the correction. Regarding libopencv_imgcodecs.a I realized it was missing from build_wasm/lib, so I e

2019-04-30 16:53:04 -0600 edited question How to decode an image using Emscripten?

How to decode an image using Emscripten? Hi, I've been trying to use OpenCV as a dependency in an Emscripten project. Cu

2019-04-30 15:37:40 -0600 edited question How to decode an image using Emscripten?

How to decode an image using Emscripten? Hi, I've been trying to use OpenCV as a dependency in an Emscripten project. Cu

2019-04-30 14:21:12 -0600 asked a question How to decode an image using Emscripten?

How to decode an image using Emscripten? Hi, I've been trying to use OpenCV as a dependency in an Emscripten project. Cu

2019-04-29 08:31:15 -0600 asked a question Simple cmake usage for OpenCV as an emscripten dependency?

Simple cmake usage for OpenCV as an emscripten dependency? Currently, if I want to use OpenCV as an emscripten dependenc

2015-06-05 03:46:29 -0600 commented question Problem with Python bindings generation (in case of inheritance)

I don't understand, you suggest using something like an if statement and in case ${name} correspond to my module, I manually give the list of headers ?

2015-06-05 03:38:48 -0600 received badge  Editor (source)
2015-06-05 02:48:39 -0600 received badge  Student (source)
2015-06-05 02:48:21 -0600 asked a question Problem with Python bindings generation (in case of inheritance)

I am currently creating a module for OpenCV 3.0 and trying to make it work in Python. I think I found what seems to be a problem in how OpenCV create Python bindings but I don't know what is the best way to overcome the problem.

My problem is the following : I have 2 classes in my module folder (headers in modules/xvideo/include/opencv2/xvideo) which are : parentClass.hpp and childClass.hpp. Of course ChildClass inheriting from ParentClass (names are just for the example). But the script gen2.py (located in modules/python/src2) is trying to create ChildClass before ParentClass and end up with the error :

Generator error: unable to resolve base xvideo_ParentClass for xvideo_ChildClass

This seems to be because classes are generated in the order given from the variable srcfiles in the gen function of the script :

def gen(self, srcfiles, output_path):
    self.clear()
    self.parser = hdr_parser.CppHeaderParser()

    # step 1: scan the headers and build more descriptive maps of classes, consts, functions
    #print(srcfiles) ##matthieu
    for hdr in srcfiles:
        decls = self.parser.parse(hdr)
        if len(decls) == 0:
            #print(hdr + '0') ##matthieu
            continue
        #else: ##matthieu
            #print(hdr) ##matthieu
        self.code_include.write( '#include "{0}"\n'.format(hdr[hdr.rindex('opencv2/'):]) )
        for decl in decls:
            name = decl[0]
            if name.startswith("struct") or name.startswith("class"):
                # class/struct
                p = name.find(" ")
                stype = name[:p]
                name = name[p+1:].strip()
                self.add_class(stype, name, decl)
    ...

So I went upstream to find how this list is created. It appears, that list is the concatenation of sublists of each module, where each sublist is created by the CMake file cmake/OpenCVModule.cmake at line 626 :

file(GLOB lib_hdrs
    "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
    "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
    "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
)

But one might know that file(GLOB) has an indeterministic behaviour. And that's why my child class is before my parent class in that list, and ultimately raises an error.

So what I am asking is if someone knows the best way to bypass that problem ? Is there a way to specify ourself the list ? Or did I simply forgot to write something ? please enlighten me ^^

########## EDIT ##########

On your advice @StevenPuttemans I created an issue for it : http://code.opencv.org/issues/4384