Skip to content

Instantly share code, notes, and snippets.

Roy Shilkrot royshil

Block or report user

Report or block royshil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@royshil
royshil / opencv_capture_v4l2.py
Created Mar 4, 2016
A way to set V4L2 camera params for OpenCV, when cv2.VideoCapture doesn't work. This requires the python-v42lcapture module (https://github.com/gebart/python-v4l2capture)
View opencv_capture_v4l2.py
#!/usr/bin/env python
import numpy as np
import cv2
import os
import v4l2capture
import select
if __name__ == '__main__':
#cap = cv2.VideoCapture(0)
@royshil
royshil / LoadingSpinner.java
Last active Feb 20, 2016
A Tapestry 5 Mixin for a loading spinner with spin.js
View LoadingSpinner.java
package com.yourapp.mixins;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
@royshil
royshil / custom-width-sidebar.html
Created Jan 27, 2016
Custom width sidebar with Bootstrap3 container-fluid main
View custom-width-sidebar.html
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
@royshil
royshil / CompressYUYV2JPEG.cpp
Created Jan 14, 2016
Example of converting a YUYV buffer to JPEG using libJPEG
View CompressYUYV2JPEG.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <cstdint>
#include <memory>
#include <jpeglib.h>
using namespace std;
@royshil
royshil / SimpleAdHocTracker.cpp
Created Mar 15, 2015
Ad-Hoc AR tracker from a planar scene without need for markers
View SimpleAdHocTracker.cpp
/*
* SimpleAdHocTracker.cpp
*
* Created on: Mar 15, 2015
* Author: roy_shilkrot
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Roy Shilkrot
*
View ProgressBar.java
/*
This is the Tapestry component to communicate with the javascript
*/
package com.yourpackage.components;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.MarkupWriter;
@royshil
royshil / SimpleARQGLViewer.cpp
Created Feb 16, 2015
Augmented Reality application with QGLViewer
View SimpleARQGLViewer.cpp
/*
* SimpleARQGLViewer.cpp
* Creating an AR application with QGLViewer
*
* Created by Roy Shilkrot on 2/16/2015
* Copyright 2015 Roy Shilkrot. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@royshil
royshil / OGL_OCV_common.cpp
Created Feb 16, 2015
OpenCV OpenGL common interop: OpenCV Mat to OpenGL texture, 2D drawing of textures
View OGL_OCV_common.cpp
/*
* OGL_OCV_common.cpp
* Common interop between OpenCV and OpenGL
*
* Created by Roy Shilkrot on 2/16/2015
* Copyright 2015 Roy Shilkrot. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@royshil
royshil / SimpleVideoStabilizer.cpp
Last active Sep 16, 2019
A simple video stabilizer in OpenCV, based on goodFeaturesToTrack, calcOpticalFlowPyrLK and estimateRigidTransform.
View SimpleVideoStabilizer.cpp
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/video/video.hpp>
#include <iostream>
using namespace cv;
using namespace std;
@royshil
royshil / OpenCV_Vertical_RLE.cpp
Created Jan 21, 2015
Run Length Encoding (vertical) on an OpenCV uchar Mat
View OpenCV_Vertical_RLE.cpp
#include <opencv2/opencv.hpp>
using namespace cv;
/**
* Compute RLE.
* RLE is encoded in a vector of vectors of (run length, value).
*
* @param patch_ the 8UC1 image to work on
* @param whichWay by which dimension? rows = 0, columns != 0
*/
You can’t perform that action at this time.