Forum > Packages and Libraries
OpenCV with Lazarus
Jurassic Pork:
hello,
here is a starting point to use opencv with Lazarus.
Not sure that works with all the functions of Opencv, but works with the lkdemo ( video motion tracking)
OpenCV.pas needs to be checked because it is a version for 2.1 version of Opencv and i use it with version 3.0 of Opencv ( I have done some changes for that works).
OpenCV.pas needs some changes to work with Linux.
Lkdemo Lazarus project :
In attachment lkdemo project for Lazarus
Download opencv 3.0 for windows from here
Extract the dlls \opencv-3.0.0.exe\opencv\build\x86\vc12\bin\*.dll (choose the right folder for your O.S ex : x86 -> 32 bits , vc12 -> visual c++ dlls version 12) from opencv-3.0.0.exe with 7z in your project folder.
you must change this line in unit1.pas -> choose a video file or capture from CAM
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- // capture := cvCaptureFromCAM(0); capture := cvCaptureFromFile(PChar('f:\temp\videos\test.mp4'));
tested with Lazarus 1.6 Windows 32 bits and Opencv 3.0.
Thanks to Giandomenico
Enjoy !
zbyna:
My small contribution:
https://github.com/zbyna/opencv-lazarus
:)
six1:
My small contribution (Face detect, working Sample!):
http://www.mediafire.com/file/3t2a024nacfwx0k/Laz_OpenCV_Face_Detect.zip
You have to download OpenCV 2.4.13.5 https://opencv.org/releases.html
Extract following Libs from opencv\build\x86\vc14\bin\ into Programs dir:
opencv_calib3d2413.dll
opencv_contrib2413.dll
opencv_core2413.dll
opencv_features2d2413.dll
opencv_highgui2413.dll
opencv_imgproc2413.dll
opencv_legacy2413.dll
opencv_nonfree2413.dll
opencv_objdetect2413.dll
opencv_photo2413.dll
opencv_video2413.dll
Have fun, Michael
Mike.Cornflake:
Ooh. OpenCV has been on my TODO list for a while. Many thanks for posting this...
six1:
Hi Mike,
it seems to be a long way... ::)
Meanwhile i've modified Delphi components to work with Lazarus.
After many fixes and few improvements, most of it is working, but there are a few problems left to do...
(ocvView is now working after many hours of debuging, but videosource must be set at runtime! see LazSample in Samle folder on github)
look at github, for latest changes of my OpenCV Fork
https://github.com/six1/Laz_OpenCV_2
best, Michael
Navigation
[0] Message Index
[#] Next page