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...


No comments:

Post a Comment