Read An Digital Image using Computer Vision with Source Code.
Introduction: - an image is
nothing but a collection of pixels or technically we can say that ( A pixel
of the linear array is called image) pixel is a tinny part of the image that contain
three things Length, Width and channel (channel contain there color range)
basically in this blog we can discuss how images can be read from an open cv
technique. As above we discuss the image now let move further to open cv.
Open CV: - the term open cv is an
computer vision core functional library that aims to visualize the digital
image and help to the system to understand the complete image input.
Steps:- if you have pycharm IDE
you should have to install the open cv library using cmd open cmd prompt and
type this command PIP install OpenCV-python so within in a couple of mints you
have to use the OpenCV library features and fully function
Source code:-
#to read image
#Step 1 to import cv library using cv2
module
import
cv2
img=cv2.imread("2.jpg",1)
#Step 2: create a variable like img that conatin
the address of given input image using imread function to get image inside the
function we pass the argument of the image name and it format.
cv2.imshow('output',img)
#Step 3: Hear we can implement imshow function that
help us to disply image over screen and we can write any name to the output
image and initialize the img variable to get the imaga from imread function
cv2.waitKey(0)
# to hold the scree
output :-
Complete source code :-
#to read image
# import cv library
import
cv2
img=cv2.imread("2.jpg",1)
#use imread function to get image
cv2.imshow('output',img)
cv2.waitKey(0)
# to hold the scree
Thank you for more blog
subscribe to our website alert or message your email for further update






0 Comments