Skip to content

Instantly share code, notes, and snippets.

@Coderx7
Created April 13, 2024 08:15
Show Gist options
  • Save Coderx7/feba72d7ab48d2854ceb1cd8412a668f to your computer and use it in GitHub Desktop.
Save Coderx7/feba72d7ab48d2854ceb1cd8412a668f to your computer and use it in GitHub Desktop.
import cv2
import numpy as np
import matplotlib.pyplot as plt
# create a simple image
image = np.kron([[1, 0] * 4, [0, 1] * 4] * 4, np.ones((50, 50))).astype(np.uint8) * 255
# test opencv
cv2.imshow('checkboard',image)
cv2.waitKey(0)
# test matplotlib
plt.imshow(image)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment