Deconvolution with OpenCV?

c++, image-processing, opencv

Solution

Sure, you can write a deconvolution Code using OpenCV. But there are no ready to use Functions (yet).

To get started you can look at this Example that shows the implementation of Wiener Deconvolution in Python using OpenCV.

Here is another Example using C, but this is from 2012, so maybe it is outdated.

Problem

Is there a way of doing deconvolution with OpenCV? I'm just impressed by the improvement shown here and would like to add this feature also to my software. EDIT (Additional information for bounty.) I still have not figured out how to implement the deconvolution. This code helps me to sharpen the image, but I think the deconvolution could do it better. ``` void ImageProcessing::sharpen(QImage & img) { IplImage* cvimg = createGreyFromQImage( img ); if ( !cvimg ) return; IplImage* gsimg = cvCloneImage(cvimg ); IplImage* dimg = cvCreateImage( cvGetSize(cvimg), IPL_DEPTH_8U, 1 ); IplImage* outgreen = cvCreateImage( cvGetSize(cvimg), IPL_DEPTH_8U, 3 ); IplImage* zeroChan = cvCreateImage( cvGetSize(cvimg), IPL_DEPTH_8U, 1 ); cvZero(zeroChan); cv::Mat smat( gsimg, false ); cv::Mat dmat( dimg, false ); cv::GaussianBlur(smat, dmat, cv::Size(0, 0), 3); cv::addWeighted(smat, 1.5, dmat, -0.5 ,0, dmat); cvMerge( zeroChan, dimg, zeroChan, NULL, outgreen); img = IplImage2QImage( outgreen ); cvReleaseImage( &gsimg ); cvReleaseImage( &cvimg ); cvReleaseImage( &dimg ); cvReleaseImage( &outgreen ); cvReleaseImage( &zeroChan ); } ``` Hoping for helpful hints!

Original source