import numpy as np import cv2 img = cv2.imread('messi5.jpg') img2 = cv2.imread('opencv-logo.png') print(img.shape) # returns a tuple of number of rows, columns, and channels print(img.size) # returns total number of pixels is accessed print(img.dtype) # returns image datatype is obtained b,g,r = cv2.split(img) img = cv2.merge((b,g,r)) ball = img[280:340, 330:390] img[273:333, 100:160] = ball img = cv2.resize(img, (512, 512)) img2 = cv2.resize(img2, (512, 512)) dst = cv2.addWeighted(img, .5, img2, .5, 0) cv2.imshow('image', dst) cv2.waitKey(0) cv2.destroyAllWindows()
Popular Posts
-
Serilog is a popular logging library for .NET applications. It provides a flexible and efficient logging framework that allows developers ...
-
original image: import cv2 as cv import numpy as np img = cv.imread( 'sudoku.png' , 0 ) _ , th1 = cv.threshold(img ,...
-
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no i...
May 22, 2020
merge image(openCV) python
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment