![]() ls python*Ĭoncluding this OpenCV Python Tutorial, we have successfully saved the image with specified name using cv2.imwrite() function. Let us manually check if the image is saved. Reading the return value of imwrite() is very important as sometimes there could be multiple reasons that fail the disk write operation and resulting in the image not written to disk. Image written to file-system : TrueĬv2.imwrite() returned true which means the file has been successfully written to the path specified. Print("Image written to file-system : ",status) Status = cv2.imwrite('/home/img/python_grey.png',grey_img) Download simple-image-download.py from my github and use it in your project Use command pip install simpleimagedownload Note on Windows for python-magic 0.4.18 which is used for this Project You'll need DLLs for libmagic Here the includes binaries to PyPI. Grey_img = cv2.imread('/home/img/python.png', cv2.IMREAD_GRAYSCALE) In this example, we will read an image, then transform it to grey image and save this image data to local file. Returns True is returned if the image is written to file system, else False.Second Argument is ndarray containing image.First Argument is Path to the destination on file system, where image is ought to be saved.The syntax of cv2.imwrite() function is cv2.imwrite('/path/to/destination/image.png',image)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |