Skip to content

Instantly share code, notes, and snippets.

View diegoaguilar's full-sized avatar

Diego Aguilar diegoaguilar

View GitHub Profile
@diegoaguilar
diegoaguilar / gist:a12eb4df24a581a9bd37
Created March 15, 2015 01:55
taiga-docker output for setup.sh
Unable to find image 'postgres' locally
Pulling repository postgres
0e9ef8dc211f: Pulling image (latest) from postgres, endpoint: https://registry-1.docker.io0e9ef8dc211f: Download complete
511136ea3c5a: Download complete
36669626e49c: Download complete
d5570ef1464a: Download complete
66813de2b8c6: Download complete
0edb988bab32: Download complete
f4c77afee761: Download complete
4795a24c1739: Download complete
@diegoaguilar
diegoaguilar / opencv.sh
Created March 15, 2015 02:54
OpenCV Linux install
echo "Installing dependencies:\nbuild-essential\ncmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev\npython-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev"
sudo apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
git clone https://github.com/Itseez/opencv.git
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j7
sudo make install
@diegoaguilar
diegoaguilar / gist:725b50064e97e317f973
Created April 2, 2015 21:31
OpenCV detection alternatives
diegoaguilar: a unique background color will make things easier. since you want to recognize can vs bottle rather than pepsi vs coke, shape matching is probably the way to go. Use the unique background color to create a mask of bg and not bg. Then either 1) compare the mask to a list of template images with matchTemplate, 2) use the outermost contour for matchShapes, or 3) or use linemod which is difficult to work with but rocks
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
-- Detected version of GNU GCC: 46 (406)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
Could not find module FindQt5Core.cmake or a configuration file for package
Qt5Core.
Adjust CMAKE_MODULE_PATH to find FindQt5Core.cmake or set Qt5Core_DIR to
the directory containing a CMake configuration file for Qt5Core. The file
will have one of the following names:
public interface MyListener{
public void heard(String response);
}
public void launchTask()
{
new MyTask(listener).execute();
}
MyListener listener = new MyListener(){
@diegoaguilar
diegoaguilar / pendientes.md
Last active August 29, 2015 14:18
Pendientes
Verificar que para todos los usuarios es posible:
  • Recuperar contraseña
  • Imprimir órdenes así como sus revisiones.
  • Recibir mensajes y notificaciones en el sistema sobre el éxito o error de las distintas operaciones que realiza. *
Crear una orden como capturista y evaluar el funcionamiento correcto del sistema para:
  • Posibilidad de modificación de la orden por parte del capturista en caso de un rechazo.
  • Los usuarios reciben correos elecronicos con notificaciones con los avances de la requisición de orden.
function lookForNearPlaces (collection, longitude, latitude, maxDistance, minDistance, query) {
var maxDistance = maxDistance ? maxDistance : 50;
var minDistance = minDistance ? minDistance : 0;
var nearQueryDocument = {
near: { type: "Point", coordinates: [ longitude , latitude ] },
distanceField: "dist.calculated",
maxDistance: maxDistance,
minDistance: minDistance,
from cv2 import *
bottle_image_name = 'bottle.jpg'
bottle_image = imread(bottle_image_name,CV_LOAD_IMAGE_GRAYSCALE)
contours, hierarchy = findContours(bottle_image, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE)
print contours
for contour in contours:
@diegoaguilar
diegoaguilar / laravel_ready.sh
Last active August 29, 2015 14:19
Laravel ready machine provision
#!/usr/bin/env bash
# Update Package List
sudo apt-get update
sudo apt-get upgrade -y
# Install Some PPAs
from cv2 import *
import sys
bottle_image_name = sys.argv[1]
bottle_image_gray = imread(bottle_image_name,CV_LOAD_IMAGE_GRAYSCALE)
(tresh, im_bw) = threshold(bottle_image_gray, 127, 255, THRESH_BINARY)
imwrite('bw.png',im_bw)
bottle_image_bw = imread('bw.png',CV_LOAD_IMAGE_UNCHANGED)
contours, hierarchy = findContours(bottle_image_bw, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE)