Skip to main content

cv2_plt_imshow

Using matplotlib_imshow for images read by cv2

Introduction

One of the major issue faced while using cv2, especially when you are using jupyter-notebooks, is to perform cv2.imshow the kernel breaks. Apart from this, most of the users are comfortable using matplotlib for display, specially its display in notebook using %matplotlib inline magic.

This package provides two of the main function, converting the image to a format more suitable in matplotlib, and plotting the image using matplotlib in the notebooks.

Table of contents

Setup

pip install cv2_plt_imshow

Usage

import cv2
import matplotlib.pyplot as plt
from cv2_plt_imshow import cv2_plt_imshow, plt_format

# read image
im1 = cv2.imread('./images/potrait.jpg')

# use cv2_plt_imshow function to plot any image that was read by cv2, but is plotted using pyplot
cv2_plt_imshow(im1)

# Convert the image to be suitable for pyplot format and later use it for plotting using pyplot functions
im2 = cv2.imread('./images/landscape.jpg')
fig, axs = plt.subplots(2 , figsize=(20,20))
fig.suptitle('Vertically stacked subplots')
axs[0].imshow(plt_format(im1))
axs[1].imshow(plt_format(im2))

Dependencies

Contact

Release files for cv2-plt-imshow 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cv2-plt-imshow 0.0.1
File Size Uploaded
cv2_plt_imshow-0.0.1.tar.gz 2.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cv2-plt-imshow 0.0.1
File Interpreter ABI Platform
cv2_plt_imshow-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 kB

Release files / cv2_plt_imshow-0.0.1.tar.gz

Download URL cv2_plt_imshow-0.0.1.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e7f33fe6b8e3aa00bd18e61a879a9b6014873dfb962e8afc225f6fd758c7a6fc
BLAKE2b-256 checksum
How to use checksums
c196300763974de5d8b140b97c8a976c203508aa26de8c831d7dc41985ad85fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

Release files / cv2_plt_imshow-0.0.1-py3-none-any.whl

Download URL cv2_plt_imshow-0.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc889a4796bd84eab2d886c7e3ff0080ce2c9eb16a20867e16a7ce8309e68813
BLAKE2b-256 checksum
How to use checksums
cb9de276c41b1c407815a4b60d46860aa7ca661527d0a577d8b68cb0c90ca10c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page