{ "cells": [ { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import cv2\n", "import os\n", "from scipy.misc import imsave\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dir_in = \"./data/IMG/\"\n", "dir_out = \"./data/IMG_FLIP/\"\n", " \n", "for fn in os.listdir(dir_in):\n", " img_file = dir_in + fn\n", " img = plt.imread(img_file)\n", " fimg = cv2.flip(img,1)\n", " imsave(dir_out + fn, fimg)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:carnd]", "language": "python", "name": "conda-env-carnd-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 1 }