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
In "AndroidMenifest.xml" | |
<uses-permission android:name="android.permission.CAMERA"/> | |
In "MainActivity.java" | |
import android.content.pm.PackageManager; | |
public void onCreate(Bundle savedInstanceState) { ... |
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
https://www.thecodecity.com/2016/08/focus-modes-opencv-javacameraview-android.html |
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 org.opencv.android; | |
import java.nio.ByteBuffer; | |
import java.util.Arrays; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.ImageFormat; | |
import android.hardware.camera2.CameraAccessException; | |
import android.hardware.camera2.CameraCaptureSession; |
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
template <class T> | |
class SinglyLinkedList { | |
private: | |
SinglyLinkedList* next; | |
T data; | |
public: | |
// Constructor | |
SinglyLinkedList(const T &value) : next(NULL), data(value) {} |
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 plotly.graph_objs as go | |
from plotly.offline import iplot | |
def plot(x,y,type='scatter',title="title",xlabel="x", ylabel="y"): | |
if type=='scatter': | |
data = go.Scatter(x=x, y=y) | |
elif type=='bar': | |
data = go.Bar(x=x, y=y) | |
layout = go.Layout(title=title, xaxis=dict(title=xlabel), yaxis=dict(title=ylabel)) |
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 seaborn as sns | |
import matplotlib.pyplot as plt | |
plt.rcParams['figure.figsize'] = [15, 15] |
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
def draw_silhouette(sample_silhouette_values, silhouette_avg, n_clusters): | |
""" | |
Perform silhouette analysis. | |
Args: | |
- sample_silhouette_values | |
- silhouette_avg | |
Returns: | |
- Draws silhouette plot. |
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
def rand_bbox(size, lamb): | |
""" Generate random bounding box | |
Args: | |
- size: [width, breadth] of the bounding box | |
- lamb: (lambda) cut ratio parameter, sampled from Beta distribution | |
Returns: | |
- Bounding box | |
""" | |
W = size[0] | |
H = size[1] |