use this:
pil_image = PIL.Image.open('Image.jpg').convert('RGB')
open_cv_image = numpy.array(pil_image)
# Convert RGB to BGR
open_cv_image = open_cv_image[:, :, ::-1].copy()
More Related Contents:
- Change the colors within certain range to another color using OpenCV
- Convert opencv image format to PIL image format?
- How to clean images before OCR with Python OpenCV?
- Detect image orientation angle based on text direction
- How to get the cells of a sudoku grid with OpenCV?
- Python OpenCV line detection to detect `X` symbol in image
- How to straighten a rotated rectangle area of an image using OpenCV in Python?
- OpenCV Python: cv2.findContours – ValueError: too many values to unpack
- Detect and visualize differences between two images with OpenCV Python
- How to template match a simple 2D shape in OpenCV?
- With the Python Imaging Library (PIL), how does one compose an image with an alpha channel over another image?
- Converting an OpenCV Image to Black and White
- Convert RGB to black OR white
- Detect text area in an image using python and opencv
- How do I find an image contained within an image?
- Storing RTSP stream as video file with OpenCV VideoWriter
- How to crop the internal area of a contour?
- How to resize an image with OpenCV2.0 and Python2.6
- Detecting lines and shapes in OpenCV using Python
- how to remove background of images in python
- Equivalent of copyTo in Python OpenCV bindings?
- cv2.imshow command doesn’t work properly in opencv-python
- module’ object has no attribute ‘drawMatches’ opencv python
- Automatic White Balancing with Grayworld assumption
- OpenCV & Python – Image too big to display
- Difference between plt.imshow and cv2.imshow?
- How to remove small connected objects using OpenCV
- How to connect broken lines in a binary image using Python/Opencv
- Image Cropping using Python
- Remove spurious small islands of noise in an image – Python OpenCV