Post date: Apr 25, 2012 10:58:2 PM
Moving the camera back was perfect. Switching over to HUV to determine brightness was a pretty good idea as well if I do say so myself. I'm starting to actually collect usable images like this one.
I'm getting a lot fewer images of just the inside of the box after changing to HUV but I'm still getting some. I started playing with my brightness levels but then I realized something. All of the pictures of the inside of the box are taken during the day. Apparently the phone is auto adjusting for brightness. During the night my thresholds are fine however once the sun comes up what I get back is different and the shadow that runs across the white source in the background is now dark enough to trigger the image capture.
I see a few possible solutions.
A) Use a REALLY BRIGHT light source so that the light in the box is consistent day and night.
B) Disable auto brightness correction on the camera
C) have multiple thresholds and adjust based on the overall brightness of the image
C is really a pretty broad statement which has several possible solutions built into it.
I'm playing with B now. It seems like the easiest solution.
I also need to adjust my light source. I have 4 LEDS soldered together in a square. originally they were going to go inside of the taplight you see in the background so they're just a block. Since I'm front lighting my target now I need to adjust them a bit. LEDs shine pretty much only straight ahead. So even though I've got 4 ultra bright LEDs I pretty much only have one of them actually shining on that white dome.
Which means at night my captures look like this:
You'll notice that in addition to being lit pretty much only on top it's also a lot blurrier than the day time photo above. I don't think this is entirely because the cat is moving faster. The phone seems to auto adjust it's exposure time for darker images. I've seen forum threads where developers report that their FPS drops in darker situations. Either way I need to move the LEDs about so I'm getting better light on my subjects. Developing a way to diffuse them a tiny bit might not be a bad idea as well. Hrm.. Off to scour the house looking for something that I can turn into makeshift lenses.
EDIT
I wasnted to add one more lesson I learned from this.
To determine if something is in frame I'm checking the brightness of a pixel currently in the middle of the image. Right about in the center of this blue circle.
Which, if you look carefully, means that it's possible for him to walk almost entirely under it. In some situations only the tip of his ear might brush past it. It is entirely possible that the phone won't notice the change at even a normal gait.
I've moved the detection point down to where it should be in the center of his head in this image. I've also replaced the tap light with a sheet of thick white construction paper. Now almost 100% of what the camera sees should be smooth white until there is a cat in it. We'll see how those samples worked out when I collect them tonight.