You are on page 1of 5

C:\opencv\build\include

C:\opencv\build\x64\vc14\lib
opencv_world331d.lib

-----------------------------------------------------------------------------------
----------------------------------------

#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;

void main()
{
string path = "Resources/pout.tif";
Mat img = imread(path);
imshow("Image", img);
waitKey(0);

-----------------------------------------------------------------------------------
-------------------------------------

#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;

void main()
{
string path = "Resources/orchid.jpg";
Mat img = imread(path);
Mat imgGray;

cvtColor(img, imgGray, COLOR_BGR2GRAY);

imshow("Image", img);
imshow("Image Gray", imgGray);

waitKey(0);

--------------------------------------------------------------------------------

#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;
void main()
{
string path = "Resources/tire.tif";

Mat img = imread(path);


Mat dst;

for (int blur = 1; blur<=9; blur++)


{
medianBlur(img, dst, blur+1);
imshow("Blur", img);
imshow("Result", dst);

return 0;
}

waitKey(0);

---------------------------------------------------------------------------------

#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;

int main( int argc, char** argv)


{
string path = "Resources/tire.tif";
string path1 = "Resources/pout.tif";
string path2 = "Resources/Gaussian.jpg";
string path3 = "Resources/Salt_and_Pepper Noise.png";
string path4 = "Resources/orchid.jpg";
int blur = 1;
for (int blur == 1; blur <= 9; blur = blur+2)
{

Mat img = imread(path);


Mat img = imread(path1);
Mat img = imread(path2);
Mat img = imread(path3);
Mat img = imread(path4);
Mat dst;
Mat dst1;
Mat dst2;
Mat dst3;
Mat dst4;

medianBlur(img, dst, blur);


medianBlur(img1, dst1, blur);
medianBlur(img2, dst2, blur);
medianBlur(img3, dst3, blur);
medianBlur(img4, dst4, blur);

if (blur == 1)
{
imshow("Blur", img);
imshow("Result", dst);
imshow("Blur", img1);
imshow("Result", dst1);
imshow("Blur", img2);
imshow("Result", dst2);
imshow("Blur", img3);
imshow("Result", dst3);
imshow("Blur", img4);
imshow("Result", dst4);
}
if else
{
imshow("Blur", img1);
imshow("Result", dst1);
imshow("Blur", img2);
imshow("Result", dst2);
imshow("Blur", img3);
imshow("Result", dst3);
imshow("Blur", img4);
imshow("Result", dst4);
}
if else
{
imshow("Blur", img2);
imshow("Result", dst2);
imshow("Blur", img3);
imshow("Result", dst3);
imshow("Blur", img4);
imshow("Result", dst4);
}
if else
{
imshow("Blur", img3);
imshow("Result", dst3);
imshow("Blur", img4);
imshow("Result", dst4);
}
else
{
imshow("Blur", img4);
imshow("Result", dst4);
}

waitKey(0);
}

return 0;

-----------------------------------------------------------------------------------
---------------------------------------

#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;

void main ()
{
string path = "Resources/tire.tif";

int blur == 1;
for (int blur == 1; blur < 10; blur = blur+2)
{

Mat img = imread(path);


Mat dst;

medianBlur(img, dst, blur);

if (blur == 1)
{
imshow("Blur", img);
imshow("Result", dst);

if else (blur == 3)
{
imshow("Blur", img);
imshow("Result", dst);
}

if else (blur == 5)
{
imshow("Blur", img);
imshow("Result", dst);
}

if else (blur == 7)
{
imshow("Blur", img);
imshow("Result", dst);
}

else (blur == 9)
{
imshow("Blur", img);
imshow("Result", dst);
}
waitKey(0);
}

-------------------------------------------------------------------------------
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv;


using namespace std;

void main()
{
string path = "Resources/moon.jpg";
Mat img = imread(path);
Mat dst, imgResize;

resize(img, imgResize, Size(320, 428));

Mat imgBrightnessHigh;
imgResize.convertTo(imgBrightnessHigh, -1, 1, 20);

Mat imgBrightnessLow;
imgResize.convertTo(imgBrightnessLow, -1, 1, -20);

imshow("Original", imgResize);

imshow("Low Brightness Image", imgBrightnessLow);


imshow("High Brightness Image", imgBrightnessHigh);

waitKey(0);
}

You might also like