1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Add diamond structuring element

This commit is contained in:
Kavyansh Tyagi
2025-06-11 15:54:29 +05:30
parent fcc76c120f
commit 452882c007
4 changed files with 36 additions and 2 deletions
@@ -0,0 +1,17 @@
#include "test_precomp.hpp"
namespace opencv_test { namespace {
TEST(MorphShapes, getStructuringElementDiamond)
{
cv::Mat element = cv::getStructuringElement(cv::MORPH_DIAMOND, cv::Size(5,5));
cv::Mat expected = (cv::Mat_<uchar>(5,5) <<
0,0,1,0,0,
0,1,1,1,0,
1,1,1,1,1,
0,1,1,1,0,
0,0,1,0,0);
EXPECT_EQ(0, cvtest::norm(element, expected, cv::NORM_INF));
}
}} // namespace