Skip to content

Instantly share code, notes, and snippets.

[h264 @ 0x4731c00] non-existing PPS referenced
[h264 @ 0x4731c00] non-existing PPS 0 referenced
[h264 @ 0x4731c00] decode_slice_header error
[h264 @ 0x4731c00] no frame!
[h264 @ 0x4731c00] non-existing PPS referenced
[h264 @ 0x4731c00] non-existing PPS 0 referenced
[h264 @ 0x4731c00] decode_slice_header error
[h264 @ 0x4731c00] no frame!
[h264 @ 0x4731c00] non-existing PPS referenced
[h264 @ 0x4731c00] non-existing PPS 0 referenced
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <opencv2/core/core.hpp>
from PIL import Image as pil
import urllib2
import numpy as np
source = "http://something"
req = urllib2.Request(source, headers={'User-Agent' : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5"})
img_file = urllib2.urlopen(req)
im = StringIO(img_file.read()) # You can skip this and directly convert to numpy arrays
source = pil.open(im).convert("RGB")
_pilImage = source
@jayrambhia
jayrambhia / SLICcv.py
Last active December 21, 2015 11:18
superpixels using SLIC
import cv2
import sys
import numpy as np
import time
class SLIC:
def __init__(self, img, step, nc):
self.img = img
self.height, self.width = img.shape[:2]
self.labimg = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include <Path of OpenCV.mk> # OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := <module name>
LOCAL_SRC_FILES := <list of .c and .cpp files>
LOCAL_LDLIBS += -llog -ldl
@jayrambhia
jayrambhia / jni_part.cpp
Last active January 4, 2016 08:09
JNI Example
#include <jni.h>
#include "opencv2/core/core.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
using namespace std;
using namespace cv;
int toGray(Mat img, Mat& gray);
@jayrambhia
jayrambhia / barChart.js
Last active August 29, 2015 13:59
Multibar transition using d3
axis = function(){
var ldomain = 0, rdomain = 0, lrange = 0, rrange = 0;
var orientation = "left", ticks = 0;
var xpadding = 10, ypadding = 10;
var plotted = false;
var scale, Axis, AxisGroup;
function chart(selection){}
@jayrambhia
jayrambhia / Android.mk
Created May 1, 2014 10:44
FFmpeg with OpenCV on Android
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on
include /home/jay/Android_OpenCV/OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := tutorial02
#include <stdio.h>
#include <jni.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <android/log.h>
#define APPNAME "Exposure jni"
Name Stmts Miss Cover Missing
--------------------------------------------------------------------------
simplecv 7 3 57% 23-25
simplecv.base 172 98 43% 12-13, 27-32, 83, 88-89, 96-97, 125, 133, 141-162, 184-185, 191, 203, 208, 212-227, 234-242, 262-285, 312-349, 360
simplecv.color 113 1 99% 364
simplecv.color_model 60 11 82% 34-37, 56-60, 170, 224, 240
simplecv.core 0 0 100%
simplecv.core.camera 0 0 100%
simplecv.core.camera.camera 151 78 48% 35, 117-121, 141-143, 150, 154-182, 187, 190, 194-195, 207, 235-245, 258-264, 289, 292, 298-299, 322-356
simplecv.core.camera.frame_source 133 40 70% 31, 37, 84, 134, 199-201, 208-214, 237, 262, 270, 309, 328-363, 366, 369