Hi, I use cuda toolkit 11.7 npp library.
In my program, 2D 8bit image is saved in gpu VRAM, and i want to label this image.
I use nppiLabelMarkersUF_8u32u_C1R function and 32bit labeld Image is saved in LabelDevPtr.
this function work well.
My source code is below.
bool D2D_CUDA::NppLabelMark()
{
int buffer_size;
NppStatus e;
NppiSize source_roi = { Data.TotalWidth, Data.TotalHeight };
// 레이블링 수행
e = nppiLabelMarkersUF_8u32u_C1R(
(Npp8u*)DiffImageDevPtr, Data.TotalWidth * sizeof(Npp8u), // 이미 존재하는 입력 GPU 메모리 dSrc
LabelDevPtr, Data.TotalWidth * sizeof(Npp32u), // 출력 GPU 메모리 dDst
source_roi, nppiNormL1, // ROI와 연결성(Norm) 설정
LabelBufPtr
);
if (e != NPP_SUCCESS) {
std::cerr << "Error labeling markers: " << e << std::endl;
return false;
}
return true;
}
But i want to get location and size of labels.
For example, let’s assume a labeled image like this
There is 7 labels in picture.
In my source code, LabeldDevPtr save that datas.
I want know additional data like this structure (labelNum, location, size)
location is left top index of same pixels and size is pixel count.
For Instance : (1, 8, 15) , (2, 17, 9) , (4, 113, 14) …
How can i get that datas??
Can i create my custom kernel function, or Is there any similiar library already developed and available for use??
please let me know.