Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping add array operation, for additive blends. #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

f3z0
Copy link
Contributor

@f3z0 f3z0 commented Jun 20, 2014

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?

@peterbraden
Copy link
Owner

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?

@f3z0
Copy link
Contributor Author

f3z0 commented Jun 20, 2014

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:
Mat::row
Mat::col
Mat::rowRange
Mat::colRange
Mat::diag
Mat::clone
Mat::copyTo
Mat::convertTo
Mat::assignTo
Mat::setTo
Mat::reshape
Mat::t
Mat::inv
Mat::mul
Mat::cross
Mat::dot
Mat::zeros
Mat::ones
Mat::eye
Mat::create
Mat::addref
Mat::release
Mat::resize
Mat::reserve
Mat::push_back
Mat::pop_back
Mat::locateROI
Mat::adjustROI
Mat::operator()
Mat::operator CvMat
Mat::operator IplImage
Mat::total
Mat::isContinuous
Mat::elemSize
Mat::elemSize1
Mat::type
Mat::depth
Mat::channels
Mat::step1
Mat::size
Mat::empty
Mat::ptr
Mat::at
Mat::begin
Mat::end

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?)

@f3z0
Copy link
Contributor Author

f3z0 commented Jun 20, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants