This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
/* Code to generate a LUT for parity */ | |
short computeParity( short num ) | |
{ | |
short parity = 0; | |
while (num > 0) | |
{ | |
parity ^= (x&1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Bubble Sort*/ | |
void bubbleSort(int arr[], int n) | |
{ | |
int i, j; | |
for (i = 0; i < n-1; i++) | |
// Last i elements are already in place | |
for (j = 0; j < n-i-1; j++) | |
if (arr[j] > arr[j+1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opencv_calib3d2413.lib | |
opencv_calib3d2413d.lib | |
opencv_contrib2413.lib | |
opencv_contrib2413d.lib | |
opencv_core2413.lib | |
opencv_core2413d.lib | |
opencv_features2d2413.lib | |
opencv_features2d2413d.lib | |
opencv_flann2413.lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <iostream> | |
using namespace cv; | |
using namespace std; | |
int main( int argc, char** argv ) | |
{ | |
if( argc != 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "chapter2.h" | |
void display_image(char** argv, int task) | |
{ | |
// Load the image passed by the user | |
IplImage *pImage = cvLoadImage(argv[1]); | |
// Create a window using the HighGUI library. | |
// Give the window a title and assign a name to the window for future reference. | |
// Setting to autosize to take the size of image. If set to zero image will be scaled to fit window | |
cvNamedWindow("Original Image", CV_WINDOW_AUTOSIZE ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "chapter2.h" | |
// We create global variables of the cvCapture and the trackbar position | |
//so that it is accessible to the callback and the main function. The callback needs | |
//it to handle updating the frame position in the video capture. The main function needs | |
//it to register the callback return count and to host the actual while loop playing the video | |
CvCapture* g_pCapture = NULL; | |
int g_sliderPostion = 0; | |
void handle_trackbar_callback(int position) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "chapter2.h" | |
void display_video(char **argv) | |
{ | |
// CvCapture structure is used to store the information of the various properties of the | |
// avi and the create file capture returns a pointer of this type initialized to the beginning | |
// of the avi | |
CvCapture *pCapture = cvCreateFileCapture(argv[1]); | |
// Create a window to display the video frames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mergeArrays(int * arr, int l, int m, int r) | |
{ | |
// Compare element by element from arr[l:m] with arr[m:r] and accordingly move index within idividual arr | |
int lsize = m-l+1; // this will include the middle element | |
int rsize = r-m; | |
int L[lsize];R[rsize]; | |
for(int i=0; i < lsize; i++) | |
L[i] = arr[l+i]; | |
for(int i=0; i < rsize; i++) | |
R[i] = arr[m+j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void swap(int& a, int& b) | |
{ | |
int temp = a; | |
a = b; | |
b = temp; | |
} | |
void partition(int * arr, int left, int right) | |
{ | |
int pivotValue = arr[right]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Heapify function is used to convert a tree rooted at node root into a max heap | |
void heapify (int* arr, int root, int size) | |
{ | |
int pos = root; | |
// location of children | |
int left = 2*root + 1; | |
int right = 2*root + 2; | |
if (arr[root] < arr[left]) |
OlderNewer