I’m getting more comfortable with PInvoke from C#. I’ve been using a web site that contains a pretty wide variety of recipes for getting at Win32 API calls with PInvoke.
At some point soon I need to take a look at the WindowsAPICodePack-Core which appears to have pre-built versions of some of these things. For now I’m happy that I’m getting closer to the point where I know how to invoke most API calls directly using PInvoke.
I do wish there was a more comprehensive reference document discussing all of the capabilities and ins and outs of using this facility. As is there are examples and specific documentation for some items (I’ve been using my copy of .NET 2.0 Interoperability Recipes: A Problem-Solution Approach to work out the basics and the PInvoke web site to extend that to more complicated examples.
I’ve put some of the sample code I’ve been playing with on GitHub at DupScan. This project is again code aimed at deduplicating file trees for archiving and management. The big driver here is the unique file ID API.
VHDL keeps coming up in places and my VHDL is more than a little rusty so I was back doing some refresher last night and will likely do some more tonight.
I need to get back to a point where I can read VHDL and make reasonable sense of it (and perhaps make small changes without breaking too much). If I hit the point where I’m feeling comfortable with it again I may dig out the Spartan-6 board I have lying around and see about trying some real work programming it.
This is something that keeps coming up, but once the need fades off I find other things that are higher priority and never get past the early stages…need to reach basic fluency this time around.
I built a few more beacons to play with last night. I’ve got some CR2023 battery holders that are smaller than the AA cell battery clips and have integrate power switches that I’m using for these. The red and blue LEDs work as expected (though they look dimmer to my eye than the white one on the first version we built).
I put together an IR LED based beacon as well (though without the diffuser as I’m not sure the diffuser plastic is transparent at 970 nm). I’ve demonstrated that the cameras I’ve got can see the IR LEDs on a remote control, even with their IR filters intact. I could see that the IR LED was on, but its brightness was much less than the brightness of the visible light LEDs so no real advantage to going with IR.
I also finished updating my RPi machines to the ‘scratch’ OS image and am close to having all of them built for OpenCV libraries. Once I get the last machine loaded up, I expect to switch back to one of the Ubuntu NUC machines and write some code to read from cameras and process the result.
Attaching LED information for easy later location…
Played with some commercial motion capture software last Friday, more here.
I’ve upgraded most of my RPi machines to scratch and I believe I have the process of building OpenCV 4.0.1 on them to the point where it is reliable.
I have realized that I can’t push the full, unprocessed output of these webcams over the ethernet links. I’ll have to pre-process the data to reduce total size in order to make things work. Not sure whether the ARM CPUs have the necessary performance or not. I’ll have to look at this and see what I can see.
This time I pasted all of the pieces into a single shell script (instead of running it piecemeal) and things went smoothly. Still took a while, even on the Core-i5 system with an SSD and 32 GB of physical memory. I specifically pulled 4.0.1 from git rather than the default choice from the source of the instructions that built ‘master’.
Tonight I’ll have to write a bit of code to use the library and see if I can get streams of images programmatically from one or more of the webcams I’m working with.
At some point I may bump up the swap space on another of my RPi systems to see if the same script works there as well.
Well…almost got OpenCV building on my main Ubuntu machine at home. I was copying fragments from the directions on the OpenCV site into an SSH session and clearly missed something along the way. I’ll have to build a single, large shell script up front next time and then run that. Unfortunately it seems as if (I may learn better later on) once CMake has done its magic, lots of things get baked into the files that drive the build in ways that really, really want a rebuild if things don’t go quite right.
I was working from the instructions here. (Other instructions here).
I was surprised to see that the github repo and contrib did not have a branch tag for release 4. It looks as if there’s a stable release out there, but 3.4 and master seemed like the available choices.
The main site clearly indicates that version 4 has been released with pre-built windows and ios downloads and documentation. I’m not sure currently how to pull that stable release code from git though.
I expect to take another run at the 4.0 build on Ubuntu tonight. Other than script grabbing issues, the build went smoothly…32 GB of memory and a Core-i5 CPU work better than an low-end ARM and 1 GB swapping on a micro-SD card.
Hmm…more github presence for version 4 here and here. Looks like OpenCV 4.0.1 is the latest. Ah…tags not branches here…need to look at pulling the appropriate tag for the build. Easy enough…just list the tags, find the 4.0.1 tag and check that out.
I started work as a Principal Software Engineer at KMC systems in April of 2016. I'm enjoying the work and the team there so far.