Ask Your Question

Problem with call of function bm3dDenoising() and xphoto ...

asked 2017-01-25 08:37:48 -0500

agatte gravatar image


I would like to create small opencv script woth BM3D denoising. I can't call propely this fucntion in opencv

bm3dDenoising() ? Could anyone help me please ? About include and Namespace ?

using namespace cv::xphoto;
using namespace std;

    int main()
 //Load an Image
 Mat img = imread("C:\\image2.jpg", CV_LOAD_IMAGE_COLOR);
 namedWindow("Image", CV_WINDOW_AUTOSIZE);
 imshow("Image", img);

 //Blur Effect
 GaussianBlur(img, img, cv::Size(3, 3), 0);
 cv::xphoto::bm3dDenoising(img, img);  // ????
 namedWindow("Output", CV_WINDOW_AUTOSIZE);
 imshow("Output", img);
 //Wait Key press
 return 0;
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-01-25 09:22:46 -0500

LBerger gravatar image

updated 2017-01-25 09:30:18 -0500

You have to try first this sample :

sigma = 15.0;searchWindowSize = 16;templateWindowSize = 4;
cv::xphoto::bm3dDenoising(src, res, sigma, templateWindowSize, searchWindowSize);

doc is here

Samples in opencv 3.2.0 is OK with default parameter -i=samples/data/lena.jpg

you have to wait 30 seconds in debug mode ...

edit flag offensive delete link more


But it doesn't work... I got a bugs like this : Severity Code Description Project File Line Suppression State Error (active) name followed by '::' must be a class or namespace name Project1 c:\Users\Visual Studio 2015\Projects\Project1\Project1\Project1.cpp 35 Error C3083 'xphoto': the symbol to the left of a '::' must be a type Project1 c:\users\visual studio 2015\projects\project1\project1\project1.cpp 35 Error C2039 'bm3dDenoising': is not a member of 'cv' Project1 c:\users\visual studio 2015\projects\project1\project1\project1.cpp 35 Error C3861 'bm3dDenoising': identifier not found Project1 c:\users\visual studio 2015\projects\project1\project1\project1.cpp 35

agatte gravatar imageagatte ( 2017-01-25 10:00:50 -0500 )edit

I don;t know ... I have to add more includes ?

agatte gravatar imageagatte ( 2017-01-25 10:02:14 -0500 )edit

#include "opencv2/xphoto.hpp" (xphoto, not photo)

berak gravatar imageberak ( 2017-01-25 10:50:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-01-25 08:37:48 -0500

Seen: 196 times

Last updated: Jan 25 '17