Posts

Showing posts from November, 2018

Create Tranck Bar:

        Mat src = imread("MyPic.JPG");         namedWindow("My Window", 1);         int iSliderValue1 = 50; createTrackbar("Brightness", "My Window", & iSliderValue1 , 100); int iSliderValue2 = 50; createTrackbar("Contrast", "My Window", & iSliderValue2 , 100);                  Mat dst;          src .convertTo(dst, -1, dContrast, iBrightness);         imshow("My Window", dst);          IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII //Uncomment the following line if you are compiling this code in Visual Studio #include "stdafx.h" #include <opencv2/opencv.hpp> #include <iostream> #include <opencv2/cv.h> #include <opencv2/highgui.h> using namespace cv; using namespace std; /// Global Variables const int alpha_slider_max = 100; int alpha_slider; double alpha; double beta; /// Matrices to stor

Filter Images and Videos

Image
In the image process the image filtering is a neighborhood operation in which the value of any given pixel in the output image is determined by applying a certain algorithm to the pixel values ​​in the vicinity of the corresponding input pixel . This technique is commonly used to smooth, sharpen and detect edges of images and videos. Filtering:   neighborhood operation   pixel algorithm to the pixel values ​​in the vicinity of the corresponding input pixel . smooth, sharpen and detect edges of images and videos. Example Algorithms  Mean Filter Weighted Average Filter Median Filter Min Filter Max Filter Inbuilt functions: blur : function blur(image, image_blurred_with_3x3_kernel, Size(3, 3)); blur(image, image_blurred_with_5x5_kernel, Size(5, 5));         String window_name = "The Guitar"; String window_name_blurred_with_3x3_kernel = "The Guitar Blurred with 3 x 3 Kernel"; String window_name_b

Play Video From Camera

In this opencv program we will extract frames (images from the video file or camera and show it in a continuous loop. https://www.snaptubeapp.com/ capture the sound from a video  file or  a microphone. //Uncomment the following line if you are compiling this code in Visual Studio #include "stdafx.h" #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; int main(int argc, char* argv[]) { //open the video file for readings VideoCapture cap("C:/Users/GitHub/ /Sample1/HellowWorldAPP/ /Archive/01Video_PlayVideoFromCamera/20151105150422.mp4"); // if not success, exit program if (cap.isOpened() == false) { cout << "Cannot open the video file" << endl; cin.get(); //wait for any key press return -1; } //Uncomment the following line if you want to start the video in the middle //cap.set(CAP_PROP_POS_MSEC, 300); //get the frames rate of the video double fps =