Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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

Browse Categories

...