#include<iostream>
#include<opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image_test,image_gray,image_resize,image_rotate;
Size test_size;
test_size.height = 80;
test_size.width = 100;
image_test = imread("front.bmp", IMREAD_UNCHANGED);
cvtColor(image_test, image_gray, CV_BGR2GRAY);
resize(image_test, image_resize, test_size, (0, 0), (0, 0), INTER_LINEAR);
Mat image_create3(2, 2, CV_8UC3, Scalar(0, 0, 255));
Mat image_create1(2, 2, CV_8UC1, Scalar(50));
vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);
compression_params.push_back(100);
imwrite("../../images/imwrite_test.jpg", image_resize, compression_params);
uchar B, G, R;
for (int i = 0; i < image_test.rows; i++)
{
for (int j = 0; j < image_test.cols; j++)
{
B = image_test.ptr<Vec3b>(i)[j][0];
G = image_test.ptr<Vec3b>(i)[j][1];
R = image_test.ptr<Vec3b>(i)[j][2];
}
}
B = image_gray.ptr<uchar>(200)[200];
for (int i = 0; i < image_test.rows; i++)
for (int j = 0; j < image_test.cols; j++)
{
image_test.at<Vec3b>(i, j)[0] = 0;
image_test.at<Vec3b>(i, j)[1] = 0;
image_test.at<Vec3b>(i, j)[2] = 255;
}
return 0;
}