Getting OpenCV framework installed correctly.

Can someone explain where I am suppose to copy the framework file for OpenCV.
I’ve downloaded the zip, extracted it, and am trying the Hough Example inside the IDE Debugger.
Obviously I was suppose to copy the framework folder somewhere… I just can’t figure out where.

For Mac: context click on OS X… Add to Build Settings -> Build Step -> Copy Files. This adds CopyFiles1 after Build.
Then drag the OS X folder (in the Framework folder) into the CopyFiles1 drop area. In the property area change the Destination to Framework Folder. Should now be good to go.

For Windows and Linux it’ll be similar. Look in xTools.world to see what the library path is and add a copy files build step to match.

Also, major props to Franois for providing the compiled library. Searched many times for it but only found arcane compiling instructions.

assuming this is it

[quote=248664:@Will Shank]assuming this is it
https://github.com/ldci/OpenCV-Xojo[/quote]
Yes indeed.
And Thank you Will!

Hi everybody
Very easy to use: first open OpenCVX with IDE and then just drag and drop to your code requiring opencv functions.
Pre-compiled libs are included for main OS (OSX, Windows and Linux) in Framework dir. You can place these libs everywhere on your computer. Don’t forget to update lib access in Xtools.world.
OpenCV binding for Xojo was written for teaching purpose for non computer scientists students and thus could be improved in the future:)
Regards

Hi
To make clearer Frameworks dir in renamed as lib
Regards

Hello,

I have tried the same project with Will’s answer but I still get
“An exception of class FunctionNotFoundException was not handled. The application must shut down.”

I am using Xojo 2015 Release 4.1
macOS Sierra, Version 10.12.6 on my
Mac mini (Late 2014) 3GHz Intel Core i7
16 GB 1600 MHz DDR3

Any suggestions why it is not working for me, it works forBrian O’Brien.

Thanks.

Lennox

Just in case… did you read this?

## Warning
You must use 32-bit version of OpenCV and ffmpeg dynamically linked libraries.
Work under progress at Xojo for 64-bit!

Hmmm. It don’t work no more… :frowning:

[code]Process: HoughLine [3696]
Path: /Users/USER/Desktop/*/HoughLine.app/Contents/MacOS/HoughLine
Identifier: com.chart.houghline
Version: ??? (1.0.0.0.0)
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: HoughLine [3696]
User ID: 501

Date/Time: 2017-10-18 20:43:15.099 -0600
OS Version: Mac OS X 10.13 (17A405)
Report Version: 12
Anonymous UUID:

Time Awake Since Boot: 6900 seconds

System Integrity Protection: enabled

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib
Referenced from: /Users/USER/Desktop/*/HoughLine.app/Contents/MacOS/HoughLine
Reason: image not found

Binary Images:
0x1000 - 0xf2129 +com.chart.houghline (??? - 1.0.0.0.0) <11CA946E-6507-3421-B7EC-E7663DBCCD3C> /Users/USER/Desktop//HoughLine.app/Contents/MacOS/HoughLine
0x22b000 - 0x270fcf dyld (519.2.1) <3FEC6B17-882D-32AA-9D24-CBD9B1FD18EA> /usr/lib/dyld
0x2b4000 - 0x5fcfff +com.xojo.XojoFramework (1.0 - 2) <1D91A629-1BD5-38DB-B08E-86D7FCEBCF4A> /Users/USER/Desktop/
/HoughLine.app/Contents/Frameworks/XojoFramework.framework/Versions/A/XojoFramework
0xa5803000 - 0xa5804fff libSystem.B.dylib (1252) <96309D00-55F1-36DB-9A6B-94DE5E7167E4> /usr/lib/libSystem.B.dylib

Model: iMac14,3, BootROM IM143.0123.B00, 4 processors, Intel Core i5, 2.9 GHz, 8 GB, SMC 2.17f7
Graphics: NVIDIA GeForce GT 750M, NVIDIA GeForce GT 750M, PCIe, 1 GB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343531533641465238412D50422020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343531533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x111), Broadcom BCM43xx 1.0 (7.77.37.0.1a1)
Bluetooth: Version 6.0.0f7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: SanDisk SDSSDHII960G, 960.2 GB
USB Device: USB 3.0 Bus
USB Device: USB3.0 Device
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: FaceTime HD Camera (Built-in)
USB Device: Keyboard Hub
USB Device: Apple Keyboard
Thunderbolt Bus: iMac, Apple Inc., 23.10
[/code]

Looks like I’m missing the ffmpeg dlls… (?)

Anybody get this to work lately?

Hi Brian,

" Library not loaded: @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib"
What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

Take that and put in in a suitable location, for this discussion let’s use Users folder

So put libopencv_world.3.0.0.dylib in your Users folder

Now, in your project, you will find in the xTools module, “Constants”, add it there and compile your app and all should be well.
/users/libopencv_world.3.0.0.dylib instead of @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib

Can anyone provide a project to identify the number of faces, people faces, in an image?

Lennox

This is the procedure I used a long time ago and yesterday.
A long time ago it worked today it doesn’t.

Mac: context click on OS X... Add to Build Settings -> Build Step -> Copy Files. This adds CopyFiles1 after Build. Then drag the OS X folder (in the Framework folder) into the CopyFiles1 drop area. In the property area change the Destination to Framework Folder. Should now be good to go.

Somehow I think the answer lies here:

Dyld Error Message: Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib Referenced from: /Users/USER/Desktop/*/HoughLine.app/Contents/MacOS/HoughLine Reason: image not found

Hi Brian,

I edited my reply and maybe you did not notice

" Library not loaded: @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib"
What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

Take that and put in in a suitable location and tell me where it is, for this discussion let’s use Users folder

So put libopencv_world.3.0.0.dylib in your Users folder

Now, in your project, you will find in the xTools module, “Constants”, add it there and compile your app and all should be well.
Tell the complier to look here…
/users/libopencv_world.3.0.0.dylib instead of @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib

Can anyone provide a project to identify the number of faces, people faces, in an image?

Lennox

Hello,

I have the “camera” project in the “samples” folder working on Mac but I would like to code a pushbutton to capture a still picture, frame, how can I do that?

Also, I tried it on PC, it compiles and launches. I have attached a USB camera and would like to capture a snapshot there as well.

I can select the built in camera but that gives a black output… no image.

I can also select the USB digitizer that the USB is connected to, but when I click start camera I get a completely blue screen with this message “SYSTEM SERVICE EXCEPTION emBDA64.SYS” and the computer shuts down and restarts. I compiled it with x86 32 bit. The opencv_world300.dll is located here c:\opencv3\build\x86\vc12\bin\opencv_world300.dll
How can I fix that?

If I use MBS DirectShow plugin the same USB camera works well, no issues, the USB camera is recognised and the video is displayed correctly.
I also want to use OpenCV because OpenCV offers some really nifty features.

Any suggestions?

Thanks.

Lennox

[quote=248875:@FranoisJouen]Hi everybody
Very easy to use: first open OpenCVX with IDE and then just drag and drop to your code requiring opencv functions.
[/quote]

Can you explain what you mean by, “open OpenCVX with IDE.”

Hi Brian,

This should help…

Very easy. Just unzip the downloaded file.
You should get a folder named “OpenCV-Xojo-master”.
Then drag the “OpenCV-Xojo-master” to any project requiring OpenCV image processing.

or more detailed…

Very easy. Just unzip the downloaded file.
You should get a folder named “OpenCV-Xojo-master”.
In that folder there is another folder named “samples”.
Open one of the samples, e.g. “flip”
In that folder is a file named “flip.xojo_binary_project”
Launch “flip.xojo_binary_project”
There is a folder named “OpenCVX”
Copy or drag the “OpenCVX” to any project requiring OpenCV image processing.

Regards.

Lennox

Hello Lennox,

I have the same problem(s) than Brian.
There is a file OpenCVX not a folder, no?
In the file “flip” there is a module “OpenCVX”, isn’t sufficient?
For example when I execute that file “flip” a class named “Auto” is not recognized.

Thank you for your help.

BB

What Brian asked was "Can you explain what you mean by, “open OpenCVX with IDE.”

The answer to that is

[quote=377080:@Lennox Jacob]Very easy. Just unzip the downloaded file.
You should get a folder named “OpenCV-Xojo-master”.
In that folder there is another folder named “samples”.
Open one of the samples, e.g. “flip”
In that folder is a file named “flip.xojo_binary_project”
Launch “flip.xojo_binary_project”
There is a folder named “OpenCVX”
Copy or drag the “OpenCVX” to any project requiring OpenCV image processing.

[/quote]

Now there is another problem which you may have encountered and the answerr to that is …

OK [quote=355187:@Lennox Jacob]Hi Brian,

" Library not loaded: @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib"
What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

Take that and put in in a suitable location, for this discussion let’s use Users folder

So put libopencv_world.3.0.0.dylib in your Users folder

Now, in your project, you will find in the xTools module, “Constants”, add it there and compile your app and all should be well.
/users/libopencv_world.3.0.0.dylib instead of @executable_path/…/lib/OSX/libopencv_world.3.0.0.dylib

Can anyone provide a project to identify the number of faces, people faces, in an image?

Lennox[/quote]

If you are still having any issues please let me know.

Lennox