I have an image file in the following location.
'D:\\projects\\IMG_2012-09-26T09-00-07.jpg'
While I am trying to read by directly giving the filename it reads the image properly.
Working code
mm = cv2.imread( r'D:\\projects\\IMG_2012-09-26T09-00-07.jpg' )
But when I pass the path as variable, it is showing NoneType Object and is not reading the actual contents of file.
Failed code
tt = 'D:\\projects\\IMG_2012-09-26T09-00-07.jpg'
mm = cv2.imread( tt )
how to pass the name as a variable as it is not static. How to achieve this ?
Really need your support !!!
Did you try?
tt = r'D:\\projects\\IMG_2012-09-26T09-00-07.jpg'
mm= cv2.imread( tt )
Here in this code first we have to import cv2 package and after reading the imagefile we have to use function to display that image