<commit_before>#include <cv.h>
#include <highgui.h>
#include <iostream>

using namespace cv;

/// Global Variables
const int alpha_slider_max = 100;
int alpha_slider;
double alpha;
double beta;

/// Matrices to store images
Mat src1;
Mat src2;
Mat dst;

/**
 * @function on_trackbar
 * @brief Callback for trackbar
 */
void on_trackbar(int, void*) {
	alpha = (double) alpha_slider / alpha_slider_max;
	beta = (1.0 - alpha);

	addWeighted(src1, alpha, src2, beta, 0.0, dst);

	imshow("Linear Blend", dst);
}

int main(int argc, char** argv) {
	/// Read image ( same size, same type )
	src1 = imread("/home/sina/Pictures/img1.jpg");
	src2 = imread("/home/sina/Pictures/img2.jpg");

	if (!src1.data) {
		printf("Error loading src1 \n");
		return -1;
	}
	if (!src2.data) {
		printf("Error loading src2 \n");
		return -1;
	}

	/// Initialize values
	alpha_slider = 0;

	/// Create Windows
	namedWindow("Linear Blend", 1);

	/// Create Trackbars
	char TrackbarName[50];
	sprintf(TrackbarName, "Alpha x %d", alpha_slider_max);

	createTrackbar(TrackbarName, "Linear Blend", &alpha_slider,
			alpha_slider_max, on_trackbar);

	/// Show some stuff
	on_trackbar(alpha_slider, 0);

	/// Wait until user press some key
	waitKey(0);
	return 0;
}<commit_msg>Implemented a simple program to capture one frame from the default camera and save it to a predefined location<commit_after>#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

int main(int argc, const char** argv)
{
	VideoCapture cap(0);
	Mat frame, frameCopy, image;

	if (!cap.isOpened())  // if not success, exit program
		cout << "No camera detected" << endl;

	double dWidth = cap.get(CV_CAP_PROP_FRAME_WIDTH); //get the width of frames of the video
	double dHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT); //get the height of frames of the  video
	cout << "Frame size : " << dWidth << " x " << dHeight << endl;
	namedWindow("Camera Feed", CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"

	cout << "In capture ..." << endl;
	while (true)
	{
		Mat frame;
		bool bSuccess = cap.read(frame); // read a new frame from video
		if (!bSuccess) //if not success, break loop
		{
			cout << "Cannot read a frame from video file" << endl;
			break;
		}

		imshow("Camera Feed", frame); //show the frame in "MyVideo" window

		if (waitKey(30) == 32){ //27 is Esc
			cout << "Saving the image to /home/sina/Desktop/test.jpg" << endl;
			imwrite("/home/sina/Desktop/test.jpg", frame);

			break;
		}
	}

	waitKey(0);
	cvDestroyWindow("Camera Feed");

	return 0;
}
{'fraction_non_alphanumeric': 0.14129615674453655, 'fraction_numerical': 0.015071590052750565, 'mean_word_length': 3.8537477148080437, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2792132', 'n_tokens_mistral': 990, 'n_tokens_neox': 923, 'n_words': 285}