PS3Eye color loss at low exposures

I recently set up an rPi with opencv and was testing out our new PS3Eye. At ‘normal’ exposure, the color is fine, but I can’t seem to lower the exposure enough to get just the reflective tape, but keep the nice green color. It normally will go to just white. I tried messing around with v4l, but nothing seems to do what I want. Has anyone else encountered this?

I have no experience with the PS3Eye specifically, but here’s a guess: The auto white-balance algorithm assumes that the average color of a frame should be gray (known as the “gray world assumption”). If you’re doing something such that the only exposed pixels are green, it will try to compensate by adjusting the AWB parameters, and the result will be white, or at least a lot less green. You should be able to turn this off in V4L. A nice little program for camera experimentation is guvcview, which gives you GUI access to all the parameters for the camera.

I’ll order a PS3Eye and check back when I’ve had a chance to play with it. :]

EDIT: Another thought: Why are you worried about getting “just the reflective tape”? Maybe I’m misunderstanding, but the way this is normally done is to simply threshold the image, i.e., keep all the pixels that have a green value > 200. It’s fine if other things are visible in the original image, as long as they’re not bright and green. If you need more color-specificity (e.g., you need to cut out white lights), then you can do something like

keep = (green > 200) && (blue < green - 20) && (red < green - 20)

There are also more complex thresholding operations that actually calculate distances in color space which might be useful to you.

We struggled mightily with that issue last year. The retro tape is so effective that it blows out the exposure and the pixels come in as white, at which point we were also picking up, e.g., ceiling lights. Our workaround was to use an old Webcam that wasn’t “smart enough” to auto-adjust its own exposure. Our Plan B was to use filters to try to block things out enough to overwhelm the auto-exposure.

PS one downside of underexposing the ambient light is that you lose a lot of context when you try to debug / iterate your CV logic based on “gun camera” recordings.

Sent from my iPad using Tapatalk

And Plan C was to PWM the LED ring. But seriously, the retro tape is wild. When I was photographing the competition last year from halfway up the stadium, the retro tape reflected my camera’s focusing light as brightly as anything on the field.

Sent from my iPad using Tapatalk

We managed to get a good green color off the PS3Eye camera by configuring it with v4l using these settings:


#!/bin/bash
v4l2-ctl -d /dev/video0 --set-ctrl white_balance_automatic=0
v4l2-ctl -d /dev/video0 --set-ctrl auto_exposure=1
v4l2-ctl -d /dev/video0 --set-ctrl exposure=10
v4l2-ctl -d /dev/video0 --set-ctrl gain_automatic=0

Turning off the automatic white balance, gain, and exposure went a long way.

We also ran into a weird (bug? feature?) that auto exposure on is 0 and off is 1. This could be the feeling you have that nothing does what you want, as if automatic exposure is on then setting the exposure doesn’t do anything.