Created
August 2, 2020 14:02
-
-
Save tanviredu/2d122948d616da9292a75673fd47bfa3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### load partial images | |
import cv2 | |
import os | |
#### this function will import the data from the folder | |
def load__partial_images_from_folder(folder,target): | |
images = [] | |
for filename in os.listdir(folder): | |
img = cv2.imread(os.path.join(folder,filename),0) | |
ret2,th2 = cv2.threshold(img,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU) | |
if img is not None: | |
images.append([th2,target]) | |
return images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment