Skip to content

Instantly share code, notes, and snippets.

View aravindc26's full-sized avatar

Aravind Chintalapalli aravindc26

View GitHub Profile
from cv import * #bad practice, its just that am bit lazy
def GetThresholdedImage(img):
#returns thresholded image of the blue bottle
imgHSV = CreateImage(GetSize(img), 8, 3)
#converts a BGR image to HSV
CvtColor(img, imgHSV, CV_BGR2HSV)
imgThreshed = CreateImage(GetSize(img), 8, 1)
#InRangeS takes source, lowerbound color, upperbound color and destination
#It converts the pixel values lying within the range to 255 and stores it in
@aravindc26
aravindc26 / AreaUnderCurve.java
Created September 1, 2012 00:30
integeration
package test.areaundercurve;
public class AreaUnderCurve {
public double getAreaUnderCurve(Term[] equation, int limit1, int limit2){
double ret =0.0;
if(limit1 == limit2) return ret; //when limits are equal the area under the curve is equal
//Write your code here
int i;
@aravindc26
aravindc26 / DecodeTheCode.java
Created August 31, 2012 10:13
mobile keypad
package test.decodethecode;
import java.util.HashMap;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class DecodeTheCode {
HashMap<String, String> encodings = new HashMap<String, String>();
public void hashInit() {
import java.util.*;
class Pair {
private final int left;
private final int right;
public Pair(int left, int right) {
this.left = left;
this.right = right;
}
@aravindc26
aravindc26 / inverbit.java
Created August 18, 2012 15:01
invertbit
package com.adp.invertbit;
public class InvertBit {
public char invertBit(char inputChar, int position, int noOfPositions) {
//Write your code here
int rem = (char)inputChar; //the reminder in each stage of division
byte[] charArr = new byte[8]; //storing the bit representation
int i = 7;
@aravindc26
aravindc26 / helloworld.java
Created May 6, 2012 02:55
Yet Another Hello World
public class main {
public static void main(String args[]) {
System.out.print("hello bloody world");
}
}