LumiGuide / haskell-opencv

Haskell binding to OpenCV-3.x
Other
154 stars 44 forks source link

`ArraysOfArrays` and `std::vector<Mat>` #42

Closed tolysz closed 8 years ago

tolysz commented 8 years ago

I would like to implement some more of Computational Photography But as a starter, they need to have some more complicated inputs eg. as std::vector<Mat>

So I guess if we could have [Mat] converted into std::vector<Mat> any ideas how to do it?

I will try the same way as : matMerge

basvandijk commented 8 years ago

withArrayPtr is probably the function you need.

I'm looking forward to you pull requests!

tolysz commented 8 years ago

So the current version "best" way will is to initialise std::vector from array I still think there could be less copying, but it can do for now,

basvandijk commented 8 years ago

It would be great if we had a way with less copying.

BTW I might be missing something but shouldn't the buffer be initialised using:

std::vector<Mat> buffer( $(Mat * srcVecPtr), $(Mat * srcVecPtr) + $(int32_t c'temporalWindowSize) * sizeof(Mat));

instead of your current:

std::vector<Mat> buffer( $(Mat * srcVecPtr), $(Mat * srcVecPtr) + $(int32_t c'temporalWindowSize) );
basvandijk commented 8 years ago

Please ignore my previous comment. Adding to a pointer already takes the pointer type into account. I shouldn't review code late in the evening after having consumed alcohol on a holiday in Spain...

basvandijk commented 8 years ago

There's nothing left to do here right?