Skip to content

Instantly share code, notes, and snippets.

@abhinavjain241
abhinavjain241 / serialcomm.ino
Created December 5, 2014 12:42
Serial Communication (Using Arduino)
int pin_e1 = 52;
int pin_in1_1 = 50;
int pin_in1_2 = 48;
int pin_e2 = 42;
int pin_in2_1 = 40;
int pin_in2_2 = 38;
void full_right()
{
@abhinavjain241
abhinavjain241 / CompleteEdge.cpp
Created December 11, 2014 01:28
Complete Edge Detection Module - OpenCV
//Complete Edge Detection Module - Naive Edge Detection + Prewitt + Sobel + Canny
//Also shows Gradient images in X and Y directions respectively.
#include <iostream>
#include <cmath>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#define CAM_INDEX 0
@abhinavjain241
abhinavjain241 / cv_robot.ino
Created December 12, 2014 23:18
Arduino Code for Image Processing Robot
int pin_e1 = 52;
int pin_in1_1 = 50;
int pin_in1_2 = 48;
int pin_e2 = 42;
int pin_in2_1 = 40;
int pin_in2_2 = 38;
void full_right()
{
@abhinavjain241
abhinavjain241 / classes.cpp
Created December 25, 2014 22:30
Intro to Classes - C++
#include <iostream>
using namespace std;
class Computer // Standard way of defining the class
{
public:
// This means that all of the functions below this(and any variables)
// are accessible to the rest of the program.
// NOTE: That is a colon, NOT a semicolon...
@abhinavjain241
abhinavjain241 / colour-detect-hsv.cpp
Created November 25, 2015 18:11
HSV Colour Detection
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
int main()
{
#!/bin/bash
for n in E2 A2 D3 G3 B3 E4; do play -n synth 4 pluck $n repeat 2; done
@abhinavjain241
abhinavjain241 / rgb_to_binary.cpp
Created December 2, 2014 23:15
RGB to Binary Image - OpenCV
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
//Define Threshold here
#define THRESH 127
using namespace std;
using namespace cv;
@abhinavjain241
abhinavjain241 / Binary_trackbar.cpp
Created December 3, 2014 02:52
Binary Image - Trackbar Thresholding - OpenCV
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
Mat makebinary(Mat image, int threshold)
@abhinavjain241
abhinavjain241 / histogram.cpp
Created December 3, 2014 00:18
Binary Image - Threshold Determination - Histogram Method - OpenCV
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
//Scale Down Factor
#define SCL_FACTOR 10
using namespace std;
using namespace cv;
@abhinavjain241
abhinavjain241 / MakeDirectory.sh
Created September 19, 2015 13:22
[Shell Script] Make directories in a folder for each of your file.
#!/bin/bash
# Reference: (Thanks StackOverflow) - http://stackoverflow.com/questions/2859908/iterating-over-each-line-of-ls-l-output
# Copy the script into a folder. Run it. This will make a folder for each of your file present in the directory.
# Helps me to organize my Movie collection.
ls -p | grep -v / | while read x; do if [[ $x != "MakeDirectory.sh" ]]; then mkdir "${x%.*}"; mv "$x" "${x%.*}"; fi done