Make a color image to gray scale image using C++
#include <opencv2/opencv.hpp> using namespace cv; int main() { // Read the color image Mat colorImage = imread(“input_color_image.jpg”, IMREAD_COLOR); // Convert the color image to grayscale Mat grayImage; cvtColor(colorImage, grayImage, COLOR_BGR2GRAY); // Save the grayscale image imwrite(“output_gray_image.jpg”, grayImage); return 0; } 1 ) In these code we explain about the this line includes the …
Make a color image to gray scale image using C++ Read More »