I have this piece of code that works fine on Python. I want to do the same thing in C/C++ but i do not understand how works kernel in C++:
kernel = np.ones((3,3),np.uint8)
opening = cv2.morphologyEx(thresh,cv2.MORPH_OPEN,kernel, iterations = 2)
kernel and opening are Mat objects.
I have also
mat1=np.uint8(mat1)
I do not understand what is this np prefix.
npprefix is thenumpylibrary. OpenCV uses that library for all numeric operations, because Python arrays are very inefficient for numeric computations.