Add support to set the threshold for each RGB channel separately

Former-commit-id: 5edb206bb2657e78f711f67625fd5f6164d8296c
This commit is contained in:
johan
2014-03-04 22:04:15 +01:00
parent 4888294e03
commit 5e3cb497fa
9 changed files with 92 additions and 48 deletions

View File

@@ -11,22 +11,32 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
int height,
int frameDecimation,
int pixelDecimation,
double redSignalThreshold,
double greenSignalThreshold,
double blueSignalThreshold,
Hyperion *hyperion,
int hyperionPriority) :
_timeout_ms(1000),
_priority(hyperionPriority),
_grabber(device,
input,
videoStandard,
width,
height,
frameDecimation,
pixelDecimation,
pixelDecimation),
input,
videoStandard,
width,
height,
frameDecimation,
pixelDecimation,
pixelDecimation),
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
_hyperion(hyperion),
_ledColors(hyperion->getLedCount(), ColorRgb{0,0,0})
{
// set the signal detection threshold of the grabber
_grabber.setSignalThreshold(
redSignalThreshold,
greenSignalThreshold,
blueSignalThreshold,
50);
// register the image type
qRegisterMetaType<Image<ColorRgb>>("Image<ColorRgb>");
qRegisterMetaType<std::vector<ColorRgb>>("std::vector<ColorRgb>");
@@ -71,8 +81,6 @@ void V4L2Wrapper::set3D(VideoMode mode)
void V4L2Wrapper::newFrame(const Image<ColorRgb> &image)
{
// TODO: add a signal detector
// process the new image
_processor->process(image, _ledColors);