Computer vision involves analyzing patterns in visual images and reconstructing the real world objects that produced them. The process in often broken up into two phases: feature detection and pattern recognition. Feature detection involves selecting important features of the image; pattern recognition involves discovering patterns in the features. We will investigate a particularly clean pattern recognition problem involving points and line segments. This kind of pattern recognition arises in many other applications, for example statistical data analysis.
Collinear API is a REST API Service that determines lines that contain at least N or more collinear points.
API is hosted at https://collinearapi.herokuapp.com/
Example:
https://collinearapi.herokuapp.com/space
POST /point with body { "x": ..., "y": ... }
GET /space
Example response
[ {"x": 2, "y": 3}, {"x": -2, "y": 1023}, {"x": 3.2, "y": 0}, ... ]
GET /lines/{n}
Example Request: GET /lines/2
[ [ {"x": 2, "y": 3}, {"x": -2, "y": 1023} ], [ {"x": 3.2, "y": 0}, {"x": -2, "y": 1023} ], ... ]
DELETE /space
-
Install the latest versions of node and npm.
-
Install npm dependencies using
npm install
. -
Install mysql server
-
Create a .env file with
DB_PASS='$yourmysqlpasshere'
- alternatively you can configure the database manually using the config file in the config folder
-
Run tests with
npm test
(also starts the sever) -
start the server with
node app.js
from the root folder
- Note that the default server port is
8080
and the default host is'localhost'
-
Send test requests to
http://localhost:8080
( for examplehttp://localhost:8080/space
) -
Please post issues if you find bugs or see areas of improvement