In this video on OpenCV Python Tutorial For Beginners, I am going to show How to do some Basic and Arithmetic Operations on Images. So we will see How to use cv.shape, img.size, img.dtype, cv2.split, cv2.merge, cv2.resize, cv2.add, cv2.addWeighted. we will also see region of interest (ROI) in an image in OpenCV.
img.shape returns a tuple of number of rows, columns, and channels
img.size returns Total number of pixels is accessed
img.dtype returns Image datatype is obtained
cv2.split(img) - output vector of arrays; the arrays themselves are reallocated, if needed.
cv2.merge((b,g,r)) - The number of channels will be the total number of channels in the matrix array.
cv2.resize - resize the image
dst = cv2.add(img, img2) - Calculates the per-element sum of two arrays or an array and a scalar.
dst = cv2.addWeighted(img, .2, img2, .8, 0) - Calculates the weighted sum of two arrays.