0

I would like to be able to do a convolution on an matrix, save the kernel, and then be able to use the output of the convolution to do a deconvolution with the output of the convolution and the kernel to get the original matrix. I am stuck on the deconvolution function, as most of the cases I have found on the internet have either been for matlab or python, and I am using c++. In addition, the cases online are for bigger images, where I am not even going to have images at all, just matrices. Also, most of those cases, because they are for image processing, are assuming noise will be builtin to the original image. As I am using matrices and just a convolution (not adding noise), this won't apply. I have found the correct formula for a deconvolution, but it is kind of over my head as I am not that skilled in advanced math. I would appreciate any help, even just basic pseudocode.

I have tried looking at libraries on the internet, and what I have found is either in matlab, using a lot of libraries (which I don't have in c++), or python, again, using libraries I don't have in c++. They also apply to larger images, whereas in my case the matrices will be smaller. This means a more brute force approach will be ok because the inputs will never be more than 10x10 integers.

oxheron
  • 1
  • 2
  • Application of deconvolution does not need to make any "no noise" assumption. Deconvolution is applied the same way, whether noise is present or not. Some applications will filter out noise before doing deconvolution, some will add noise (e.g. prewhitening) but that doesn't change how deconvolution is applied. – Peter Feb 05 '23 at 01:26
  • That’s true. However, there are ways that have ways to change the output based on assumed noise (or known noise) I was just implying that it isn’t necessary to do that – oxheron Feb 05 '23 at 01:35
  • Is there a reason you can't use libraries? Because openCV can do these things https://learnopencv.com/image-filtering-using-convolution-in-opencv/. That way you can reuse tested algorithms and worry about the other parts of your code. – Pepijn Kramer Feb 05 '23 at 06:40
  • I can use opencv, but afaik it doesn’t have a deconv function. It will be probably useful for the ending solution though – oxheron Feb 05 '23 at 17:01

0 Answers0