Skip to content

Instantly share code, notes, and snippets.

View atraining's full-sized avatar
🚀

Christopher Helm atraining

🚀
View GitHub Profile
@goldhand
goldhand / task_update_json.html
Created July 19, 2013 05:43
Updates any Task model without reloading using ajax
#views.py
class TaskUpdateView(generic.UpdateView):
model = Task
form_class = TaskForm
@json_view
def dispatch(self, *args, **kwargs):
return super(TaskUpdateView, self).dispatch(*args, **kwargs)
@Munawwar
Munawwar / segmentation1.py
Created August 29, 2016 13:56
Background Removal with OpenCV - Attempt 1 (http://codepasta.com/site/vision/segmentation/)
import numpy as np
import cv2
def getSobel (channel):
sobelx = cv2.Sobel(channel, cv2.CV_16S, 1, 0, borderType=cv2.BORDER_REPLICATE)
sobely = cv2.Sobel(channel, cv2.CV_16S, 0, 1, borderType=cv2.BORDER_REPLICATE)
sobel = np.hypot(sobelx, sobely)
return sobel;