| 914 | { |
| 915 | protected: |
| 916 | void SetUp() override |
| 917 | { |
| 918 | shape = {33, 16, 1, 1}; |
| 919 | srcDT = nvcv::TYPE_U8; |
| 920 | dstDT = nvcv::TYPE_U32; |
| 921 | mskDT = nvcv::TYPE_U8; |
| 922 | |
| 923 | connectivity = NVCV_CONNECTIVITY_4_2D; |
| 924 | assignLabels = NVCV_LABEL_SEQUENTIAL; |
| 925 | maskType = NVCV_REMOVE_ISLANDS_OUTSIDE_MASK_ONLY; // this is the only mask type allowed |
| 926 | |
| 927 | mskShape = {1, shape.z, shape.y, shape.x}; // mskShape is NDHW whereas shape is WHDN |
| 928 | staShape = {1, 10000, (shape.z == 1) ? 7 : 9}; |
| 929 | |
| 930 | // clang-format off |
| 931 | srcTensor = nvcv::Tensor({{shape.y, shape.x}, "HW"}, srcDT); |
| 932 | |
| 933 | bglTensor = nvcv::Tensor({{shape.w}, "N"}, srcDT); |
| 934 | minTensor = nvcv::Tensor({{shape.w}, "N"}, srcDT); |
| 935 | maxTensor = nvcv::Tensor({{shape.w}, "N"}, srcDT); |
| 936 | cntTensor = nvcv::Tensor({{shape.w}, "N"}, dstDT); |
| 937 | staTensor = nvcv::Tensor({{staShape.x, staShape.y, 7}, "NMA"}, dstDT); |
| 938 | staTensor3D = nvcv::Tensor({{staShape.x, staShape.y, 9}, "NMA"}, dstDT); |
| 939 | mszTensor = nvcv::Tensor({{shape.w}, "N"}, dstDT); |
| 940 | mskTensor = nvcv::Tensor({{mskShape.x, mskShape.y, mskShape.z, mskShape.w}, "NDHW"}, mskDT); |
| 941 | |
| 942 | dstTensor = nvcv::Tensor(srcTensor.shape(), dstDT); |
| 943 | // clang-format on |
| 944 | |
| 945 | ASSERT_EQ(cudaSuccess, cudaStreamCreate(&stream)); |
| 946 | } |
| 947 | |
| 948 | void TearDown() override |
| 949 | { |