Opencv openv HSV噪音太大

Opencv openv HSV噪音太大,opencv,hsv,Opencv,Hsv,你好 我试图通过减去指定范围内的一些颜色来过滤视频。 但是,当记录的图像静止或未改变,但HSV过滤后的图像看起来抖动且不稳定时。 这种震动或不稳定在我的处理过程中造成了很多问题。 有什么方法可以稳定地过滤图像吗 这是我的过滤器的示例代码。。。部分守则 while (1) { //first frame read cap.read(origonal1); morphOps(origonal1); cvtColor(origon

你好

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

这是我的过滤器的示例代码。。。部分守则

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); 

    }
提前感谢。

试试这个功能

fastNlMeansDenoisingColored( frame, frame_result, 3, 3, 7, 21 );

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

您能发布示例图像来显示这种行为吗?以及如何过滤/转换hsv图像的post code您可以查看您请求的详细信息告诉我是否还需要其他信息可能,将hsv图像显示为bgr图像并不直观,因为第一个通道的开始和结束之间会分割红色。你能发布两张输入图像吗?我不知道这两张输入图像是什么意思,但这是我上传的源图像。。任何方式,如果你有一个稳定的方式过滤颜色的想法,我会很高兴听到你尝试双边过滤器或引导过滤器。