SHARE
TWEET

Untitled

a guest Jun 25th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. img = cv2.imread('image.jpg')
  2. blank_image = np.zeros((1, 40, 3), np.float32)
  3. img = np.concatenate((img, blank_image), axis=1)
  4.      
  5. ValueError: all the input arrays must have same number of dimensions
  6.      
  7. shape = img.shape
  8. shape = list(shape)
  9. #axis dimmension
  10. shape[1] = 1
  11. shape = tuple(shape)
  12. blank_image = np.zeros(shape, np.float32)
  13.      
  14. def createBorder( ):
  15. global img # image in which we want to append
  16. borderType = cv.BORDER_CONSTANT
  17. TDLU=[0 , 1, 0 , 1 ]#top,down,left,right values
  18. img = cv.copyMakeBorder(img, TDLU[0] , TDLU[1] , TDLU[2] , TDLU[3] , borderType, None, 255)
  19. row, col = img.shape
  20. print(row, col)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top