Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to apply median filter to a sequence of images?

$
0
0
I'm able to filter one image but when using sequence of images in loop ,it is not working. Here is my c++ code: vector files; int main(int argc, char** argv) { //create empty window namedWindow("Original Image", CV_WINDOW_AUTOSIZE); // Load an image from file //Mat src = imread("image3170.jpg", CV_LOAD_IMAGE_UNCHANGED); glob("C:/Users/Documents/Pictures/Pics/*.jpg", files); for (size_t i = 0; i < files.size(); i++) { Mat src = imread(files[i]); //show the loaded image imshow("Original Image", src); Mat dst = imread(files[i]); char zBuffer[35]; for (int i = 1; i < 7; i = i + 2) { //copy the text to the "zBuffer" _snprintf_s(zBuffer, 35, "Kernel Size : %d x %d", i, i); //smooth the image using Median kernel in the "src" and save it to "dst" medianBlur(src, dst, i); //show the blurred image imshow("Smoothed Image", dst); //show the black image with the text imshow("Smoothed Image", dst);

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>