Skip to content

Instantly share code, notes, and snippets.

View AhmedSamara's full-sized avatar

Ahmed Samara AhmedSamara

View GitHub Profile
asamara@ahmedsamara:build$ make VERBOSE=1
/usr/bin/cmake -H/home/asamara/opencv -B/home/asamara/opencv/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/asamara/opencv/build/CMakeFiles /home/asamara/opencv/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/asamara/opencv/build'
make -f modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/build.make modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/depend
make[2]: Entering directory '/home/asamara/opencv/build'
cd /home/asamara/opencv/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/asamara/opencv /home/asamara/opencv/modules/hal /home/asamara/opencv/build /home/asamara/opencv/build/modules/hal /home/asamara/opencv/build/modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/asamara/opencv/build'
make -f modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/build.make modules/hal/CMakeFiles/opencv_ha
asamara@ahmedsamara:build$ make
Scanning dependencies of target QRCodeStateEstimation
[ 16%] Building CXX object src/library/CMakeFiles/QRCodeStateEstimation.dir/SOMException.cpp.o
[ 33%] Building CXX object src/library/CMakeFiles/QRCodeStateEstimation.dir/QRCodeStateEstimator.cpp.o
[ 50%] Building CXX object src/library/CMakeFiles/QRCodeStateEstimation.dir/SOMScopeGuard.cpp.o
[ 66%] Linking CXX shared library ../../lib/libQRCodeStateEstimation.so
[ 66%] Built target QRCodeStateEstimation
Scanning dependencies of target estimateLocationFromQRCode
[ 83%] Building CXX object src/example/CMakeFiles/estimateLocationFromQRCode.dir/main.cpp.o
[100%] Linking CXX executable ../../bin/estimateLocationFromQRCode
import numpy as np
import cv2
import imutils
cap = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = cap.read()
import numpy as np
import cv2
import imutils
cap = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = cap.read()
import numpy as np
import cv2
from matplotlib import pyplot as plt
#http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html
def drawMatches(img1, kp1, img2, kp2, matches):
"""
source:
http://stackoverflow.com/questions/20259025/module-object-has-no-attribute-drawmatches-opencv-python
Bus 001 Device 004: ID 04f2:a149 Chicony Electronics Co., Ltd
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
@AhmedSamara
AhmedSamara / C270.sh
Last active March 29, 2016 16:44
UDEV-cameras
[root@localhost ~]# udevadm info -a /dev/video1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/video4linux/video1':
KERNEL=="video1"
@AhmedSamara
AhmedSamara / delete_git_submodule.md
Last active May 11, 2018 22:53 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>"
  • Delete the now untracked submodule files rm -rf path_to_submodule
import PyPDF2
import subprocess
pdfIn = open('presentations.pdf', 'rb')
reader = PyPDF2.PdfFileReader(pdfIn)
writer = PyPDF2.PdfFileWriter()
for i in range(reader.numPages):