# Blur() segfaults on CentOS Linux release 7.5

**URL:** <https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661>\
**Category:** C++\
**Created:** [April 8, 2021, 4:50am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661 "2021-04-08T04:50:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![snjagadale](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@snjagadale](https://forum.opencv.org/u/snjagadale)\
**Post date:** [April 8, 2021, 4:50am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/1 "2021-04-08T04:50:54Z")

</div>

In my application i use blur as follows but it triggers a segmentation fault all time. I tried with Size(image.cols,image.rows) but not helped.

blur(image,image,Size(3,3));

terminate called after throwing an instance of ‘cv::Exception’  
what(): OpenCV(4.5.0-dev) /openCV/opencv/modules/imgproc/src/filter.simd.hpp:100: error: (-215:Assertion failed) this\_.roi.x \>= 0 && this\_.roi.y \>= 0 && this\_.roi.width \>= 0 && this\_.roi.height \>= 0 && this\_.roi.x + this\_.roi.width \<= this\_.wholeSize.width && this\_.roi.y + this\_.roi.height \<= this\_.wholeSize.height in function ‘FilterEngine\_\_start’

Aborted

* * *

please help to resolve this issue.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [April 8, 2021, 8:35am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/2 "2021-04-08T08:35:28Z")

</div>

please check `image.size()` – your input is either invalid, or smaller than the filter

---

<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:** [April 8, 2021, 9:28am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/3 "2021-04-08T09:28:37Z")

</div>

and it’s _not_ a segmentation fault. it’s a violated assertion.

---

<div class="post-metadata">

**Author:** ![snjagadale](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@snjagadale](https://forum.opencv.org/u/snjagadale)\
**Post date:** [April 8, 2021, 10:27am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/4 "2021-04-08T10:27:05Z")

</div>

Input size is 1280,720 that is as expected. My sample application worked with same blur function but in live streaming it is failing.

thanks for your response.

---

<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:** [April 8, 2021, 2:41pm UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/5 "2021-04-08T14:41:45Z")

</div>

how can we help you if you won’t post source code?

---

<div class="post-metadata">

**Author:** ![snjagadale](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@snjagadale](https://forum.opencv.org/u/snjagadale)\
**Post date:** [April 12, 2021, 5:27am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/6 "2021-04-12T05:27:56Z")

</div>

height and width keep changing for different sizes  
Mat image = Mat::zeros(height, width, CV\_8UC4);  
image.data = framePtr;//data of height\*width \*4  
cv::blur(image,image,cv::Size(image.cols,image.rows));

error -  
terminate called after throwing an instance of ‘cv::Exception’  
what(): OpenCV(4.5.0-dev) /root/Sudarshan/openCV/opencv/modules/imgproc/src/filter.simd.hpp:100: error: (-215:Assertion failed) this\_.roi.x \>= 0 && this\_.roi.y \>= 0 && this\_.roi.width \>= 0 && this\_.roi.height \>= 0 && this\_.roi.x + this\_.roi.width \<= this\_.wholeSize.width && this\_.roi.y + this\_.roi.height \<= this\_.wholeSize.height in function ‘FilterEngine\_\_start’

Aborted

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [April 12, 2021, 6:15am UTC](https://forum.opencv.org/t/blur-segfaults-on-centos-linux-release-7-5/2661/7 "2021-04-12T06:15:28Z")

</div>

the Size argument refers to the filter / kernel size, not to the image size.

please try to find out, what a box filter does, and why it makes not much sense to have one in the size of the whole image
