This file contains 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
''' | |
Preserve EXIF data after PIL manipulation of an image. | |
Requires exiftool.exe. Download from http://www.sno.phy.queensu.ca/~phil/exiftool/ | |
Basically, do not save the manipulated image over the old image. Exiftool can | |
copy the data from old to new. | |
''' | |
from PIL import Image | |
import subprocess |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Tests the various feature detector algorithms in OpenCV 2.4 on one image | |
@SINCE: Thu Sep 13 23:01:23 2012 | |
@VERSION: 0.1 | |
@REQUIRES: OpenCV 2.4 (I used 2.4.0), matplotlib |
This file contains 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
# PIL RGB 'im' to CV2 BGR 'imcv' | |
imcv = np.asarray(im)[:,:,::-1].copy() | |
# Or | |
imcv = cv2.cvtColor(np.asarray(im), cv2.COLOR_RGB2BGR) | |
# To gray image | |
imcv = np.asarray(im.convert('L')) | |
# Or | |
imcv = cv2.cvtColor(np.asarray(im), cv2.COLOR_RGB2GRAY) |
NewerOlder