I suspect your test_image
has an additional alpha channel per pixel, thus it has 4 channels instead of only three.
Try:
test_image = Image.open(test_image_name).convert('RGB')
More Related Contents:
- PyTorch NotImplementedError in forward
- Use pytesseract OCR to recognize text from an image
- Python OpenCV skew correction for OCR
- How to clean images before OCR with Python OpenCV?
- Detect image orientation angle based on text direction
- How to define a threshold value to detect only green colour objects in an image with Python OpenCV?
- Image segmentation based on edge pixel map [closed]
- Image comparison algorithm
- Removing Horizontal Lines in image (OpenCV, Python, Matplotlib)
- Segmenting License Plate Characters
- How does Pytorch’s “Fold” and “Unfold” work?
- Detect and visualize differences between two images with OpenCV Python
- Automatic contrast and brightness adjustment of a color photo of a sheet of paper with OpenCV
- Converting an OpenCV Image to Black and White
- Detect text area in an image using python and opencv
- Combining Two Images with OpenCV
- Is Laplacian of Gaussian for blob detection or for edge detection?
- module’ object has no attribute ‘drawMatches’ opencv python
- numpy with python: convert 3d array to 2d
- Irregular shape detection and measurement in python opencv
- OpenCV & Python – Image too big to display
- Add padding to images to get them into the same shape
- How to construct a network with two inputs in PyTorch
- Square detection in image
- How do I use OpenCV MatchTemplate?
- How to warp an image using deformed mesh
- Data Augmentation in PyTorch
- How to get the location of all text present in an image using OpenCV?
- Convert image from PIL to openCV format
- How to remove repititve pattern from an image using FFT