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 in Python by akhtar
• 10,580 points

1 answer to this question.

0 votes


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)

Hope this will help you.

Thank You

answered Apr 9 by MD
• 23,050 points

Related Questions In Python

+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
+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
• 57,530 points
0 votes
1 answer

How to install Python MySQLdb module using pip?

It's easy to do, but hard to ...READ MORE

answered Aug 20, 2018 in Python by charlie_brown
• 7,760 points
0 votes
1 answer

How to read Excel File in Python

With pandas it is possible to get ...READ MORE

answered Oct 22, 2018 in Python by Priyaj
• 57,530 points
+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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 947 views
0 votes
0 answers
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 in Python by MD
• 23,050 points
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 in Python by MD
• 23,050 points