Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

cv2.copyMakeBorder

# Python program to explain cv2.copyMakeBorder() method
  
# importing cv2
import cv2
  
# path
path = r'C:UsersRajnishDesktopgeeksforgeeksgeeks.png'
  
# Reading an image in default mode
image = cv2.imread(path)
  
# Window name in which image is displayed
window_name = 'Image'
 
# Using cv2.copyMakeBorder() method
image = cv2.copyMakeBorder(image, 10, 10, 10, 10, cv2.BORDER_CONSTANT, None, value = 0)
 
# Displaying the image
cv2.imshow(window_name, image)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+8 =