Explore Courses Blog Tutorials Interview Questions
0 votes
in Data Science by (18.4k points)

I am working on the image dataset using the jupyter notebook. I have no issues loading the image. But when I try displaying the image file matrix is been displayed and it keeps on giving me the error "No type Attribute". My image is saved in the same folder where my code is saved.

The code which I am using is:

imgA = cv2.imread("C:\\Users\\Dzaky Ligarwaly-R\\Documents\\pattern recognition\\Biomedical_Image.jpg")

imgB = cv2.imread("C:\\Users\\Dzaky Ligarwaly-R\\Documents\\pattern recognition\\pano.jpg")

The code to reshape the image is:

scale_percent = 60 # percentage of original size

# imgA

width = int(imgA.shape[1] * scale_percent / 100)

height = int(imgA.shape[0] * scale_percent / 100)

dimA = (width, height)

# imgB

width = int(imgB.shape[1] * scale_percent / 100)

height = int(imgB.shape[0] * scale_percent / 100)

dimB = (width, height)

1 Answer

0 votes
by (36.8k points)

The code which you have used is completely correct but then notice the path the file is different maybe you are having the same folder in different paths.  Try looking into the path as it a recurring mistake.

If you want to know more about the Data Science then do check out the following Data Science which will help you in understanding Data Science from scratch

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

29.3k questions

30.6k answers


104k users

Browse Categories