Skip to content

Instantly share code, notes, and snippets.

View nevalsar's full-sized avatar
🎯
Focusing

Nevin Valsaraj nevalsar

🎯
Focusing
View GitHub Profile
@nevalsar
nevalsar / stack-and-queue-using-structure.cpp
Last active December 29, 2015 20:39
Linked list implementation of Stack and Queue.
#include <iostream>
#include <stdlib.h>
using namespace std;
struct NODE{
int val;
struct NODE *next;
};
@nevalsar
nevalsar / adaptivethresholding.cpp
Last active December 29, 2015 18:19
Adaptive thresholding for binary video from live camera feed
#include "opencv2/opencv.hpp"
#define PIX(img,i,j,k) (((uchar*)img->imageData)[i*img->widthStep+j*img->nChannels+k])
int findmedian(IplImage* img)
{
int intensities[256];
int i,j,temp=0;
for(i=0;i<256;i++)
intensities[i]=0;
@nevalsar
nevalsar / trackbar_mono.cpp
Last active December 29, 2015 18:19
Thresholding of a binary image using trackbar
#include "opencv2/opencv.hpp"
#define PIX(img,i,j,k) (((uchar*)img->imageData)[i*img->widthStep+j*img->nChannels+k])
IplImage* createbinary(IplImage *img, int thresh)
{
int i,j,ht,wd;
ht=img->height;
wd=img->width;