Skip to content

Instantly share code, notes, and snippets.

compiling opencv_webcam.cpp
opencv_webcam.cpp: In function ‘int main()’:
opencv_webcam.cpp:8:9: error: ‘cap’ was not declared in this scope
opencv_webcam.cpp:11:9: error: ‘k’ was not declared in this scope
opencv_webcam.cpp:11:23: error: ‘waitkey’ was not declared in this scope
opencv_webcam.cpp:12:9: error: expected ‘;’ before ‘if’
Output file => opencv_webcam
@jayrambhia
jayrambhia / gist:4559834
Last active December 11, 2015 06:29
SIFT match keypoints and draw.
def matchSIFTKeyPoints(self, template, quality=200):
try:
import cv2
except ImportError:
logger.warning("OpenCV >= 2.3.0 required")
if template == None:
return None
detector = cv2.FeatureDetector_create("SIFT")
descriptor = cv2.DescriptorExtractor_create("SIFT")
img = self.getNumpyCv2()
@jayrambhia
jayrambhia / getKunisPics.py
Created February 8, 2013 23:32
Fetches Mila Kunis pics from http://reddit.com/r/milakunis | Doesn't use Reddit API. I'll work on that later. Wanted to download few pics fast. Made it up . Downloaded 28 pics and got restricted by reddit. I'll also add header later.
from BeautifulSoup import BeautifulSoup
import urllib2
import os
import re
def getLinks(URL, pics=[]):
print len(pics), "pics yet."
print "fetching", URL
try:
page = urllib2.urlopen(URL)
@jayrambhia
jayrambhia / pyDict.py
Created February 16, 2013 09:01
Python based dictionary. Fetched data from meriem-webster dictionary website,
from BeautifulSoup import BeautifulSoup
import urllib2
import sys
proxy = urllib2.ProxyHandler() # Your proxy here.
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
def getPrintUnicode(soup):
body=''
@jayrambhia
jayrambhia / AndroidMainfest.xml
Created March 28, 2013 19:00
First Android OpenCV Application.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.imgloader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
class foo:
def __init__(self):
self.a = "abc"
def defB(self):
self.b = "B"
def printB(self):
print self.b
libv4l2: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT
*** glibc detected *** /usr/bin/python: double free or corruption (fasttop): 0x0000000003724b80 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f0ecac5eb96]
/usr/local/lib/libopencv_highgui.so.2.4(_ZN20CvCaptureCAM_V4L_CPP4openEi+0x6b5)[0x7f0eb4b1e4c5]
<marandi> hi guys , im from Iran , can i participate in gsoc ?
* Czarconius ([email protected]) has joined #gsoc
* SeySayux has quit (Ping timeout: 264 seconds)
* Aceeeed ([email protected]) has joined #gsoc
<nurupo> marandi: seems like you are not allowed to http://www.google-melange.com/gsoc/document/show/gsoc_program/google/gsoc2013/help_page#4._Who_is_not_eligible_to_participate_as
* warunsl ([email protected]) has joined #gsoc
<nurupo> or, better say, you are ineligible
* haseeb (~haseeb@unaffiliated/haseeb) has joined #gsoc
* dhruvasagar ([email protected]) has joined #gsoc
<marandi> nurupo: its so unfair :( !
@jayrambhia
jayrambhia / FaceRecognize_update,py
Created April 16, 2013 22:52
Update utility for FaceRecognize Moudle in SimpleCV.
def update(self, images=None, labels=None, csvfile=None, delimiter=";"):
"""
**SUMMARY**
Update the training set of the face recognizer.
**PARAMETERS**
* *images* - A list of Images or ImageSet. All the images must be of
same size.
@jayrambhia
jayrambhia / gist:5423271
Created April 19, 2013 21:11
copying is breaking tests..
└─[$] <git:(Main/referncing_issues*)> nosetests tests.py
.........FF............OpenCV Error: Assertion failed (A.size == arrays[i0]->size) in init, file /home/jay/Downloads/OpenCV-2.4.4/modules/core/src/matrix.cpp, line 3180
E.....................................OpenCV Error: Assertion failed (src.depth() == dst.depth() && src.size == dst.size) in cvCopy, file /home/jay/Downloads/OpenCV-2.4.4/modules/core/src/copy.cpp, line 557
E..........OpenCV Error: Assertion failed (src.depth() == dst.depth() && src.size == dst.size) in cvCopy, file /home/jay/Downloads/OpenCV-2.4.4/modules/core/src/copy.cpp, line 557
E..................OpenCV Error: Assertion failed (src.depth() == dst.depth() && src.size == dst.size) in cvCopy, file /home/jay/Downloads/OpenCV-2.4.4/modules/core/src/copy.cpp, line 557
E.OpenCV Error: Assertion failed (src.depth() == dst.depth() && src.size == dst.size) in cvCopy, file /home/jay/Downloads/OpenCV-2.4.4/modules/core/src/copy.cpp, line 557
E.........OpenCV Error: Assertio