I'm doing an application in Python, which using the OpenCV library and passing it the height and width, I create a RGB image with the past dimensions and in which I can draw and gurantee later.
I'm trying something like this:
import numpy as np
import cv2
def imRGB(X, Y):
img = np.zeros((X, Y, 3), np.uint8)
cv2.line(img,(10, 0), (250, 128), (0, 255, 0), 3)
cv2.circle(img,(447,63), 63, (0,0,255), -1)
N = img
N.save("imRGB.jpg")
But I can not get it to work since it throws me errors like:
AttributeError: 'numpy.ndarray' object has no attribute 'save'
Could someone help me?
A health and thank you.