samuelbr / openalpr-server Goto Github PK
View Code? Open in Web Editor NEWNodeJS server for OpenALPR.
NodeJS server for OpenALPR.
Hi Mate, thanks for this - I needed to update to the following to get it to work. I also removed the "data" element so I could use this as an LPR endpoint for AgentDVR.
If anyone wants a free alpr for AgentDVR then use this. Wonder if search results pick up comments?
And sorry - code tags not working for some reason....
`
//Shorten
define('DS',DIRECTORY_SEPARATOR);
/**
from https://raw.githubusercontent.com/stefanvangastel/openalpr-php-rest-api/master/check.php
*/
/**
Check tmp dir and write permissions
*/
if( ! file_exists('tmp') ){
if( ! mkdir('tmp') ){
//Try to create
$response['error']= 'Error: Cannot create tmp dir in current dir, please check webserver permissions.';
respond($response);
}
}
/**
if( empty(run('/usr/local/bin/alpr --version')) ){
$mypath = run('echo $PATH');
$response['error']= 'Error: alpr command not found, is it installed and in your PATH? PATH:' . $mypath[0] . $alpr[0];
respond($response);
}
/**
/**
/**
/**
/**
//Add results to response
//var_dump($result);
//$response['data'] = json_decode( $result[sizeof($result)-1], TRUE);
$response = json_decode( $result[sizeof($result)-1], TRUE);
//Respond with results
respond($response);
/**
//Sets headers and responds json
function respond($response){
header('Access-Control-Allow-Origin: *');
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');
echo json_encode($response);
exit;
}
//Runs command and returns output
function run($command){
$output = array();
exec($command,$output);
return $output;
}
`
Rather than providing a URL that downloads the image, also support accepting image data over a POST request.
If you make two requests at the same time, you get the following error response:
Premature end of JPEG file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.