Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

cv2 remove black borders on images

def remove_black_borders(image):
    y_nonzero, x_nonzero, _ = np.nonzero(image)
    return image[np.min(y_nonzero):np.max(y_nonzero), np.min(x_nonzero):np.max(x_nonzero)]
Comment

PREVIOUS NEXT
Code Example
Python :: pandas to_csv hebrew 
Python :: python trace code execution 
Python :: one line if statement python 
Python :: object function in python 
Python :: Python __add__ magic method 
Python :: group a dataset 
Python :: seaborn python 
Python :: pip ne marche pas 
Python :: List get both index and value. 
Python :: Python Permutation without built-in function [itertools] for String 
Python :: getch backspace pytohn 
Python :: run python script task scheduler 
Python :: better way to see full csv in jupyter notebook 
Python :: argparse for Command-Line Interface (CLI) 
Python :: how to display python output on html page django 
Python :: pandas csv sum column 
Python :: python read file between two strings 
Python :: flask get request port 
Python :: python divide all values in list 
Python :: calculate the surface area of a cylinder python 
Python :: seaborn heatmap center xticks 
Python :: python3 conditional with boolean 
Python :: sort decreasing python 
Python :: Reducing noise on Data 
Python :: ros teleop 
Python :: number length python 
Python :: python overwrite multiline text 
Python :: python C-like structs 
Python :: discord.py send message to channel with mutiple id 
Python :: pygame get surface region 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =