Recent

Author Topic: Opencv version 4.6 C++ API wrapper  (Read 4885 times)

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #15 on: April 06, 2023, 09:58:15 am »
@JP ah, ok! I compiled the Lazarus program with the default widgetset, maybe it's GTK2.
Indeed I am using Xubuntu 22, perhaps GTK2 is the default here, so Opencv complains that it's not
linked.
I will try with GTK3 and qt5, and eventually recompile Opencv.
Thank you

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: Opencv version 4.6 C++ API wrapper
« Reply #16 on: April 06, 2023, 10:23:27 am »
Indeed I am using Xubuntu 22, perhaps GTK2 is the default here, so Opencv complains that it's not
linked.
I will try with GTK3 and qt5, and eventually recompile Opencv.
Xubuntu 22.04 :
Quote
Application Stack
GNOME 42
GTK 3.24.33
MATE 1.26
Xfce 4.16
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #17 on: April 06, 2023, 06:36:24 pm »
Hello, at end success!  ::) But rebuilding Opencv with GTK2.
Building program with GTK3 widgetset causes same error that was previously, see image 1.
Maybe xfce requires GTK2? I don't know.
I also attached all building scripts, install.sh try to automate the various steps.

 

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #18 on: April 07, 2023, 05:15:41 pm »
Hello,
on github released updated version 1.0 of ocvWrapper46 library, with all fixes and scripts for Linux.
Many thanks to JP!

https://github.com/gidesa/ocvWrapper46
« Last Edit: April 07, 2023, 05:30:15 pm by gidesa »

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper - Lazarus components
« Reply #19 on: May 05, 2023, 05:08:22 pm »
Hello,
the OpencvWrapper46 version 1.1 is released and ready to test.
There are four new Lazarus components and other classes that great simplify
the use of Opencv, especially for object recognition, and face
recognition/detection.

 
https://github.com/gidesa/ocvWrapper46

Thanks

Giando

fcu

  • Jr. Member
  • **
  • Posts: 90
Re: Opencv version 4.6 C++ API wrapper
« Reply #20 on: May 05, 2023, 07:31:55 pm »
thanks for the wrapper , very nice work
please can you build the wrapper dll staticaly ? , it depend now on visual c++ runtime

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #21 on: May 06, 2023, 12:30:45 pm »
@fcu, thanks appreciating my work.
Statically link the C++ runtime, in my opinion, is not a good option, for these reasons:
Opencv binaries depend themselves from C++ runtime Dll; so you should have to recompile also Opencv, and at end have two copies of same runtime inside the two Dll, Opencv and wrapper (indeed Opencv has at less 2 Dll).
More, I don't know if linking Dll with static runtime is a good choice for multithreading.
Remember that the application stack  with wrapper is somewhat complex: a Delphi/Lazarus exe (or maybe another Dll)  that calls the wrapper Dll that calls the Opencv Dll.

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #22 on: March 13, 2024, 04:06:35 pm »
Hello,
the Opencv 4.6 wrapper repository now has new examples, better Pascal classes, much better documentation.
And instructions for compile on MacOS, too.
Enjoy!

Github repo    https://github.com/gidesa/ocvWrapper46/

fcu

  • Jr. Member
  • **
  • Posts: 90
Re: Opencv version 4.6 C++ API wrapper
« Reply #23 on: March 14, 2024, 07:51:31 am »
Hello,
the Opencv 4.6 wrapper repository now has new examples, better Pascal classes, much better documentation.
And instructions for compile on MacOS, too.
Enjoy!

Github repo    https://github.com/gidesa/ocvWrapper46/

very nice work but i could not run it due to the missing visual c++ runtime , i have an old pc with windows7 32bits
why would you not build it with mingw64 instead , mingw64 will generate dll's with 0 dependencies

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #24 on: March 14, 2024, 12:29:31 pm »
@fcu thank you for kind words.
Your suggestion is interesting. In Windows I tried to compile the wrapper with TDM-GCC-64, one of distribution of GCC compiler. The compilation is ok, but the linking failed, having only the Visual C++ DLL and static lib of Opencv.
I will try to recompile the entire Opencv with GCC.
Indeed you need the 32bit version of DLLs, is it correct?
Have you suggestions on possible demo programs?
« Last Edit: March 14, 2024, 12:32:06 pm by gidesa »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 250
  • From C# to Lazarus
Re: Opencv version 4.6 C++ API wrapper
« Reply #25 on: March 14, 2024, 02:33:53 pm »
Hi,
Just for info,

Here are some notes I wrote one year ago for installing CUDA and OpenCV on Linux.

Hope that help.

And @gidesa, a great great thank you :)

B->
« Last Edit: March 14, 2024, 02:53:53 pm by Dzandaa »
Dzandaa

fcu

  • Jr. Member
  • **
  • Posts: 90
Re: Opencv version 4.6 C++ API wrapper
« Reply #26 on: March 14, 2024, 05:28:06 pm »
@fcu thank you for kind words.
Your suggestion is interesting. In Windows I tried to compile the wrapper with TDM-GCC-64, one of distribution of GCC compiler. The compilation is ok, but the linking failed, having only the Visual C++ DLL and static lib of Opencv.
I will try to recompile the entire Opencv with GCC.
Indeed you need the 32bit version of DLLs, is it correct?
Have you suggestions on possible demo programs?
i had no issue building opencv4.6 using mingw64
i used gcc13 from (https://winlibs.com/#download-release)  and cmake(gui version)
but you have to disable ADE framework

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #27 on: March 14, 2024, 06:47:28 pm »
@Dzandaa thanks, you are welcome.

@Fcu thank you. Eventually I have built 32bit version of Opencv and wrapper with TDC mingw.
But reading jpeg files is not working.
I will try again unchecking ADE.

gidesa

  • Jr. Member
  • **
  • Posts: 67
Re: Opencv version 4.6 C++ API wrapper
« Reply #28 on: March 15, 2024, 06:11:47 pm »
@fcu
I successfully compiled Opencv 4.6 and wrapper with  gcc version 10.3.0 (tdm64-1) on Windows 10.
The 64 bit Opencv/wrapper Dll work fine on some quick tests.
The 32 bit Opencv Dll is not working on reading Jpg images.
To compile Opencv 32 bit I set these options in Cmake-gui:
- in CMake group:
   - set in CMAKE_CXX_FLAGS: -m32 -mwin32 -fpermissive
   - set in CMAKE_C_FLAGS:   -m32 -mwin32 -fpermissive
   - set  in CMAKE_RC_FLAGS:  -Fpe-i386
- in OPENCV group:
   - check on OPENCV_FORCE_3RDPARTY_BUILD
- in BUILD group:
   - check on BUILD_opencv_world , to have a single DLL

Attached the makefile for wrapper in 32bit and 64bit version, and a simple C++ program and Cmake file to test
Jpg in Opencv.
Maybe you can resolve the issue.

fcu

  • Jr. Member
  • **
  • Posts: 90
Re: Opencv version 4.6 C++ API wrapper
« Reply #29 on: March 16, 2024, 03:44:21 pm »
many thanks gidesa , i'll test your makefile and see what could be done for jpg

 

TinyPortal © 2005-2018