Nodeflux Central
License Plate Recognition (LPR)

API Reference — License Plate Recognition

Referensi lengkap endpoint REST API Visionaire4 untuk manajemen pipeline License Plate Recognition — spawn, status, konfigurasi, streaming, dan format event output.

Semua endpoint LPR pada halaman ini ditujukan ke Visionaire4 API, bukan Lenz API. Base URL default adalah http://localhost:4004 — sesuaikan dengan alamat dan port deployment Visionaire4 Anda (variabel VISIONAIRE_API_URL). Autentikasi mengikuti skema yang dikonfigurasi pada instalasi Visionaire4 Anda.


Manajemen Pipeline

Endpoint untuk membuat, memeriksa status, dan menghapus pipeline LPR. Setiap pipeline diidentifikasi oleh kombinasi unik node_num + stream_id + analytic_id.

Varian analytic_id yang tersedia:

  • NFV4-LPR2 — Single-stage, plat sipil standar, dengan direction inference
  • NFV4-LPRS — Single-stage, multi-class (sipil + militer/diplomatik), dengan direction inference
  • NFV4-LPR3 — Two-stage, high-throughput, throttled plate detection, tanpa direction inference
  • NFV4-LPR3S — Two-stage, multi-class, high-throughput, tanpa direction inference
POST
/pipeline/{node_num}/{stream_id}/NFV4-LPR3

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire. Gunakan 0 untuk deployment single-node.

stream_id*string

ID unik stream video yang akan diproses pipeline ini.

analytic_id*string

Varian analitik LPR yang akan dijalankan.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3" \  -H "Content-Type: application/json" \  -d '{    "plate_confidence_threshold": 0.6,    "vehicle_confidence_threshold": 0.6,    "similarity_score_threshold": 0.7,    "min_group_member": 2,    "plate_cache_lifetime": 10,    "areas": {      "Entry Gate": {        "polygon": [          [            0,            0.1          ],          [            0.5,            0.1          ],          [            0.5,            0.95          ],          [            0,            0.95          ]        ],        "lines": [          {            "points": [              [                0.1,                0.6              ],              [                0.4,                0.6              ]            ],            "in": true          }        ]      },      "Exit Gate": {        "polygon": [          [            0.5,            0.1          ],          [            1,            0.1          ],          [            1,            0.95          ],          [            0.5,            0.95          ]        ],        "lines": [          {            "points": [              [                0.6,                0.6              ],              [                0.9,                0.6              ]            ],            "in": false          }        ]      }    }  }'
{  "code": 200,  "message": "Pipeline created successfully",  "data": {    "analytic_id": "NFV4-LPR2",    "stream_id": "stream_001",    "status": "running"  }}
{  "code": 400,  "message": "Invalid configuration: areas is required"}
{  "code": 409,  "message": "Pipeline already exists"}
GET
/pipeline/{node_num}/{stream_id}/NFV4-LPR3

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire. Gunakan 0 untuk deployment single-node.

stream_id*string

ID unik stream video yang akan diproses pipeline ini.

analytic_id*string

Varian analitik LPR yang akan dijalankan.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Response Body

application/json

application/json

curl -X GET "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3"
{  "code": 200,  "data": {    "analytic_id": "NFV4-LPR2",    "stream_id": "stream_001",    "status": "running",    "uptime_seconds": 3600,    "processed_frames": 36000  }}
{  "code": 404,  "message": "Pipeline not found"}
DELETE
/pipeline/{node_num}/{stream_id}/NFV4-LPR3

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire. Gunakan 0 untuk deployment single-node.

stream_id*string

ID unik stream video yang akan diproses pipeline ini.

analytic_id*string

Varian analitik LPR yang akan dijalankan.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Response Body

application/json

application/json

curl -X DELETE "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3"
{  "code": 200,  "message": "Pipeline deleted successfully"}
{  "code": 404,  "message": "Pipeline not found"}

Konfigurasi Pipeline

Endpoint untuk memperbarui konfigurasi pipeline yang sedang berjalan tanpa perlu restart. Hanya field yang disertakan yang akan diperbarui.

PUT
/pipeline/{node_num}/{stream_id}/NFV4-LPR3/config

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire.

stream_id*string

ID stream video.

analytic_id*string

Varian analitik LPR.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PUT "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3/config" \  -H "Content-Type: application/json" \  -d '{    "plate_confidence_threshold": 0.7,    "similarity_score_threshold": 0.8  }'
{  "code": 200,  "message": "Configuration updated successfully"}
{  "code": 400,  "message": "Invalid configuration"}
{  "code": 404,  "message": "Pipeline not found"}

Streaming & Visualisasi

Endpoint untuk mengakses output visual pipeline — berguna untuk debugging penempatan kamera, verifikasi konfigurasi area ROI, dan monitoring real-time.

GET
/pipeline/{node_num}/{stream_id}/NFV4-LPR3/mjpeg

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire.

stream_id*string

ID stream video.

analytic_id*string

Varian analitik LPR.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Response Body

multipart/x-mixed-replace

application/json

curl -X GET "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3/mjpeg"
"string"
{  "code": 404,  "message": "Pipeline not found"}
GET
/pipeline/{node_num}/{stream_id}/NFV4-LPR3/snapshot

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node Visionaire.

stream_id*string

ID stream video.

analytic_id*string

Varian analitik LPR.

Value in"NFV4-LPR2" | "NFV4-LPRS" | "NFV4-LPR3" | "NFV4-LPR3S"

Response Body

image/jpeg

application/json

curl -X GET "http://localhost:4004/pipeline/0/stream_001/NFV4-LPR3/snapshot"
"string"
{  "code": 404,  "message": "Pipeline not found"}

Event Streaming (WebSocket)

Visionaire4 mengirim setiap event hasil deteksi/inferensi melalui WebSocket. Untuk berlangganan event yang dihasilkan oleh pipeline License Plate Recognition pada stream tertentu, buka koneksi WebSocket ke endpoint berikut:

ws://<host>:4004/event_channel/{node_num}/{stream_id}/NFV4-LPR3

Setelah koneksi terbuka, server akan langsung mendorong (push) setiap event ke client tanpa perlu handshake atau pesan subscribe. Tutup koneksi untuk berhenti menerima event.

Parameter Path

ParameterTipeDeskripsi
node_numintegerNomor node tempat stream berjalan (0 = master)
stream_idstringID stream yang akan dipantau

Query Parameter (Opsional)

ParameterTipeDeskripsi
logicstringFilter event berdasarkan nama logic rule yang aktif pada pipeline. Tanpa parameter ini, semua event dari analitik akan dikirim.

Format Pesan

Setiap event yang diterima berbentuk JSON dengan struktur berikut:

{
  "event_id": "evt_123456",
  "stream_id": "<stream_id>",
  "analytic_id": "NFV4-LPR3",
  "node_num": 0,
  "timestamp_ms": 1674123456789,
  "primary_text": "B 1234 ABC",
  "secondary_text": "Whitelist",
  "pipeline_data": {
    /* field spesifik module — lihat "Output yang Dihasilkan" pada index.mdx */
  },
  "image_jpeg": "base64-encoded JPEG..."
}

Detail field pipeline_data untuk License Plate Recognition dijelaskan pada Output yang Dihasilkan di halaman utama.

Contoh Koneksi

const ws = new WebSocket(
  'ws://localhost:4004/event_channel/0/<stream_id>/NFV4-LPR3'
);

ws.onmessage = (msg) => {
  const event = JSON.parse(msg.data);
  console.log(event.primary_text, event.pipeline_data);
};

ws.onerror = (err) => console.error('WebSocket error', err);
ws.onclose = () => console.log('Disconnected');
import asyncio
import json
import websockets

async def listen():
    url = "ws://localhost:4004/event_channel/0/<stream_id>/NFV4-LPR3"
    async with websockets.connect(url) as ws:
        async for msg in ws:
            event = json.loads(msg)
            print(event["primary_text"], event["pipeline_data"])

asyncio.run(listen())

Filter Berdasarkan Logic

Jika pipeline menjalankan beberapa logic rule, Anda dapat memfilter event hanya untuk satu logic dengan menambahkan query parameter:

ws://<host>:4004/event_channel/{node_num}/{stream_id}/NFV4-LPR3?logic=<logic_name>

Endpoint Channel Lainnya

Untuk mendengarkan event yang lebih luas (lintas analitik atau lintas stream), gunakan endpoint berikut yang dijelaskan pada Developer Guide:

EndpointCakupan
WS /event_channel/Semua event dari seluruh node
WS /event_channel/{node_num}/Semua event dari satu node
WS /event_channel/{node_num}/{stream_id}Semua event dari satu stream (semua analitik)

On this page