Skip to content

Instantly share code, notes, and snippets.

View hndr91's full-sized avatar

Afif Hendrawan hndr91

  • Malang, ID
View GitHub Profile
% holder variabel
im = zeros(10,1);
% store hasil ekstraksi ke element im
im(1,1) = feature(1); % misal, masukkan fitur satu ke im ke 1
im(2,1) = feature(2); % masukkan fitur 2 ke im ke 2
% dst %
% kalau fungsi fitur yang store sama di looping aja
@hndr91
hndr91 / meanBlur.m
Created March 18, 2017 06:50
mean blur 3x3 kernel
function result = meanBlur(input)
%im = imread('cameraman.tif');
[x,y] = size(input);
result = zeros(x,y);
for i=1:x-2
for j=1:y-2
window = [input(i:i+2,j:j+2)];
result(i+1,j+1) = mean2(window);
end
end
import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
for i in installed_packages])
print(installed_packages_list)
@hndr91
hndr91 / plot.m
Created March 3, 2017 07:35
plot imhist
i = imread('contoh-image.tif');
h1 = imhist(i,256); % store imhist 256 to h1
h2 = imhist(i,64); % store imhist 64 to h2
h3 = imhist(i,32); % store imhist 32 to h3
% plotting %
figure
subplot(2,2,1)
imshow(i)
title('image')
@hndr91
hndr91 / emokit.md
Last active March 2, 2017 11:22
How to setup emokit properly on mac. Emokit https://github.com/openyou/emokit
@hndr91
hndr91 / simple.py
Created January 24, 2017 16:39
Telegram Bot
db_session
def addplayer(self, bot, update, args):
val = args[0]
DBModel.User(name=val) # my db model
bot.sendMessage(chat_id=update.message.chat_id, text="Berhasil Ditambahkan")
@hndr91
hndr91 / miyazaki.m
Last active September 21, 2016 02:59
Miyazaki's Specular-free method MATLAB implementation
%%=== Miyazaki Specular-free MATLAB Implementation ==%%
%%
% Based on Daisuke Miyazaki et al. publication : "Polarization-based Inverse Rendering from a Single View ",
% and awesome explanation at http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche40.html.
% Sorry I don't know the author who post the explanation on that page.
% Illumination Compenstion doesn't implemented yet on this script
%%
%% Miyazaki Function %%
@hndr91
hndr91 / .htaccess
Last active May 12, 2016 18:17
.htaccess Slim
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@hndr91
hndr91 / MainActivity.java
Created March 10, 2016 14:53
WebView with upload ability
package com.webview;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.ValueCallback;
@hndr91
hndr91 / index.php
Created January 28, 2016 13:41
Index.php with View Configuration, Slim Framework
<?php
require 'vendor/autoload.php' //fitur autoload composer
//Inisiasi Slim Framewrok
$app = new \Slim\Slim(array(
'view' => new \Slim\Views\Twig(), //set template engine to Twig engine
'templates.path' => './templates' //lokasi default template bisa di ganti sesuai dengan kebutuhan
));
//home routing dengan view
$app->get('/', function() use($app){