本文整理汇总了C++中ImageProcessor::GetFilteredImage方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageProcessor::GetFilteredImage方法的具体用法?C++ ImageProcessor::GetFilteredImage怎么用?C++ ImageProcessor::GetFilteredImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageProcessor
的用法示例。
在下文中一共展示了ImageProcessor::GetFilteredImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void CameraTest::Execute() {
cameraLEDsSubsystem->GreenOn();
cameraLEDsSubsystem->BlueOff();
// Allow time for the LEDs to light up
if(!timer->HasPeriodPassed(0.1)) { return; } // min tested was 80ms
Preferences * prefs = Preferences::GetInstance();
// Capture an image from the camera and save it to flash
timer->Reset();
ColorImage * image;
if (prefs->GetInt("image_retain", 1) == 1) {
cameraSubsystem->RetainImage("/cameratest.jpg");
image = cameraSubsystem->CaptureImage();
cameraSubsystem->RetainImage(NULL); // stop retaining
printf("[CAMERA] Captured image and wrote to /cameratest.jpg in %.1f ms\n", timer->Get() * 1000);
} else {
image = cameraSubsystem->CaptureImage();
printf("[CAMERA] Captured image in %.1f ms\n", timer->Get() * 1000);
}
// Load preferences for filtering threshold image
Threshold threshold = Threshold(prefs->GetInt("hue_low", 100), prefs->GetInt("hue_high", 140),
prefs->GetInt("sat_low", 90), prefs->GetInt("sat_high", 255),
prefs->GetInt("lum_low", 20), prefs->GetInt("lum_high", 255));
// Process the captured image
timer->Reset();
ImageProcessor * ip = new ImageProcessor();
ip->SetThreshold(threshold);
ip->Process(image);
printf("[CAMERA] Image processed in %.1f ms\n", timer->Get() * 1000);
// Write the processed images to flash
if (prefs->GetInt("image_retain", 1) == 1) {
timer->Reset();
ip->WriteImages("/cameratest");
printf("[CAMERA] Processed images written to /cameratest.*.bmp in %.1f ms\n", timer->Get() * 1000);
}
// Generate a target report
timer->Reset();
TargetReport * tr = new TargetReport(ip->GetThresholdImage(), ip->GetFilteredImage());
tr->Generate();
printf("[CAMERA] Target report generated in %.1f ms\n", timer->Get() * 1000);
tr->OutputScores();
finished = true;
delete tr;
delete ip;
}