Ask Your Question
0

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

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

agatte gravatar image

Hello,

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 ?

#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/photo/photo.hpp>
#include<math.h>
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
 cvWaitKey(0);
 //destroy
 cvDestroyWindow("Image");
 cvDestroyWindow("BlurEffect");
 return 0;
}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

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

LBerger gravatar image

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

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

Comments

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 -0600 )edit

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

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

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

berak gravatar imageberak ( 2017-01-25 10:50:19 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 414 times

Last updated: Jan 25 '17