Skip to content

Instantly share code, notes, and snippets.

View TheSalarKhan's full-sized avatar
💭
I may be slow to respond.

Muhammad Salar Khan TheSalarKhan

💭
I may be slow to respond.
View GitHub Profile
@TheSalarKhan
TheSalarKhan / datatablesHighlight.html
Created June 15, 2016 11:15
HIGHLIGHT SEARCH TEXT IN DATA-TABLES: I wanted to highlight the search text, after hours of googling this worked for me.
<!DOCTYPE html>
<html>
<head>
<!-- Include jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<!-- Include jquery mark ( for highlighting text )-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/6.1.0/jquery.mark.min.js"></script>
@TheSalarKhan
TheSalarKhan / transform.py
Created March 23, 2016 22:19
Perspective transformation using Open CV and Python
# This script does a perspective transformation with an A4 paper
# Get an A4 sheet, put it on a table in front of your webcam
# just close enough so that all its corners are visible.
# Run this script, you will be given a frame from the webcam.
# Pick the corners of the A4 sheet for the software, by double clicking on its corners
# one by one in the following order: top left, top right, bottom left, bottom right.
# Just as you select the last corner, a live feed without the perspective distortion
# shows up and now you can write something on it, and have a view of it as if
# the camera was right on top of it. Cheers!
# visit:
import numpy as np
import cv2
from collections import deque
from operator import itemgetter
class BackGroundSubtractor:
# When constructing background subtractor, we
# take in two arguments:
# 1) alpha: The background learning factor, its value should
@TheSalarKhan
TheSalarKhan / backgroundAveraging.py
Last active February 12, 2023 03:47
Background Averaging (Background Subtraction) in Python+OpenCV
import numpy as np
import cv2
class BackGroundSubtractor:
# When constructing background subtractor, we
# take in two arguments:
# 1) alpha: The background learning factor, its value should
# be between 0 and 1. The higher the value, the more quickly
# your program learns the changes in the background. Therefore,