Képfelismerés info – Image recognition

forrás: Facebook beszélgetésből

Egy rajzfelismerő alkalmazást akarok írni, ami tök egyszerű formákat, pl Kör, négyzet, háromszög stb… felismer. Mármint hogy a júzer lerajzolja a képernyőre és a program felismeri az előre megadottak közül, hogy melyik az.
Ki hogyan csinálna egy ilyen algoritmust?

A jelenlegi elgondolásom:
Először azonos méretűre skálázza a 2 mintát. Azután a bal felső sarkot használva mint nézőpont X mintát vesz a rajzból, legyen mondjuk X = 90, tehát 1 fokonként minden szögnél. Majd ezen a Xi-edik mintán (ami egy vonal a bal felső saroktól indulva) lekéri az összes pontot ami átmegy a rajzon. Ezt megteszi mind a két rajzzal, végül minden egyes mintánál megnézi hogy az átmeneti pontok mennyire vannak messze egymástól. Végül kiszámolja, hogy átlagosan mennyire voltak messze a kapott mintavételi pontok és ha ez túllép egy értéket akkor nem az adott rajz van a képernyőn.
De hátha van valakinek egy jobb megoldása erre.- Jelenleg a turning Function-on állok, hogy azzal vizsgálom meg az egyes formákat, egyszerűnek tűnik és gyorsnak


Bármit felismerni nyilván nem lehet. Kell lennie egy “ABC”-dnek, amiket ismersz.

Szerintem inkább regressziót használj, vagy klaszterezést. Egy csomó templatelős marhaságot megspórolsz magadnak

****
Detecting some simple shapes in images : http://www.aforgenet.com/articles/shape_checker/

*****

Hough transform : https://en.wikipedia.org/wiki/Hough_transform

******

Handwriting Recognition with Python :

https://www.youtube.com/watch?v=PO4hePKWIGQ

******

Mi az egyetemen MatLabot használtunk erre a célra, egy jó algoritmussal nagyon jó felismerőt lehet készíteni. A konkrét metodikára már nem emlékszem de elérhetőek példakódok is és ha mélyebben beleásol tudod optimalizálni a felismerést (pontosságot javítani illetve beállítani mennyire legyen megengedő a program a felismerés során).

Recognition methods in image processing : http://www.mathworks.com/discovery/image-recognition.html?requestedDomain=www.mathworks.com&requestedDomain=de.mathworks.com

*************************

Tegnap kértem segítséget egy alakzatfelismerő apphoz, mára sikerült az első protoípust megírnom Unity Engine-hez

Szeretném megköszönni mindenkinek a segítséget. Egyébben a TurningFunction-t alkalmaztam.

https://sites.google.com/site/turningfunctions/

Itt a kód annak aki kérte:

http://pastebin.com/95VS8p4h

using UnityEngine;
using System.Collections;

public class Pattern
{
const float angleDivider = 180f;

public Vector2[] points;
public float vectorsLengthSum;
public float[] positions;
public float[] valueOnLines;

public Pattern(Vector2[] points)
{
this.points = points;

vectorsLengthSum = 0f;
Vector2 prevPoint = points[0];
for (int i = 0; i < points.Length; i++) { vectorsLengthSum += Vector2.Distance(prevPoint, points[i]); prevPoint = points[i]; } GenerateTurningFuncion(); } void GenerateTurningFuncion() { positions = new float[points.Length]; valueOnLines = new float[points.Length - 1]; float pos = 0f; Vector2 prevPoint = points[0]; Vector2 prevLine = points[0] - Vector2.right; float value = SignedAngle(Vector2.right, prevLine) / angleDivider; //Count the positions of the points in the shape. for (int i = 0; i < points.Length; i++) { pos += Vector2.Distance(prevPoint, points[i]) / vectorsLengthSum; positions[i] = pos; //Count each value on each line if (i > 0)
{
Vector2 line = points[i] - points[i - 1];
value += SignedAngle(prevLine, line) / angleDivider;
valueOnLines[i - 1] = value;

Debug.Log("Line: " + line + " - " + prevLine + "\t Angle: " + SignedAngle(prevLine, line) + "\t Value: " + value + "\t Added: " + SignedAngle(prevLine, line) / angleDivider);

prevLine = line;
}
prevPoint = points[i];
}
}

public float[] Sample(int sampleCount)
{
float[] samples = new float[sampleCount];

int lineIndex = 0;
for (int i = 0; i < sampleCount; i++) { float samplePos = i / (float)sampleCount; while (positions[lineIndex + 1] < samplePos) lineIndex++; samples[i] = valueOnLines[lineIndex]; //Debug.Log("i: " + i + "\t lineIndex: " + lineIndex + "\t samplePos: " + samplePos + "\t samples[i]: " + samples[i]); } return samples; } public static float AverageDifference(Pattern template, Pattern drawn, int samples) { return Difference(template, drawn, samples) / samples; } public static float Difference(Pattern template, Pattern drawn, int samples) { float[] sourceSamples = template.Sample(samples); float[] targetSamples = drawn.Sample(samples); float avg = 0f; for (int i = 0; i < samples; i++) avg += sourceSamples[i] - targetSamples[i]; return Mathf.Abs(avg); } float SignedAngle(Vector2 v1, Vector2 v2) { //var sign = Mathf.Sign(v1.x * v2.y - v1.y * v2.x); float sign = Mathf.Sign(Vector3.Cross(v1, v2).z); return Vector2.Angle(v1, v2) * sign; } }

************************************************************

Laravel 5 Reset Password

https://www.youtube.com/watch?v=tFHMdYDULOc

E:\server\\blog>php artisan make:auth
Created View: E:\server\blog\resources/views/auth/login.blade.php
Created View: E:\server\blog\resources/views/auth/register.blade.php
Created View: E:\server\blog\resources/views/auth/passwords/email.blade.php
Created View: E:\server\blog\resources/views/auth/passwords/reset.blade.php
Created View: E:\server\blog\resources/views/auth/emails/password.blade.php
Created View: E:\server\blog\resources/views/layouts/app.blade.php
Created View: E:\server\blog\resources/views/home.blade.php
Created View: E:\server\blog\resources/views/welcome.blade.php
Installed HomeController.
Updated Routes File.
Authentication scaffolding generated successfully!

Ubuntu mail

sudo apt-get update
sudo apt-get install postfix

sudo nano /etc/postfix/main.cf

remove the alias_maps parameter and replace it with virtual_alias_maps!!

virtual_alias_maps = hash:/etc/postfix/virtual

sudo nano /etc/postfix/virtual

@example.com yourusername

sudo service postfix restart

sudo apt-get install mailutils

How To Install and Setup Postfix on Ubuntu 14.04 : https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-14-04

How To Install and Configure Postfix on Ubuntu 16.04 : https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04

Setup mail server on ubuntu 14.04 ( Postfix – dovecot ) : http://www.krizna.com/ubuntu/setup-mail-server-ubuntu-14-04/

PostfixBasicSetupHowto : https://help.ubuntu.com/community/PostfixBasicSetupHowto

GNU Mailutils : http://mailutils.org/manual/html_node/Reading-Mail.html

firewall!!! sudo ufw allow Postfix

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04

Mail forward:

virtual_alias_maps = hash:/etc/postfix/virtual

To catch and forward emails to any address for a given domain, use the following notation

@mydomain.com myself@gmail.com mystaff@gmail.com
http://www.binarytides.com/postfix-mail-forwarding-debian/

Configure a Postfix Relay through Gmail on Ubuntu : https://devops.profitbricks.com/tutorials/configure-a-postfix-relay-through-gmail-on-ubuntu/

Configure Postfix to use Gmail as a Mail Relay 2016: https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/

Ubuntu server add subdomain for new Laravel project in 3 steps

subdomain, virtuális domain

1: sudo nano /etc/hosts

34.54.235.64 subdomain.mydomain.hu ( your IP, your sub domain )

2: Add /etc/apache2/apache2.conf this line

<VirtualHost *:80>
ServerName subdomain.mydomain.hu
DocumentRoot /var/www/your laravel project folder/public
<Directory /var/www/your laravel project folder/public>
Options +FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

 

3: sudo service apache2 restart

How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS : https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

setting up subdomain on ubuntu server : http://askubuntu.com/questions/463618/setting-up-subdomain-on-ubuntu-server

*****
How to Use subdomain in Routes in laravel : https://www.dunebook.com/use-subdomain-in-routes-in-laravel-5-1/

https://www.linkedin.com/groups/4419933/4419933-6166863077137571841

The Evolution of PHP – Infographic

http://www.cabotsolutions.com/2016/06/the-evolution-of-php-infographic/

PHP was created by Rasmus Lerdorf in 1994 and was publicly released in June 1995. Back then, it was the abbreviated form of Personal Home Page tools. After two years, in 1997, it entered public domain as PHP/F1 2.0. A year later, two programmers, Zeev Suraski and Andi Gutmans, rewrote the base of the original version and launched PHP 3.

PHP 4, which came out in 2000, incorporated a scripting engine named Zend Engine that was designed by Suraski and Gutmans. Three more major versions with some sub-versions were launched in the later years with the latest version 7.0 released in 2015.

Two decades after its inception, PHP has registered a phenomenal growth and is still going strong. Today, it controls over 80% of all the websites on the globe. This includes majors like Facebook, Wikipedia and WordPress among others.

The Evolution of PHP – Infographic