Post date: May 09, 2012 8:52:48 PM
So having the code fixed AND having the android package built on a working version of eclipse seems to be a big help.
I just grabbed the phone to look at the samples I've collected and for the first time I have zero captures of the background image. Nothing but cats! (and some other wild creatures, see below.)
My last version of code actually seems to have been fine but when I built it, I built it with a version of eclipse that was apparently having some issues. My computer crashed while it had a full hard drive. Largely due to all the sample captures I had which included nothing but the background. Crashing while your disk is 100% full often does bad things to the integrity of the disk. This is what it did in my case and a lot of files were corrupted. I've had to re-install a number of applications and still have many that are still broken. My whole printing subsystem for example is still hozed. I was surprised that the code I pushed to the phone seemed to work fine when there were a couple of other quirky issues with eclipse. I couldn't create new projects for example or modify any of the android preferences in either a project or globally. Reinstalling the Android SDK did not solve these problems.
So Monday I reinstalled eclipse and configured the SDK in it. I pushed the code with virtually no changes (the new code does have <= instead of just <) and it looked like it was working properly. I even put backed out the code change (to <) and tested it successfully. I've changed it back to <=. Why? I'm not sure, just seemed like the way to go.
And today for the first time, no captures of the empty inside of the VKP enclosure. Not even during the day when the phone auto adjusts its brightness and a shadow is cast across the pixel I'm measuring. At night the brightest point cast by the LEDs is the actual point I'm measuring and I'm getting an intensity value of 255 (which is the max.) During the day when a shadow is cast across it, it only drops to 239. The cats both seem to be coming in, in the high thirties at most so my threshold at 100 seems perfect. I was a little concerned that my measurement might catch a glimpse of a shiny part of the cat and cross above 100 but I haven't seen it yet. I will continue to monitor for it just in case.
I have been capturing valid cat head images to train with but until now they have been mostly accidental. This had two down sides. A) I had to wade through 8-20 thousand images to pull out images of cats and B) There are times when the cat has walked past the camera during the ~3 seconds it takes to write the image and it has thus not been captured. The result being that I have fewer sample images for that day than I should. now that I am _only_ capturing images when something actually walks in front of the camera the number of valid images that I get should go up.
BAM! This is perfect, this is exactly where I want to capture images..
I evaluate the pixel on every frame that comes through so after this image I also capture a couple of his body and tail but those are easy enough to ignore that I don't see a lot of benefit in trying to minimize those by setting a timer or waiting until we cross to bright before testing again or some similar mitigation method which might just result in me actually missing a few good pictures (like if the cat changes his/her mind and backs out.)
As you can see the phone is still auto brightness adjusting. When the overall image brightness is low the phone automatically increases the amount of time that the aperture is open. This results in brighter pictures but makes it less tolerant to movement as you can see by looking at the night time captures which can be quite blurry.
Timothy at night
There does not seem to be a way to disable this in API version 7 which I am using. I've tried a couple of flags which seemed appropriate. However _many_ new methods for enabling/disabling camera features were added in API version 8 which will run on Froyo. I am trying to avoid installing a custom version of android on the phone because I want this to work for regular folks. I'd like to put it up in the android market for anyone who chooses to duplicate the project when I'm done. (If you want to kick in a couple of bucks for the developer license I'll need to do that let me know. ^_-)
The pixel values should be H, U and V respectively. Where V is intensity (I don't know why it's a V.) I should probably move the pixel tag to the top of the image where the cat is less likely to be. Ultimately I will disable that function and also move the camera down another couple of inches but for now I seem to have a lot of free space at the top instead of the bottom.
I also caught a few images of some other wild creatures investigating the cat door.
I've seen these creatures around my yard before. I think my wife has been feeding them so they keep coming back. I should talk to her about that.
I also caught my first red handed.. er.. mouthed? image
Nothing useful in the logs about this. Either the logcat viewer I'm using doesn't go back far enough or the logging facility I'm logging at isn't active when the phone isn't connected to a debugger. Either way I think I'm going to have to start logging to a separate file instead of using the built in logcat facility. I haven't evaluated that yet since I'm not really worried about the accuracy of the object recognition portion until I re-train it.
I still have a few issues to work through in my development environment. For example the new version of eclipse doesn't know that VKP is a git project anymore. Bummer.
The Great North American Blue Spade is a wiley fast moving creature difficult to capture on film.
I'm still shocked at how much re-work that this seemingly simple portion of the code has taken. Part of that is obviously due to the fact that the Android version of OpenCV is very much an afterthought. Part of that is equally obviously due to my lack of development skills. And part of it also due to the fact that I almost exclusively work on TVKP on weekends.