This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <gst/gst.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
// udpsrc port=8554 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, width=(int)720, height=(int)480, encoding-name=(string)H264, payload=(int)96" ! | |
// rtpjitterbuffer name=rtpjitbuff ! rtph264depay ! | |
// tee name=t t. ! avdec_h264 ! appsink name=sink sync=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rish.crearo.imagestablization.camera; | |
import android.content.Context; | |
import android.opengl.GLES20; | |
import android.util.Log; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.HashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rish.crearo.imagestabv2; | |
/** | |
* Original author unknown. | |
* | |
* Modified by rish on 10/7/17. | |
* [email protected] | |
*/ | |
import android.content.Context; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** A fragment shader to convert NV12 to RGB. | |
* Input textures Y - is a block of size w*h. | |
* texture UV is of size w*h/2. | |
* Remember, both U and V are individually of size w/2*h/2, but they are interleaved. | |
* The layout looks like this : | |
* ---------- | |
* | | | |
* | Y | size = w*h | |
* | | | |
* |________| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** A fragment shader to convert YUV420P to RGB. | |
* Input textures Y - is a block of size w*h. | |
* texture U is of size w/2*h/2. | |
* texture V is of size w/2*h/2. | |
* In this case, the layout looks like the following : | |
* __________ | |
* | | | |
* | Y | size = w*h | |
* | | | |
* |________| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tonbo.streamer.network; | |
import android.content.Context; | |
import android.content.IntentFilter; | |
import android.net.NetworkInfo; | |
import android.net.wifi.ScanResult; | |
import android.net.wifi.WifiConfiguration; | |
import android.net.wifi.WifiInfo; | |
import android.net.wifi.WifiManager; | |
import android.support.annotation.CheckResult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A small script to play videos of the same dimensions side by side. | |
I needed this while showing two videos side by side; one stabilized and one not stabilized during my | |
works on video stabilization. | |
''' | |
import cv2, sys | |
import numpy as np | |
if len(sys.argv) < 3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rish.imagestab.utils; | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.HashMap; | |
/** | |
* Created by rish on 14/6/17. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Performs software stabilization using optical flow + linear smoothing. | |
Vision algos used : | |
- KLT for flow tracking | |
- Harris corner detection to detect points to be tracked in each frame | |
This is the Python translation I wrote of the original .cpp code written by nghiaho.com/?p=2093 | |
''' | |
import cv2 | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
from imutils.object_detection import non_max_suppression | |
from imutils import paths | |
import argparse | |
import imutils | |
""" | |
The parameters passed to the hog detector need to be played around | |
with to get optimum speed vs accuracy. This will always be a tradeoff. |