From 6a38f3f53145cf090ee648237abb494e37838234 Mon Sep 17 00:00:00 2001 From: Jsewill Date: Wed, 18 Apr 2012 15:18:05 -0500 Subject: [PATCH] Update OpenCVClient/OpenCVClientViewController.mm *OpenCV uses BGR rather than RGB. This doesn't matter unless you try to use the color image with the included UIImage imageWithCVMat method. Maybe that colorspace conversion should be done there (since it assumes RGB)? I kept getting type issues when I tried to add it to UIImage+OpenCV.mm. --- OpenCVClient/OpenCVClientViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenCVClient/OpenCVClientViewController.mm b/OpenCVClient/OpenCVClientViewController.mm index 5a9bb06..cf31689 100644 --- a/OpenCVClient/OpenCVClientViewController.mm +++ b/OpenCVClient/OpenCVClientViewController.mm @@ -151,7 +151,7 @@ - (void)processFrame cv::Mat grayFrame, output; // Convert captured frame to grayscale - cv::cvtColor(_lastFrame, grayFrame, cv::COLOR_RGB2GRAY); + cv::cvtColor(_lastFrame, grayFrame, cv::COLOR_BGR2GRAY); // Perform Canny edge detection using slide values for thresholds cv::Canny(grayFrame, output,