Wrapping add array operation, for additive blends. #144
Wrapping add array operation, for additive blends. #144f3z0 wants to merge 2 commits intopeterbraden:masterfrom
Conversation
|
I'm interested in where you're going with this. For a lot of the Matrix stuff, I stuck more closely to the C++ API. I also looked at the python bindings to see how they interpreted them. One concern I had was that the sheer number of methods in the OpenCV API might make the OpenCV object unwieldy without some level of namespacing, but I'm not sure if this is a good idea. What do you think? |
|
I could be missing something because I've only been looking at the opencv lib since this weekend but from the docs it looks like the matrix object is limited to: These methods seem to be geared at easily accessing, updating the points and defining/finding regions. What would be most ideal, from my perspective, is to be able to run C++ tutorial code within the node environment with only very minor syntax sugar corrections (e.g switch named types to var, pointer lookups from -> to . and so fourth). Also this will allow existing C++ client code to be web ported safely. Unless I'm missing something, the current node implementation has moved the pixel based array operations from static methods to matrix instance methods, which would require some careful planning for someone to port from c++ to node (this might not be a bad thing though). Is your primary concern regarding how V8 will handle with such a large object or project maintenance (JS or C++ side?) |
|
Actually still thinking about this, it does seem odd that the c++ functions aren't part of the matrix class as you have them, since all the operations require / act on a matrix instances. It's like they weren't sure if they wanted to be object oriented or functional so it's somewhere in between. |
Proceeding with the notion that 1-to-1 match with C API is most ideal, I made 'add' a static member of the OpenCV class so it can be access cv.add(..). I added a new class MatOp, short for math operations, in a effort to organise in a similar fashion the C api as well, do you think it's a good idea to split the functions out like this?