This article aims to learn how to save an image from one location to any other desired location on your system in CPP using OpenCv. Using OpenCV, we can generate a blank image with any colour one wishes to.
So, let us dig deep into it and understand the concept with the complete explanation.
Code : C++ code for saving an image to any location in OpenCV.
This part of the code reads the image from the path we have given to it. And it takes care of any error (if occurs). If there is no image present at this path, then “Can not open or image is not present” message will display and at the press of any key, the window will exit.
This part of the code write the image to the defined path and if not successful, it will generate “Mission – Saving the image, FAILED” message and at the press of any key, the window will exit. And rest of the code will create the window and display the image in it. It will keep on displaying the image in the window until the key is pressed. Finally, the window will be destroyed.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Saving Operated Video from a webcam using OpenCV
- OpenCV | Displaying an Image
- Image Inpainting using OpenCV
- OpenCV | Understanding Brightness in an Image
- Image Processing without OpenCV | Python
- Python | Image blurring using OpenCV
- OpenCV | Understanding Contrast in an Image
- OpenCv | Coloured Blank Image
- OpenCV | Hands on Image Brightness
- OpenCV | Hands on Image Contrast
- Image Steganography using OpenCV in Python
- Reading an image in OpenCV using Python
- Image Registration using OpenCV | Python
- Image Translation using OpenCV | Python
- Image Resizing using OpenCV | Python
- Image Pyramid using OpenCV | Python
- Cartooning an Image using OpenCV - Python
- OpenCV C++ Program to blur an image
- OpenCV Python Program to blur an image
- Python | Detect corner of an image using OpenCV
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.