Skip to content

Instantly share code, notes, and snippets.

View median.jl
function median_filter{T, N}(img::AbstractArray{T, N}, window::NTuple{N, Int})
all(isodd(w) for w in window) || error("entries in window must be odd, got $window")
R = CartesianRange(size(img))
half_window = map(w->w>>1, window)
Rinner = CartesianRange(first(R)+CartesianIndex(half_window), last(R)-CartesianIndex(half_window))
for i in Rinner
if i[1] = first(Rinner)[1]
tejus-gupta /
Created Aug 26, 2017
Object Detection Tutorial

In this tutorial, we will use Histogram of Oriented Gradient (HOG) feature descriptor based linear SVM to create a person detector. We will first create a person classifier and then use this classifier with a sliding window to identify and localize people in an image.

The key challenge in creating a classifier is that it needs to work with variations in illumination, pose and oclussions in the image. To achieve this, we will train the classifier on an intermediate representation of the image instead of the pixel-based representation. Our ideal representation (commonly called feature vector) captures information which is useful for classification but is invariant to to small changes in illumination and oclussions. HOG descriptor is a gradient-based representation which is invariant to local geometric and photometric changes (i.e. shape and illumination changes) and so is a good choice for our problem. Infact HOG descriptor are widely used for object detection.

We will use [this data](//Add link) for training

tejus-gupta /
Last active Dec 12, 2019
Google Summer of Code - 2017

Project Abstract

I proposed to

  1. Add a package for image segmentation as part of JuliaImages with several algorithms -
  • Thresholding - Otsu’s method and Adaptive thresholding
  • K-means clustering
  • Mean shift segmentation
  • Watershed segmentation
  • Felzenszwalb's efficient region merging algorithm
  • Shi and Malik’s normalized graph-cut based segmentation
tejus-gupta /
Last active Sep 21, 2017
ImageSegmentation Blog


Over the last three months, we've been working on ImageSegmentation.jl - a collection of image segmentation algorithms written in Julia. Under the mentorship of Tim Holy, we have implemented several popular image segmentation algorithms and designed a consistent interface for using these algorithms. This blog post describes image segmentation, why it's useful and how to use the tools in this package.

Image Segmentation is the process of partitioning the image into regions that have similar attributes. Image segmentation has various applications e.g, medical image segmentation, image compression and is used as a preprocessing step in higher level vision tasks like object detection and optical flow.

Image segmentation is not a mathematically well-defined problem: for example, the only lossless representation of the input image would be to say that each pixel is its own segment. Yet this does not correspond to our own intuitive notion that

View vis_example.cpp
#include <pcl/visualization/cloud_viewer.h>
boost::shared_ptr<pcl::visualization::PCLVisualizer> cloudVis (pcl::PointCloud<pcl::PointXYZ>::ConstPtr cloud)
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
viewer->setBackgroundColor (0, 0, 0);
viewer->addPointCloud<pcl::PointXYZ> (cloud, "sample cloud");
viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud");
viewer->addCoordinateSystem (1.0);
viewer->initCameraParameters ();

📋 Project overview: Parallelizing Apollo

Status Just starting 🌱 / In progress 🔨 / Ready to go 🚀
Team Start with you and add others with @mentions
Description What do you have in mind?
Deadline When do you want to finish?


  • What are the key dates?
tejus-gupta / median_filter.jl
Last active Oct 4, 2018
Code for median filter based on 'A Fast Two-Dimensional Median Filtering Algorithm' by Huang, Yang and Tang.
View median_filter.jl
using Images, TestImages, Statistics, BenchmarkTools, Test
img = testimage("lena_gray")
high_resolution_img = convert(Array{Gray{Normed{UInt16,16}}, 2}, img)
function median_filter(img::Array{Gray{Normed{T,f}}, 2}, window_size::Tuple{Int64,Int64}) where {T,f}
function update_median(median_val, n_pixels_below_median, hist, half_pixels)
if n_pixels_below_median <= half_pixels
for val in median_val:2^f
import requests
def download_file_from_google_drive(id, destination):
def get_confirm_token(response):
for key, value in response.cookies.items():
if key.startswith('download_warning'):
return value
return None