{"nbformat":4,"nbformat_minor":1,"cells":[{"cell_type":"code","execution_count":null,"source":"import pandas as pd\nimport numpy as np\nimport sklearn as skl\nimport scipy as sp\nimport random\nimport math\nfrom cv2 import *\nimport matplotlib.pyplot as plt\nfrom subprocess import check_output","outputs":[],"metadata":{"collapsed":true,"_cell_guid":"96e3ea3c-ea91-42c9-912e-f3ccfa8f4fbf","_uuid":"565b237a26f40d6469014f222089b767d22c2d3c"}},{"cell_type":"code","execution_count":null,"source":"print(check_output([\"ls\", \"../input/train/\"]).decode(\"utf8\"))","outputs":[],"metadata":{"_cell_guid":"1d587d08-8ea5-4ea3-935c-c79fbd7a5939","_uuid":"07b1f61ceb1c6c2a347885242b38f9d866164763"}},{"cell_type":"code","execution_count":null,"source":"print(check_output([\"ls\", \"../input/train/Samsung-Galaxy-Note3\"]).decode(\"utf8\"))","outputs":[],"metadata":{"_cell_guid":"3d4cf2e8-eee9-4e2a-bbe8-8d5c135c8a9d","_uuid":"3211a06a47acf80a7b02cd5e7cf79975923a9bef"}},{"cell_type":"code","execution_count":null,"source":"print(list(check_output([\"ls\", \"../input/train/iPhone-6\"]).decode(\"utf8\").split())[:5])","outputs":[],"metadata":{"_cell_guid":"49b61ba2-a4e5-407d-88df-b36c31216bf9","_uuid":"74d058275508fd7ee827a5661811f0bc7d55e121"}},{"cell_type":"code","execution_count":null,"source":"for i in list(check_output([\"ls\", \"../input/train/iPhone-6\"]).decode(\"utf8\").split())[10:13]:\n    image = imread(\"../input/train/iPhone-6/\"+i)\n    image = cvtColor(image, COLOR_BGR2RGB)\n    plt.imshow(image)\n    plt.show()","outputs":[],"metadata":{"_cell_guid":"45e65ba0-3b85-4546-ad40-e2121b6f8c2a","_uuid":"5b5b7a71ebd211ce02eae487cfc47db1240baf00"}},{"cell_type":"code","execution_count":null,"source":"image = imread(\"../input/train/iPhone-6/(iP6)120.jpg\")\nimage = cvtColor(image, COLOR_BGR2RGB)\nplt.imshow(image)\nplt.show()\n#color histogram of the above image\nimg = imread(\"../input/train/iPhone-6/(iP6)120.jpg\")\ncolor = ('b','g','r')\nfor i,col in enumerate(color):\n    histiP = calcHist([img],[i],None,[256],[0,256])\n    plt.plot(histiP,color = col)\n    plt.xlim([0,256])\nplt.xlabel('intensity')\nplt.ylabel('no of pixels')\nplt.title('Understanding pixel distribution')\nplt.show()","outputs":[],"metadata":{"_cell_guid":"89db4ac5-f7db-4bd4-9082-705f9c41e507","_uuid":"c37631a88a2aba2549d8f9207ac3b0ceda7c7adb"}},{"cell_type":"code","execution_count":null,"source":"image = imread(\"../input/train/Samsung-Galaxy-Note3/(GalaxyN3)140.jpg\")\nimage = cvtColor(image, COLOR_BGR2RGB)\nplt.imshow(image)\nplt.show()\n#color histogram of the above image\nimg = imread(\"../input/train/Samsung-Galaxy-Note3/(GalaxyN3)140.jpg\")\ncolor = ('b','g','r')\nfor i,col in enumerate(color):\n    histS3 = calcHist([img],[i],None,[256],[0,256])\n    plt.plot(histS3,color = col)\n    plt.xlim([0,256])\nplt.xlabel('intensity')\nplt.ylabel('no of pixels')\nplt.title('Understanding pixel distribution')\nplt.show()","outputs":[],"metadata":{"_cell_guid":"8bf94fca-f0fd-4606-b801-cf805cb688f8","_uuid":"d657879cf6f2bc9c5e225d886427a6662754782a"}},{"cell_type":"code","execution_count":null,"source":"img = imread(\"../input/train/iPhone-6/(iP6)120.jpg\")\nimg = cv2.cvtColor(img, COLOR_RGB2GRAY)\n\nlaplacian = cv2.Laplacian(img,cv2.CV_64F)\nsobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)\nsobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5)\n\nplt.imshow(img)\nplt.title('Original'), plt.xticks([]), plt.yticks([])\nplt.show()\nplt.imshow(laplacian)\nplt.title('Laplacian'), plt.xticks([]), plt.yticks([])\nplt.show()\nplt.imshow(sobelx)\nplt.title('Sobel X'), plt.xticks([]), plt.yticks([])\nplt.show()\nplt.imshow(sobely)\nplt.title('Sobel Y'), plt.xticks([]), plt.yticks([])\nplt.show()","outputs":[],"metadata":{"_cell_guid":"dffdd0e8-a409-47fb-bb2e-c3e66285134a","_uuid":"1d0d1af966f371330256477589cc477eb7ae5247"}},{"cell_type":"code","execution_count":null,"source":"img = imread(\"../input/train/iPhone-6/(iP6)10.jpg\")\nimg = cv2.cvtColor(img, COLOR_RGB2GRAY)\nplt.imshow(img)\nplt.show()","outputs":[],"metadata":{"collapsed":true,"_cell_guid":"35a10b46-e641-434d-bf42-977e7daaa258","_uuid":"89c808fda76488a3e93e5a8d239842acf51541bc"}},{"cell_type":"code","execution_count":null,"source":"","outputs":[],"metadata":{"collapsed":true,"_cell_guid":"a8fcefa5-26a1-41dd-9276-978dd5d230e1","_uuid":"2bc3530c295e7bbfcdf265b74b368aa3dab56195"}}],"metadata":{"kernelspec":{"display_name":"Python 3","name":"python3","language":"python"},"language_info":{"pygments_lexer":"ipython3","version":"3.6.3","name":"python","file_extension":".py","nbconvert_exporter":"python","codemirror_mode":{"version":3,"name":"ipython"},"mimetype":"text/x-python"}}}