首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >openv HSV太吵了

openv HSV太吵了
EN

Stack Overflow用户
提问于 2015-07-14 13:08:29
回答 1查看 189关注 0票数 0

日安

我正在尝试通过在指定范围内减去一些颜色来过滤视频。但是,当记录的图像是静止的或没有变化的时候,HSV滤波后的图像看起来抖动和不稳定。这种抖动或不稳定会在我的处理过程中造成很多问题。有什么方法可以稳定地过滤图像吗?

这是我的过滤器的示例代码...代码的一部分

代码语言:javascript
复制
while (1)
    {
        //first frame read
        cap.read(origonal1);
        morphOps(origonal1);
        cvtColor(origonal1, HSV1, COLOR_BGR2HSV);

        inRange(HSV1, Scalar(0, 129,173), Scalar(26,212, 255), thresholdImage1);



        waitKey(36);

        //second image read and convert it to HSV
        cap.read(origonal2);
        morphOps(origonal2);
        cvtColor(origonal2, HSV2, COLOR_BGR2HSV);

        inRange(HSV2, Scalar(28, 89, 87), Scalar(93, 255, 255),thresholdImage2);

        morphOps(thresholdImage1);
        morphOps(thresholdImage2);
//create a mask so that i only detect motion of certain color range and don't 
//care about other colors motion detection
        maskImage = thresholdImage1 | thresholdImage2;

        //make the difference between images

        absdiff(thresholdImage1,thresholdImage2,imageDifference);

        imageDifference = imageDifference&maskImage;
        morphOps(imageDifference);
        imshow("threshold Image", imageDifference);
        //search for movement now update the origonal image
        searchForMovement(thresholdImage1, origonal1);
        imshow("origonal", origonal1);
        imshow("HSV", HSV1);
        imshow("threshold1", thresholdImage1);
        imshow("threshold2", thresholdImage2);
        //wait for a while give a break to the processor
        //waitKey(1000); 

    }

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-09-17 18:23:53

尝试此函数

代码语言:javascript
复制
fastNlMeansDenoisingColored( frame, frame_result, 3, 3, 7, 21 );

它太慢了,但很适合尝试。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31398066

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档