www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - New and Unofficial OpenCV binding for D programming language

reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
Hi folks!

D is awesome, but it is a shame that there is no any opencv 
bindings for d yet. Actually we have it now :) Although I am a 
new dlang learner, I dared to do it: 
https://github.com/aferust/opencvd. C interface was taken from 
gocv, and the implementation has been highly influenced by gocv 
(maybe it is better to make git submodule it, since gocv project 
is being updated very often?). I admit that it is far from being 
a complete binding, but it is a beginning. I invite you lovely 
and pro dlang community to grow it. I did not want to add it to 
code.dlang.org before it become a better binding.
Apr 04
next sibling parent reply Arun Chandrasekaran <aruncxy gmail.com> writes:
On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am a 
 new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken from 
 gocv, and the implementation has been highly influenced by gocv 
 (maybe it is better to make git submodule it, since gocv 
 project is being updated very often?). I admit that it is far 
 from being a complete binding, but it is a beginning. I invite 
 you lovely and pro dlang community to grow it. I did not want 
 to add it to code.dlang.org before it become a better binding.
Good work. Can you please mention about the version of Ubuntu you developed it on? Also looks like you have committed the cmake temporary build directory to git, you may want to git rm. :)
Apr 04
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Thursday, 4 April 2019 at 23:53:08 UTC, Arun Chandrasekaran 
wrote:
 On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş 
 wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am a 
 new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken from 
 gocv, and the implementation has been highly influenced by 
 gocv (maybe it is better to make git submodule it, since gocv 
 project is being updated very often?). I admit that it is far 
 from being a complete binding, but it is a beginning. I invite 
 you lovely and pro dlang community to grow it. I did not want 
 to add it to code.dlang.org before it become a better binding.
Good work. Can you please mention about the version of Ubuntu you developed it on? Also looks like you have committed the cmake temporary build directory to git, you may want to git rm. :)
Thank you for appreciation. It is Ubuntu 18.04.2 LTS 64 bit. I built opencv 4 from source, it somehow did not create a pkgconfig file. I manually created one in /usr/lib/pkgconfig/opencv.pc: prefix=/usr/local exec_prefix=${prefix} includedir=${prefix}/include libdir=${exec_prefix}/lib Name: opencv Description: The foo library Version: 4.0.0 Cflags: -I${includedir}/opencv4 Libs: -L${libdir} -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio -lopencv_video -lopencv_calib3d -lopencv_features2d -lopencv_face -lopencv_datasets -lopencv_freetype -lopencv_objdetect -lopencv_img_hash -lopencv_xfeatures2d -lopencv_tracking
Apr 04
prev sibling next sibling parent reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am a 
 new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken from 
 gocv, and the implementation has been highly influenced by gocv 
 (maybe it is better to make git submodule it, since gocv 
 project is being updated very often?). I admit that it is far 
 from being a complete binding, but it is a beginning. I invite 
 you lovely and pro dlang community to grow it. I did not want 
 to add it to code.dlang.org before it become a better binding.
Nice! Version 3.x has an internal pointer in the mat struct, is that changed with 4.x? - Paolo
Apr 05
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 5 April 2019 at 07:56:42 UTC, Paolo Invernizzi wrote:
 On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş 
 wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am a 
 new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken from 
 gocv, and the implementation has been highly influenced by 
 gocv (maybe it is better to make git submodule it, since gocv 
 project is being updated very often?). I admit that it is far 
 from being a complete binding, but it is a beginning. I invite 
 you lovely and pro dlang community to grow it. I did not want 
 to add it to code.dlang.org before it become a better binding.
Nice! Version 3.x has an internal pointer in the mat struct, is that changed with 4.x? - Paolo
It still has it, if you what you mean: Mat Mat_FromArrayPtr(int rows, int cols, int type, void* data){ return new cv::Mat(rows, cols, type, data); }
Apr 05
parent reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Friday, 5 April 2019 at 13:19:22 UTC, Ferhat Kurtulmuş wrote:
 On Friday, 5 April 2019 at 07:56:42 UTC, Paolo Invernizzi wrote:
 On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş 
 wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am 
 a new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken 
 from gocv, and the implementation has been highly influenced 
 by gocv (maybe it is better to make git submodule it, since 
 gocv project is being updated very often?). I admit that it 
 is far from being a complete binding, but it is a beginning. 
 I invite you lovely and pro dlang community to grow it. I did 
 not want to add it to code.dlang.org before it become a 
 better binding.
Nice! Version 3.x has an internal pointer in the mat struct, is that changed with 4.x? - Paolo
It still has it, if you what you mean: Mat Mat_FromArrayPtr(int rows, int cols, int type, void* data){ return new cv::Mat(rows, cols, type, data); }
No, I mean that the Mat structure has a MatSize MatStep member with pointers to the struct data itself. Until we have copy ctors, D can't have structures with internal pointers, as they can be moved... that's something similar in C++ string, if I remember well, and that was the blocker that leaded to the copy ctors DIP... - P
Apr 05
next sibling parent Arun Chandrasekaran <aruncxy gmail.com> writes:
On Friday, 5 April 2019 at 15:52:42 UTC, Paolo Invernizzi wrote:
 On Friday, 5 April 2019 at 13:19:22 UTC, Ferhat Kurtulmuş wrote:
 On Friday, 5 April 2019 at 07:56:42 UTC, Paolo Invernizzi 
 wrote:
 On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş 
 wrote:
 [...]
Nice! Version 3.x has an internal pointer in the mat struct, is that changed with 4.x? - Paolo
It still has it, if you what you mean: Mat Mat_FromArrayPtr(int rows, int cols, int type, void* data){ return new cv::Mat(rows, cols, type, data); }
No, I mean that the Mat structure has a MatSize MatStep member with pointers to the struct data itself.
I was writing a binding to OpenCV 3.x a while ago and now I know why I got blocked. :|
Apr 05
prev sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Friday, 5 April 2019 at 15:52:42 UTC, Paolo Invernizzi wrote:
 Until we have copy ctors, D can't have structures with internal 
 pointers, as they can be moved... that's something similar in 
 C++ string, if I remember well, and that was the blocker that 
 leaded to the copy ctors DIP...
That lead to the acceptance of DIP1014 (opPostMove) not 1018. Its a move problem not a copy problem.
Apr 06
prev sibling next sibling parent Russel Winder <russel winder.org.uk> writes:
To add to the pool of OpenCV activity, it is worth pointing out that GStrea=
mer
supports OpenCV and D has a binding to GStreamer via GStreamerD which is a
part of GtkD.


On Thu, 2019-04-04 at 23:08 +0000, Ferhat Kurtulmu=C5=9F via Digitalmars-d-=
announce=20
wrote:
 Hi folks!
=20
 D is awesome, but it is a shame that there is no any opencv=20
 bindings for d yet. Actually we have it now :) Although I am a=20
 new dlang learner, I dared to do it:=20
 https://github.com/aferust/opencvd. C interface was taken from=20
 gocv, and the implementation has been highly influenced by gocv=20
 (maybe it is better to make git submodule it, since gocv project=20
 is being updated very often?). I admit that it is far from being=20
 a complete binding, but it is a beginning. I invite you lovely=20
 and pro dlang community to grow it. I did not want to add it to=20
 code.dlang.org before it become a better binding.
--=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Apr 05
prev sibling parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Thursday, 4 April 2019 at 23:08:21 UTC, Ferhat Kurtulmuş wrote:
 Hi folks!

 D is awesome, but it is a shame that there is no any opencv 
 bindings for d yet. Actually we have it now :) Although I am a 
 new dlang learner, I dared to do it: 
 https://github.com/aferust/opencvd. C interface was taken from 
 gocv, and the implementation has been highly influenced by gocv 
 (maybe it is better to make git submodule it, since gocv 
 project is being updated very often?). I admit that it is far 
 from being a complete binding, but it is a beginning. I invite 
 you lovely and pro dlang community to grow it. I did not want 
 to add it to code.dlang.org before it become a better binding.
Since I could build the library on Windows 10 in addition to Ubuntu, I have decided to put it on code.dlang.org: https://code.dlang.org/packages/opencvd.
Apr 09
parent reply Andrea Fontana <nospam example.org> writes:
On Tuesday, 9 April 2019 at 17:22:12 UTC, Ferhat Kurtulmuş wrote:
 Since I could build the library on Windows 10 in addition to 
 Ubuntu, I have decided to put it on code.dlang.org: 
 https://code.dlang.org/packages/opencvd.
It sounds interesting. I think you should make those examples compilable with dub! Andrea
Apr 10
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Wednesday, 10 April 2019 at 14:44:49 UTC, Andrea Fontana wrote:
 On Tuesday, 9 April 2019 at 17:22:12 UTC, Ferhat Kurtulmuş 
 wrote:
 Since I could build the library on Windows 10 in addition to 
 Ubuntu, I have decided to put it on code.dlang.org: 
 https://code.dlang.org/packages/opencvd.
It sounds interesting. I think you should make those examples compilable with dub! Andrea
Client apps need generated libs in the root folder of app. I could not find a solution to copy them automagically yet. Maybe dub has a feature doing it. Helps are welcome.
Apr 12