{
(optional)"news": [
{
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
import UIKit | |
extension UIImage { | |
func resizeImage(size: CGSize) -> UIImage? { | |
UIGraphicsBeginImageContextWithOptions(size, true, 1) | |
self.draw(in: CGRect(origin: CGPoint.zero, size: size)) | |
let resizedImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return resizedImage |
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
import cv2 | |
import sys | |
path = sys.argv[1] | |
if len(sys.argv) != 2: | |
print "Usage: %s <image_save_path>" % sys.argv[0] | |
cap = cv2.VideoCapture(0) | |
count = 0 |