Setup OpenCV for Xojo


My apologies in advance if this is a repetitive topic.

I’ve been trying to recreate a simple app that I made in using OpenCV in Xojo (free version for now). I’m doing this to evaluate Xojo for myself.

I’ve downloaded the OpenCV folder for Xojo and followed the ‘Getting Started’ instructions. I didn’t find the instructions clear and found the OpenCVX folder mentioned in the instructions by; (i) opening an example project; (ii) select and drag the OpenCVX folder into my project folder. Doing this allowed the Xojo intellisense to recognise the OpenCV methods but the Desktop app throws an error when I attempt to open an image as it encounters an OpenCV method. Here’s code (Button action method) for opening an image into an OpenCV data structure:

Dim f As FolderItem
dim imgStruct as IplImage
dim img as MemoryBlock

f = GetOpenFolderItem(“ImageTypes.All”)

if f <> nil and f.Exists and not f.Directory then
Catch err as Xojo.core.ErrorException
end try
end if

Here’s the error:

I don’t think it’s caused by a wrong file path - I think it may be that I’ve not included the .dylib file correctly.

Please could you tell me how to include the .dylib? I have tried to read the Xojo doc but its not for noobs

Thank you in advance.