Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mat temp_1_mat,temp_2_mat,temp_3_mat;
- temp_1_mat = imread("./img_1.jpg",CV_LOAD_IMAGE_COLOR);
- imwrite("temp_1_mat_before.jpg", temp_1_mat);
- //temp_2_mat = cv::Mat::zeros(cv::Size(temp_1_mat.rows, temp_1_mat.cols), CV_8UC3);
- try {
- std::cout << "cvtColor being\n";
- std::cout << "rows = " << temp_1_mat.rows << std::endl;
- std::cout << "cols = " << temp_1_mat.cols << std::endl;
- std::cout << "channels = " << temp_1_mat.channels() << std::endl;
- cv::cvtColor(temp_1_mat, temp_2_mat, CV_BGR2GRAY);
- imwrite("temp_1_mat_after.jpg", temp_1_mat);
- imwrite("temp_2_mat_1.jpg", temp_2_mat);
- cv::cvtColor(temp_1_mat, temp_2_mat, CV_BGR2GRAY);
- imwrite("temp_2_mat_2.jpg", temp_2_mat);
- std::cout << "cvtColor end\n";
- } catch (const std::exception& e) {
- std::cout << "CVTCOLOR EXCEPTION :: " << e.what() << std::endl;
- }
Add Comment
Please, Sign In to add comment