Skip to content

Instantly share code, notes, and snippets.

View pjspillai's full-sized avatar

Pree pjspillai

  • San Francisco Bay Area
View GitHub Profile
@pjspillai
pjspillai / pthread_udp_video.txt
Last active February 5, 2016 03:11
Mutex Locks for UDP and OpenCV Img Refresh
#include <pthread.h>
using namespace cv;
using namespace std;
//GLOBALS
VideoCapture vcap;
Mat frame;
@pjspillai
pjspillai / install_graphics.sh
Created September 7, 2012 00:01
Qt and OpenGL Istallations
echo "QuarkSpark/Sept'12"
echo "################################"
echo "Installing Qt"
apt-get install libqt4-dev
apt-get install libqt4-core
apt-get install libqt4-gui
apt-get install libqt4-xml
apt-get install libqt4-opengl
echo "done with Qt Installation!! :)"
echo "---------------------------------"
@pjspillai
pjspillai / install_main.sh
Created September 6, 2012 23:57
First installations on ubuntu.....
echo "QuarkSpark/Sept'12"
echo "########################"
echo "Installing OpenSSH..."
apt-get install openssh-server
echo "----------------------------"
echo "Installing Emacs, Gfortran, Git, Screen...."
apt-get install emacs
apt-get install gfortran
apt-get install git
apt-get install screen
@pjspillai
pjspillai / update_all.sh
Created September 6, 2012 23:53
ubuntu updates
echo "QuarkSpark/Sept'12"
echo "#####################################"
echo "Initializing Updates...."
echo "#####################################"
echo "Auto-removing unnecessary stuff"
apt-get autoremove
apt-get clean all
apt-get autoclean
echo "#####################################"
echo "Updating process initialized"
@pjspillai
pjspillai / gist:3404507
Created August 20, 2012 14:04
iplimage, cvmat, mat conversions
// Convert IplImage* to Mat
IplImage * image = cvLoadImage("test.jpg");
Mat matImg(image);
// Convert Mat to IplImage*
//Convert to IplImage or CvMat, no data copying
IplImage ipl_img = img;
CvMat cvmat = img;
IplImage* img_new = &ipl_img
@pjspillai
pjspillai / gist:3404343
Created August 20, 2012 14:00
kmeans opencv
Mat src = imread("road-1_4.jpg", 1);
Mat samples(src.rows * src.cols, 3, CV_32F);
for( int y = 0; y < src.rows; y++ )
for( int x = 0; x < src.cols; x++ )
for( int z = 0; z < 3; z++)
samples.at<float>(y + x*src.rows, z) = src.at<Vec3b>(y,x)[z];
int clusterCount = 4;
Mat labels;
/*
* File Operation.cpp
* Pree, 20th October 2009
* Contains definitions of class methods for Operation.
*/
#include "Operation.h"
#include <iostream>
@pjspillai
pjspillai / main.cpp
Created April 29, 2012 23:33
circuit optimization
/*
* File main.cpp
* Pree, 20th October 2009
* Contains the main function, as well as some functions that help with user
* interaction.
*/
#include "Bdd_node.h"
#include "Operation.h"
#include "Bdd_tables.h"
/*
* File Bdd_tables.cpp
*
* Contains the implementation of the class methods of Bdd_tables, defined
* in Bdd_tables.h
*/
#include "Bdd_tables.h"
#include <iostream>
#ifndef BDD_TABLES_H
#define BDD_TABLES_H
/*
* File Bdd_tables.h
*
* Defines the class Bdd_tables, along with a structs computed_table_key
* and unique_table_key
*/