Friday, October 2, 2015

Load and Reading Image

The first step in any image processing stuff is to load and read the image for further prepossessing. Lets Code

Start with importing the packages need for the process

import cv2                                              
import numpy as np                        
"both this is need for image processing in python"

"Next is to load image, lets using the sample image provide in windows the famous Desert.jpg "
img= cv2.imread('C:\Users\Public\Pictures\Sample Pictures\Desert.jpg',0)
"please be sure on the syntax or you will get syntax error "
"Until here the image is loaded, please ensure that the location of the image is correct"

cv2.imshow("image",img)
cv2.waitKey(0)
"wait for anykey"
cv2.destroyALLwindows()

"If you have followed all the steps correctly you should have a window pop with a grey scaled desert.jpg if it doesn't give show the expected result please refer to you image location"

Oh well that all for now...


Testing Your Setting....

The foremost thing you want to check is whether your setting are correct.
Open your Ipython2.7 then type in import cv2 and print cv2.__version__

You should see the following results.







If you got this then everything is correct...
Greetings, this blog is about my experience with Image Processing using Open CV3 and Anaconda Python. Well I'm not so good with words so lets get started.

1)First download Anaconda Python 2.7(https://www.continuum.io/downloads#_windows)
2)Then download OpenCV3.0.0 (http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download)  
3)Install Anaconda and opencv 3.0
4)Copy the file cv2.pyd  in your opencv folder (Open CV\opencv\opencv\build\python\2.7\x64) and open anaconda python dir and paste the cv2.pyd file in C:\Users\<your username>\Anaconda\Lib\site-packages
5) Your ready to go...