Data Science/Python
[Image Analysis] Completely Black or White Image Detection
Pillow 모듈을 이용하여 완전 검정/완전 흰색 이미지를 탐지하는 기법을 소개한다. 1. Create sample images. from pathlib import Path from PIL import Image # Create directory sample_dir = "./sample" Path(sample_dir).mkdir(exist_ok=True) # Create solid(color) image function def create_solid_image(save_path:str, width=24, height=24, color=(255, 255, 255)): try: new_image = Image.new("RGB", (width, height), color) new_image.save(save..
2023. 7. 27. 02:53
최근댓글