Since vacation I’ve been pretty busy working on photo post processing and around the yard.
At this point I’m going to be trying to get back to building a back-end for the unity based cluster game that runs in PHP on my web hosting (initial work on local sandbox PHP instances of course).
I think I’m going to try using Visual Studio Code with PHP Extensions to get this started. I’ve done a little PHP coding in the past, but this looks likely to be far more involved than any of that.
I’d like to get a TLS cert on my site before going live with this, but it appears that my hosting may not support free TLS or similar cert installs and I’m not happy adding the annual renewal cost for a cert to my site at this point so stay tuned. I’ll probably try hitting GoDaddy support some evening soon to see what they can tell me.
First steps will be getting a simple RESTful interface defined and then laying out some simple SQL schema to provide the back-end. If I can get that working, I’ll look at extensions necessary to provide the full back-end to the game as a whole. Not looking for commercial quality here, just something sufficient to allow multi-player turn based gaming.
Just reinstalled clean and up to date copies of XAMPP, MariaDB and MongoDB on one of my home machines.
I need to write some RESTful PHP code that can run on my web hosting as the back-end for a VR game I’m playing with. This gives me a platform for building that code in a safe place.
I do need to stick to PHP 5.x features as my GoDaddy shared hosting does not support PHP 7.
I’ve got to get the basics stitched together, add an appropriate .htaccess to keep passwords out of inappropriate hands and then start working out a SQL schema that works for the persistent game data I need to store.
Spending a big chunk of this long weekend post processing pictures from our recent vacation (see them on the blog side of ninecrows if you’re interested). Watched the whole last season of Game of Thrones and saw Aladdin. Lots to still get done, but progress is progress 🙂
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.
Building C++ supporting libraries on my small dev machine. Looking at another pass of C++/CLI work and some more thinking about motion capture options.
I’ve built zlib and bzlib2 yesterday. To get these building with VS 2017 I built them with their standard build procedures (which appeared to build 32 bit libraries) and then created visual studio 2017 projects to build the same pieces using fresh settings.
I’ve got boost, openssl, opencv and the mongodb c and c++ libraries on my list for today. The mongodb libraries are my primary target here though all of the above are of interest. This is also what is driving my CMake reading as several of these libraries use CMake for their builds.
I’m pretty interested in C++/CLI as a way to get access to C and C++ functionality from C#. Given the productivity that C# provides, access to C and C++ APIs and libraries from that environment would help quite a bit. My primary driver was access to the Win32 file ID API for some file management work, but Win32 APIs keep coming up now and again. I do need to take a look as some newer C# libraries that Malcolm suggested that may provide pre-packaged access here.
In the past, I’ve run into build issues when combining C# and C++/CLI in the same project. I expect this was setup issues so I’m now looking to take a more serious look at this.
The motion capture work will start out with OpenCV and getting my web cams running with code behind them to process the images. I’m thinking that pre-recording things and then post processing might be a good idea…using a light strobe to synchronize things could simplify time sync as well. Much to consider…
I’ve got boost, zlib and libbz2 built on boojum now. Next step will be to test the installs with a small program or two. Hoping that all went well and I have usable, native, win64 libraries available.
Once those have been checked out I’ll take another run at building the MongoDB drivers…this time on boojum rather than chaos. Boojum has a shorter history and is distinctly less cluttered than chaos so I’m hoping that this just works. Expecting less than that though…I’ll probably need to dig deeper into he CMake configs to get where I want to go. I’ll update as I move forward…now off to lunch though.
We tried doing some motion capture with a kinect 2 today. Results were mixed though less than ideal.
I am thinking of using OpenCV to acquire images and use them to register locations in three-space. I currently have two high quality cameras and a lower quality one to play with…I expect that if things go well I’ll likely pick up a third higher quality camera to work with along with some hard-mounts for them in the basement. Ideally I’d love to be able to code up some decent motion capture functionality using cameras and reference marks on limbs.
A bit of experimentation will be required in order to get there though.
I am wondering whether a faster, lower resolution webcam might do better for this. There are some $20.00 a piece cameras with USB-2 interface out there (Microsoft Lifecam-3000 or Logitech C270) instead of the higher-end, USB-3 autofocus Logitech C930e. Both wondering whether the lower resolution and USB-2 may provide a higher frame rate and whether fixed focus will stay consistent without periodic refocus hits.
I’ve tried building this thing using CMake and Visual Studio and CMake seems to keep picking up cygwin headers for Visual Studio builds and I can’t seem to make things better. For now not worth the pain. I’m probably going back to C# with C++/CLI to get this working with C APIs and C# for MongoDB access.
I’m certain that I could get this building with enough effort. The code looks reasonable and I can put together the projects myself. I’m not all that inclined to go there though as I’d have to re-do this every time through. I’m not familiar enough with CMake to try modifying that part of the process.
Ok…not quite giving up. I did find that CMake appears to be adding a cygwin header folder to the projects. If I manually remove this from them the build goes further. The default build configuration appears to be 32 bit which is also an issue for me. Perhaps I’ll do a little more before I completely give up.
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.