Skip to content

Instantly share code, notes, and snippets.

View bikz05's full-sized avatar

bikram bikz05

  • Amazon
  • Sunnyvale, United States
View GitHub Profile
@bikz05
bikz05 / Adaptive Thresholding.ipynb
Last active June 20, 2017 23:58
Adaptive Thresholding
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bikz05
bikz05 / Connected Components using RGB values.ipynb
Created January 19, 2015 08:15
Connected Components using RGB values
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bikz05
bikz05 / facedetection.ipynb
Last active June 11, 2016 09:50
Face Detection using OpenCV
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bikz05
bikz05 / gist:27c50374616678ba17df
Created December 20, 2014 11:24
Image Gradients
Dervative is rate of change.
`Hello`
@bikz05
bikz05 / remove_txt
Created December 6, 2014 00:13
Shell script to remove text from PDF using pdftk
echo $"Script Written by $(tput setaf 5)Bikram Hanzra$(tput sgr 0) (bikz.05@gmail.com)"$
if [ "$#" == 0 ] ; then
echo "$(tput setaf 1)We need at least 2 arguments"
echo "SYNTAX ./remove <file-name> <text-to-be-removed>"
echo "<text-to-be-removed> by default = www.it-ebooks.info$(tput sgr 0)"
exit
fi
if [ "$#" == 1 ] ; then
# Question 1
# http://progexercise.dev.indeed.net/progcontest/problems/1
input = "RUNNINGWITHSCISSORS"
list = list(input)
dic = {}
count = len(list);
@bikz05
bikz05 / pythonTutorials.py
Created December 4, 2014 19:01
Python Idioms
# zip([iterable, ...])
# This function returns a list of tuples,
# where the i-th tuple contains the i-th
# element from each of the argument sequ-
# ences or iterables.
a = [1, 2, 3, 4, 5, 6];
b = [6, 5, 4, 3, 2, 1];
c = [cA*cB for cA, cB in zip(a, b)]; # c = [6, 10, 12, 12, 10, 6]
# Sorting using keys
@bikz05
bikz05 / opencv_basic.py
Last active October 22, 2022 10:16
Basic Image Processing operations using OpenCV and Python
import cv2
import argparse
# Download the image used for this tutorial from here.
# http://goo.gl/jsYXl8
# Read the image
ap = argparse.ArgumentParser();
ap.add_argument("-i", "--image", required = True, help = "path to the image file");
args = vars(ap.parse_args());
@bikz05
bikz05 / histogram3D.py
Last active August 20, 2023 14:51
This python script demonstrates how we can use a 3D histogram in OpenCV to sort the colors and find the max color in a image.
# This python script demonstrates how we can use a 3D
# histogram in OpenCV to sort the colors and find the
# max color in a image
import cv2
import numpy as np
# Read the image
image = cv2.imread("/home/bikz05/Desktop/dataset/0.png");
@bikz05
bikz05 / cie2000.py
Last active April 22, 2020 11:37
Color Difference using CIE DE2000
### colormath is needed to run the script
### Ubuntu users can get it by typing the 2 command below -
### `sudo apt-get install python-pip`
### `sudo pip install colormath`
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
from colormath.color_diff import delta_e_cie2000
# Red Color