This file contains 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 React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { Camera, Permissions, FaceDetector, DangerZone } from 'expo'; | |
export default class CameraExample extends React.Component { | |
static defaultProps = { | |
countDownSeconds: 5, | |
motionInterval: 500, //ms between each device motion reading | |
motionTolerance: 1, //allowed variance in acceleration | |
cameraType: Camera.Constants.Type.front, //front vs rear facing camera |
This file contains 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
// Copyright (c) 2018 ml5 | |
// | |
// This software is released under the MIT License. | |
// https://opensource.org/licenses/MIT | |
/* === | |
ml5 Example | |
Creating a regression extracting features of MobileNet. Build with p5js. | |
=== */ |
This file contains 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
const $arrivals = $('.arrivals'); | |
let arrivalInterval; | |
window.onload = function(){ | |
getArrivals(); | |
pollForArrivals(); | |
} | |
pollForArrivals = function(){ | |
arrivalInterval = setInterval(getArrivals,60000); |
This file contains 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 <ESP8266WiFi.h> | |
#include <WiFiClientSecure.h> | |
#include <TimeLib.h> | |
#include <NTPClient.h> | |
#include <WiFiUdp.h> | |
#include <Adafruit_NeoPixel.h> | |
//WIFI | |
const char* ssid = "[MY_SSID]"; |
This file contains 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 <React/RCTViewManager.h> | |
#import <UIKit/UIKit.h> | |
#import <AVFoundation/AVFoundation.h> | |
#import <opencv2/videoio/cap_ios.h> | |
#import "ChordCodeLocator.hpp" | |
#import "RNTUIImageView.h" | |
using namespace cv; | |
@interface OpenCvCameraManager : RCTViewManager<CvVideoCameraDelegate> |
This file contains 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 "OpenCvCameraManager.h" | |
#import <React/RCTBridge.h> | |
#import <opencv2/videoio/cap_ios.h> | |
using namespace cv; | |
@implementation OpenCvCameraManager | |
@synthesize camera, img, cameraId; |
This file contains 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
let data = {}; // Global object to hold results from the loadJSON call | |
let shapes = []; // Global array to hold all shape arrays of coords | |
let mousePressedCoords = []; | |
let mouseReleasedCoords = []; | |
let isMousePressed = false; | |
let marqueeIsActive = false; //true when shift key selected | |
let closestShapeIndex; | |
let closestCoordIndex; | |
let mouseMovedX, mouseMovedY, mouseStartX, mouseStartY; | |
let selectedPoints = []; |
This file contains 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
private final Matrix mMatrix = new Matrix(); | |
private void updateMatrix() { | |
float mw = this.getWidth(); | |
float mh = this.getHeight(); | |
float hw = this.getWidth() / 2.0f; | |
float hh = this.getHeight() / 2.0f; | |
float cw = (float)Resources.getSystem().getDisplayMetrics().widthPixels; //Make sure to import Resources package |
This file contains 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
//install openCV contrib: https://cocoapods.org/pods/OpenCV2-contrib | |
/* | |
//in Podfile: | |
target 'MyProject' do | |
pod 'OpenCV2-contrib', '~> 3.2' | |
*/ | |
//pod install | |
#include <opencv2/core/core.hpp> |
This file contains 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
#find all videos in a folder and reduce their dimensions and or quality | |
#-crf lower is higher bitrate (better quality) | |
# -b 1000000 can be added, where you divide 1 GB by the video length in seconds (e.g. this is a 16m:40s video) | |
find . -type f -name "*.mp4" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -crf 20 -s 1280x720 -acodec copy -y "${FILE%.mp4}.shrink.mp4";' _ '{}' \; | |
#optimize an mp4 | |
ffmpeg -i input.mp4 -vcodec h264 output.mp4 | |
#imagemagick: |