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 / rgb2Lab.py
Created November 3, 2014 12:26
Python Script to convert color from RGB ColorSpace to CIE Lab Color Space
import numpy as np
def func(t):
if (t > 0.008856):
return np.power(t, 1/3.0);
else:
return 7.787 * t + 16 / 116.0;
#Conversion Matrix
matrix = [[0.412453, 0.357580, 0.180423],
@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 / 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
@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 / 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
@bikz05
bikz05 / opencv-3-installation
Last active March 19, 2020 08:17
OpenCV 3 Installation
sudo apt-get update
sudo apt-get upgrade
# Added by me
sudo apt-get install freeglut3 freeglut3-dev libtbb-dev libqt4-dev
# Copied from pyimagesearch.com
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
@bikz05
bikz05 / .tmux.conf
Created August 12, 2017 20:38
tmux configuration file
# Enable mouse support
set -g mouse on
# Enable Ctrl + left/right arrow.
set-window-option -g xterm-keys on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
@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.