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.
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.
already ? last public is not 2023 R1.1 ?
After 4 years, we have an update! The latest version of Xojo-OpenCVC is available now.
OpenCV-C, our underlying C wrapper for OpenCV now has support for several new functions and types:
CVCInputArray
CVCOutputArray
CVCInputOutputArray
CVCMatRefVector
And we’ve added a couple overloads to the CVCMatCreate function. These let you move an image in a memory block directly into a CVCMat. Previously you had to write a temp file to disk and read that, a big performance hit.
With the addition of the Input/Output Array types, we were able to start implementing some of the functions that were previously unimplemented because they required those structures. They are:
CVCmerge2
CVCsplit1~2
CVCmixChannels1~2
CVCinsertChannel
CVChconcat1~3
CVCvconcat1~3
CVCpatchNaNs
CVCcompleteSymm
CVCcalcCovarMatrix
CVCPCACompute1~4
There are more to come, but on our end, this was required in the short term. If there are functions you’re interested in seeing, and you’re handy with C/C++, please consider contributing to OpenCV-C. As of now, all work done there has been paid for by my company to programmers who have done the work for us, as we need specific functions for something I’m building in Xojo. We have made all of this open source, and would love to see more functions implemented. But I can only pay for what we need in-house at this point.
As for Xojo-OpenCVC, the latest version is up to date with the current version of Xojo - 2024r4.2. Most deprecation warnings have been addressed. I have also renamed some of the generically named buttons so it’s clearer what they do. The Mac dylib that’s included with the package is also up to date, built on the current version of OpenCV-C. Lastly, I added a test for merge2 - the overloaded merge function that allows you to create a composite color image from separate channels. In the /images folder inside the package, there are three monochrome images made from the starry_night.jpeg file. One each for the R, G, and B channels. The test successfully loads them and merges them into a color image.
Xojo OpenCVC isn’t exactly pretty - it’s not meant to be. But if someone is interested in helping to clean things up, document or add new code, and maybe organize the UI let me know!
This morning I updated the Xojo project further, to eliminate the rest of the deprecated function warnings, and to include the necessary Windows DLLs to make it run there. I also updated the readme’s installation instructions, and re-ordered the class/type/function lists so they’re alphabetical.
If you are on Windows and want to give this a try, I’d appreciate it. It works great for me, but someone else trying it is having trouble loading the DLL.
IMPORTANT: OpenCVC.dll and LibOpenCVC.dylib are just wrappers for the OpenCV libraries. On the mac, this is included in the dylib. On Windows it’s a separate file called opencv_world452d.dll, which is included in the package. But, both the Mac dylib and opencv_world452d are zipped because of space constraints on github. These need to be unzipped before anything will work. They’re in the ‘external’ folder. There’s a note about this in the installation instructions.
Also, this is 64bit only. Everything in the project should be set up so that it just works, but if it doesn’t, let me know, and better, let me know what needs to be changed to fix it so I can update the project.
Get it here:
Thanks!
When you say that it works great for you, are you meaning on Windows or just Mac?
I’m using Windows. When building in debug mode, I was able to adjust the build steps so that both DLL’s (OpenCVC.dll and opencv_world452d.dll) are copied to the executable folder. I can run the app and the main Window shows. When I press the “Load Image” button, there is a FunctionNotFoundException in “imRead”: Error is: Could not load CVCimread from OpenCVC.dll. Note that I also tried copying the dll’s to the libs folder and that yielded the same results.
I am testing on both Mac and Windows. On Mac, it’s Ventura, on Windows it’s Win10 Pro. It works in both locations. Curious though - the build copy should have been set up already for opencv_world452d.dll – was it not?
What you’re describing is what the other person is seeing, with the function not found exception.
OpenCVC.dll
opencv_world452d.dll
Should both be copied to the App Parent Folder on windows. The LibOpenCVC constant should have entries for both Mac and Windows and should look like this:
opencv_world452d.dll
is only used internally by the OpenCVC.dll file, so it doesn’t need to be included in the code, other than as a build copy step.
I have only tested on Intel for Windows machines, i’m not sure if the DLL will work on an AMD machine since I don’t have one available to me. Also, everything should be set to 64bit.
The build step in the repo is correct. You need to unzip opencv_world452d.zip and put the dll into the external folder before you open the project.
I am still getting the same error. I’m using Windows 11. Not using an ARM processor.
That’s correct about the unzipping. I was just confused because you said that you had to adjust the build copy step, so I wasn’t sure what you meant. If you don’t unzip it does it unlink the file or something? I’m not at a machine that has the project on it right now.
Weird that it’s not working. I wonder if there’s an issue with the DLL build and WIndows 11? I’ve done this in the past many times and I’m still using the same version of Visual Studio on Windows to build as I was when we first did this (Visual Studio 2019 Community Edition). But maybe Windows 11 is somehow stricter? I don’t know. One thing you could try is opening up the Visual Studio project itself, and compiling your own DLL. If that works for you then that might explain the issue. The Project is included in the OpenCV-C package on github. Different repo from the Xojo project.
Hi Perry,
I am new to XoJo and my first step is to translate a 4D plugin into a DLL/DynLib that can be used by XoJo. I’m not presently in need of OpenCV but…
I am in need of examples where I can learn how to structure/organize/wrap external C/C++ code libraries as Visual Studio & XCode projects (maybe be even MAKE).
Are the VS/XCode projects available anywhere for download?
Appreciate,
John…
Are the VS/XCode projects available anywhere for download?
I’m not an expert in this, and I hired someone to do this for OpenCV-C. You are free to look at the code in that repo though, which does what I think you’re looking to do: provide a C wrapper for C++ code. OpenCV-C is what Xojo-OpenCVC is based on.