Announcing Xojo OpenCVC - OpenCV 4.5 for Xojo

Seems to be this line:
test = openCV.Codecs.imDecode(mb, opencv.ImReadModes.Grayscale)

I’ll be patient, not an urgent need, i’m glad we have access to this in xojo now :slight_smile:

huh. Is it a very large file?

No, 1024 x 768 or so.

Got a linux shared library built. libOpenCVC.so. I inspected it with nm -C libOpenCVC.so | grep " T " and noted 256 functions available CVCadsdiff…CVCwatershed. After adding the library the xojo debugger hard crashes as soon as I call a declare function. Did you have any issues with this?

I’ll try build the demo app included on OpenCV-C a bit later to see if it’s a problem with the library build or Xojo.

By running the app from the terminal I get the following. I wonder if I’m missing something here.

/home/user/GitRepositories/xojo-opencvc/DebugopenCVDesktop/DebugopenCVDesktop: symbol lookup error: /home/user/GitRepositories/OpenCV-C/build/libOpenCVC.so: undefined symbol: _ZN2cv6imreadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi

@Perry_Paolantonio Got it working on Linux! It was just some library linking required. As I have it now, the system doesn’t package opencv with the library so libOpenCVC.so is only 124Kib. This means you are required to install opencv separately on Linux. openCV has a couple of other package dependencies so it might be best to let users install it themselves. What do you think?

Sorry. I forgot to reply to this - I think that makes sense.

Did you find a way to make it fast ? Interresting topic for me too.

Not yet, Perry might do an update at some point.

I was able to get it a little bit faster by saving to RAM as a png. I’m not really sure what’s happening in the background but it sure is fun to play with.

What kind of machine are you on - speed? CPU?

Hello,

where can I find the OpenCVC.dll 4.5 for Windows to download?

Thanks and regards Norbert

We’ve discussed this a bit here.

tl/dr - when this was being written I was the only one using Windows, so it’s not as well tested as the mac version, and wasn’t included in the initial github commits. So for now, you’ll need to compile your own DLL in Visual Studio. I won’t be able to work on this for a few more weeks at least, because the windows workstation where all this lives is currently in storage.

You can find the OpenCVC code here: GitHub - friolator/OpenCV-C: Plain C API for Open CV

i5 2015 Macbook Air.

thanks. I think we have an older i5-based iMac here somewhere so at some point I’ll test it on that to see if I can replicate the problem.

Is there any Xojo project you want to share so I can have a look. I’m really not an expert but working on it.

I used the included project and dragged an image “pic1” into the project
in the absdiff Method in the wCore window i used the following code to test it:

//This just adds two of the same image for testing absdiff only.
images.RemoveAll
dim mb as new MemoryBlock(pic1.Width * pic1.Height * 4)
mb = pic1.ToData(picture.Formats.PNG)
dim test as new openCV.CVCMat
test = openCV.Codecs.imDecode(mb, opencv.ImReadModes.Grayscale)
images.Add test
images.Add test
images.add New openCV.CVCMat
openCV.Core.AbsDiff(images(0), images(1), images(2))
Canvas1.Invalidate

which xojo version are you using??

2023 r3.2

I’ve added a couple features such as the ability to specify device ID and set video capture properties. I’ll try tidy things up a bit and do a PR. It’s working well for my needs so far.

2 Likes

already ? last public is not 2023 R1.1 ?