www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D bindings for OpenCV

reply "TJSomething" <tjbk123 gmail.com> writes:
I know this has been asked a few times before, but that was a few 
years ago. Are there any reasonably complete and up to date 
OpenCV bindings for D?

If not, are there any reasonably easy ways to generate them? I 
tried SWIG and it choked on some of the macros they used, though 
that may have been because I had no idea what I was doing.
Oct 15 2013
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 15 October 2013 at 19:20:10 UTC, TJSomething wrote:
 I know this has been asked a few times before, but that was a 
 few years ago. Are there any reasonably complete and up to date 
 OpenCV bindings for D?

 If not, are there any reasonably easy ways to generate them? I 
 tried SWIG and it choked on some of the macros they used, 
 though that may have been because I had no idea what I was 
 doing.
Dammit, when I saw the title I thought someone was announcing they'd made one. I don't know of anyone.
Oct 15 2013
prev sibling next sibling parent reply "Craig Dillabaugh" <craig.dillabaugh gmail.com> writes:
On Tuesday, 15 October 2013 at 19:20:10 UTC, TJSomething wrote:
 I know this has been asked a few times before, but that was a 
 few years ago. Are there any reasonably complete and up to date 
 OpenCV bindings for D?

 If not, are there any reasonably easy ways to generate them? I 
 tried SWIG and it choked on some of the macros they used, 
 though that may have been because I had no idea what I was 
 doing.
I am a bit foggy on the diffence between openCL and openCV, but is this helpful: http://code.dlang.org/packages/derelict_extras-opencl
Oct 15 2013
parent reply "TJSomething" <tjbk123 gmail.com> writes:
On Tuesday, 15 October 2013 at 20:33:59 UTC, Craig Dillabaugh 
wrote:
 I am a bit foggy on the diffence between openCL and openCV, but 
 is this helpful:

 http://code.dlang.org/packages/derelict_extras-opencl
OpenCL is more or less completely unrelated. OpenCV is about computer vision and OpenCL is a cross-platform framework for using devices other than CPUs (e.g. GPUs) for general purpose computing.
Oct 15 2013
parent "Craig Dillabaugh" <craig.dillabaugh gmail.com> writes:
On Tuesday, 15 October 2013 at 20:41:58 UTC, TJSomething wrote:
 On Tuesday, 15 October 2013 at 20:33:59 UTC, Craig Dillabaugh 
 wrote:
 I am a bit foggy on the diffence between openCL and openCV, 
 but is this helpful:

 http://code.dlang.org/packages/derelict_extras-opencl
OpenCL is more or less completely unrelated. OpenCV is about computer vision and OpenCL is a cross-platform framework for using devices other than CPUs (e.g. GPUs) for general purpose computing.
Sorry. Too many acronyms floating around in my head.
Oct 15 2013
prev sibling next sibling parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
On Tue, 15 Oct 2013 21:20:09 +0200, TJSomething wrote:

 I know this has been asked a few times before, but that was a few years
 ago. Are there any reasonably complete and up to date OpenCV bindings
 for D?
 
 If not, are there any reasonably easy ways to generate them? I tried
 SWIG and it choked on some of the macros they used, though that may have
 been because I had no idea what I was doing.
Should be easy to write wrapper around the OpenCV C API...
Oct 15 2013
parent reply Timothee Cour <thelastmammoth gmail.com> writes:
I've done it using swig, and using C++ api (not C api), as well as for
other libs (sfml etc). it requires a bit of tweaking the '.i' file but is
doable. Much better than hand maintaining c wrappers.



On Tue, Oct 15, 2013 at 2:08 PM, Dejan Lekic <dejan.lekic gmail.com> wrote:

 On Tue, 15 Oct 2013 21:20:09 +0200, TJSomething wrote:

 I know this has been asked a few times before, but that was a few years
 ago. Are there any reasonably complete and up to date OpenCV bindings
 for D?

 If not, are there any reasonably easy ways to generate them? I tried
 SWIG and it choked on some of the macros they used, though that may have
 been because I had no idea what I was doing.
Should be easy to write wrapper around the OpenCV C API...
Oct 15 2013
next sibling parent "TJSomething" <tjbk123 gmail.com> writes:
Could you post those?

On Tuesday, 15 October 2013 at 21:51:06 UTC, Timothee Cour wrote:
 I've done it using swig, and using C++ api (not C api), as well 
 as for
 other libs (sfml etc). it requires a bit of tweaking the '.i' 
 file but is
 doable. Much better than hand maintaining c wrappers.



 On Tue, Oct 15, 2013 at 2:08 PM, Dejan Lekic 
 <dejan.lekic gmail.com> wrote:

 On Tue, 15 Oct 2013 21:20:09 +0200, TJSomething wrote:

 I know this has been asked a few times before, but that was 
 a few years
 ago. Are there any reasonably complete and up to date OpenCV 
 bindings
 for D?

 If not, are there any reasonably easy ways to generate them? 
 I tried
 SWIG and it choked on some of the macros they used, though 
 that may have
 been because I had no idea what I was doing.
Should be easy to write wrapper around the OpenCV C API...
Oct 15 2013
prev sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 15 October 2013 at 21:51:06 UTC, Timothee Cour wrote:
 I've done it using swig, and using C++ api (not C api), as well 
 as for
 other libs (sfml etc). it requires a bit of tweaking the '.i' 
 file but is
 doable. Much better than hand maintaining c wrappers.
Link? Or at least a how-to? This would be a really valuable asset, the C++ api is a LOT nicer to work with than the C one. Plus IIRC new features are no longer always available via the C API.
Oct 16 2013
parent "TJSomething" <tjbk123 gmail.com> writes:
On Wednesday, 16 October 2013 at 08:56:26 UTC, John Colvin wrote:
 On Tuesday, 15 October 2013 at 21:51:06 UTC, Timothee Cour 
 wrote:
 I've done it using swig, and using C++ api (not C api), as 
 well as for
 other libs (sfml etc). it requires a bit of tweaking the '.i' 
 file but is
 doable. Much better than hand maintaining c wrappers.
Link? Or at least a how-to? This would be a really valuable asset, the C++ api is a LOT nicer to work with than the C one. Plus IIRC new features are no longer always available via the C API.
I'm going to second this. I need to program computer vision a lot, but I'd like to do it in something a bit better than C++.
Oct 17 2013
prev sibling parent "ponce" <contact g3mesfrommars.fr> writes:
On Tuesday, 15 October 2013 at 19:20:10 UTC, TJSomething wrote:
 I know this has been asked a few times before, but that was a 
 few years ago. Are there any reasonably complete and up to date 
 OpenCV bindings for D?

 If not, are there any reasonably easy ways to generate them? I 
 tried SWIG and it choked on some of the macros they used, 
 though that may have been because I had no idea what I was 
 doing.
If you don't need all of OpenCV, writing a binding using DerelictUtil is not that hard. The main gotchas are: - you really need an editor with a good column-mode - taking care not to implement named enums - taking care to replace long by c_long (resp. with unsigned long) But of course with the sheer size of OpenCV anything automatic would be better.
Oct 15 2013