# How to divide spectrums?

**URL:** <https://forum.opencv.org/t/how-to-divide-spectrums/2317>\
**Category:** C++\
**Tags:** core\
**Created:** [March 23, 2021, 10:33am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317 "2021-03-23T10:33:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![themronion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/themronion/32/1512_2.png) [@themronion](https://forum.opencv.org/u/themronion)\
**Post date:** [March 23, 2021, 10:33am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/1 "2021-03-23T10:33:05Z")

</div>

Hey there guys, i am new here. I am trying to implement some deblurring mechanisms. I’ve succesfully used mulSpectrums() but couldn’t find divSpectrums(). How to implement divSpectrums? Can someone give some tips or share their code?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 23, 2021, 10:51am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/2 "2021-03-23T10:51:24Z")

</div>

I’m not aware of a “divSpectrums”. if you’d like to implement that, I’m sure the opencv developers would welcome a pull request.

this might be of interest:

[https://docs.opencv.org/master/de/d3c/tutorial\_out\_of\_focus\_deblur\_filter.html](https://docs.opencv.org/master/de/d3c/tutorial_out_of_focus_deblur_filter.html)

---

<div class="post-metadata">

**Author:** ![themronion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/themronion/32/1512_2.png) [@themronion](https://forum.opencv.org/u/themronion)\
**Post date:** [March 23, 2021, 10:55am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/3 "2021-03-23T10:55:58Z")

</div>

I’ve found this method - [opencv/phasecorr.cpp at 94f00cf09694c38407cce23ed9fea288ab622b0f · opencv/opencv · GitHub](https://github.com/opencv/opencv/blob/94f00cf09694c38407cce23ed9fea288ab622b0f/modules/imgproc/src/phasecorr.cpp#L161)  
Now whats left is to translate it to C# 😃

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 23, 2021, 10:58am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/4 "2021-03-23T10:58:57Z")

</div>

haha it exists but isn’t exposed! that’s weird.

if you think it does the right thing and should become public, please do open an issue on github about it. it looks to be very useful. maybe someone else will supply the pull request, maybe they’ll convince you to DIY.

---

<div class="post-metadata">

**Author:** ![themronion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/themronion/32/1512_2.png) [@themronion](https://forum.opencv.org/u/themronion)\
**Post date:** [March 23, 2021, 11:02am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/5 "2021-03-23T11:02:13Z")

</div>

also in that file there are useful methods like fftshift. Me 2, i dont understand why they are internal

---

<div class="post-metadata">

**Author:** ![themronion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/themronion/32/1512_2.png) [@themronion](https://forum.opencv.org/u/themronion)\
**Post date:** [March 23, 2021, 11:15am UTC](https://forum.opencv.org/t/how-to-divide-spectrums/2317/6 "2021-03-23T11:15:04Z")

</div>

opened an issue, maybe someone will do it

> <https://github.com/opencv/opencv/issues/19767>
>
> I've recently discovered that there is a mulSpectrums() method, but no divSpectrums() method publically available. I've did a small research and...
