In the macOS/Linux environment, there are often issues that do not work properly. Even when referring to solutions online, there are cases where some work and others do not. The issue was resolved by using the following code in the playground.py file:

cv2.imshow("img",img)

cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.waitKey(0)

Environment: macOS, PyCharm, Python 3.7.