#include <iostream>
#include <opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char *argv[])
{
cv::Mat srcImage = cv::imread("./imori.jpg",cv::IMREAD_COLOR);
int width = srcImage.rows;
int height = srcImage.cols;
cv::Mat dstImage = srcImage.clone();
for (int j = 0; j < height;j++)
{
for (int i = 0 ; i < width ; i++)
{
unsigned char tmp = dstImage.at<cv::Vec3b>(j,i)[0] ;
dstImage.at<cv::Vec3b>(j,i)[0] = dstImage.at<cv::Vec3b>(j,i)[2];
dstImage.at<cv::Vec3b>(j,i)[2] = tmp;
}
}
cv::imshow("SrcImage",srcImage);
cv::imshow("DstImage",dstImage);
std::cout << "END!" << std::endl;
cv::waitKey(0);
}