Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

opencv shift image python

import cv2
import numpy as np

img = cv2.imread('images/input.jpg')
num_rows, num_cols = img.shape[:2]

#move 70 cols to right and 110 rows down
translation_matrix = np.float32([ [1,0,70], [0,1,110] ])
img_translation = cv2.warpAffine(img, translation_matrix, (num_cols, num_rows))
cv2.imshow('Translation', img_translation)
cv2.waitKey()
Comment

PREVIOUS NEXT
Code Example
Python :: import django value 
Python :: Calculate Euclidean Distance in Python 
Python :: cassandra python 
Python :: read excel spark 
Python :: python count variable and put the count in a column of data frame 
Python :: spotipy currently playing 
Python :: Python NumPy split Function Example 
Python :: python submit work to redis 
Python :: print(hello world) 
Python :: how to sum all the numbers in a list in python 
Python :: position in array python 
Python :: cheat sheet python 
Python :: python - find specific name in a df 
Python :: python slack 
Python :: python file hashlib 
Python :: Convert two lists into a dictionary in python 
Python :: python merge nested dictionaries 
Python :: python look up how many rows in dataframe 
Python :: generate secret key python 
Python :: joining two lists in python 
Python :: deep copy a dataframe 
Python :: python array input from user 
Python :: django queryset to form 
Python :: python fill zeros left 
Python :: How to Merge train and Test dataset in python 
Python :: convert .py to .exe 
Python :: how to use setattr Python 
Python :: distplot in python 
Python :: how to sort dict by value 
Python :: pandas xa0 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =