How to read photo using cv2 module in python

0 votes

I am working on a project that is related to image processing concept. For that I have to read one image in my python code.

How can I do that? Is any python code available for that?

Thank You

Apr 9, 2020 in Python by akhtar
• 38,260 points
741 views

1 answer to this question.

0 votes

Hi@akhtar,

Yes, you can read your image in your python code. For that you have to use cv2 module in your code. You can use the below given code for that.

import cv2
photo = cv2.imread('img.png')
cv2.imshow('My Photo', photo)
cv2.waitKey()
cv2.destroyAllWindows()

Hope this will help you.

Thank You

answered Apr 9, 2020 by MD
• 95,460 points

Related Questions In Python

0 votes
1 answer

How to fetch HTML code using urllib module in Python?

Hi@akhtar, You can use urllib module to fetch ...READ MORE

answered Jun 26, 2020 in Python by MD
• 95,460 points
988 views
0 votes
1 answer

How to remove a file using the OS module in Python?

Hi@akhtar, In Python, you can use the os. remove() method to remove ...READ MORE

answered Oct 18, 2020 in Python by MD
• 95,460 points
1,136 views
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
15,277 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,020 points
1,576 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
0 votes
1 answer

video streaming using cv2 module in python.

Hi@akhtar, Yes, you can use cv2 module for ...READ MORE

answered Apr 15, 2020 in Python by MD
• 95,460 points
828 views
0 votes
1 answer

How to crop face from a photo using cv2 in python?

Hi@akhtar, You can do this task using cv2 ...READ MORE

answered Apr 9, 2020 in Python by MD
• 95,460 points
892 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP