Difference between revisions of "Kameie"

From wiki.ferrari.mo.it
Jump to navigation Jump to search
Line 40: Line 40:
  
 
Save: severity = 0.
 
Save: severity = 0.
 +
 +
== Build Howto ==
 +
 +
Prerequisites: having an Opencv environment (see the corrispondent section).
 +
 +
Create the directory /root/Kameie/ ,
 +
 +
mkdir /root/Kameie
 +
 +
and copy the following files to it:
 +
 +
*.cpp
 +
*.h
 +
Kameie.pro
 +
 +
Convert them to unix format
 +
 +
dos2unix /root/Kameie/*
 +
 +
Then, edit Kameie.pro, and change the include from
 +
 +
INCLUDEPATH += C:\OpenCV\build\include
 +
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_core411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_highgui411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_imgcodecs411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_imgproc411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_features2d411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_calib3d411.dll
 +
LIBS += C:\OpenCV\opencv-build\bin\libopencv_videoio411.dll
 +
 +
to
 +
 +
INCLUDEPATH += /usr/local/include
 +
 +
LIBS += /usr/local/lib/libopencv_core.so
 +
LIBS += /usr/local/lib/libopencv_highgui.so
 +
LIBS += /usr/local/lib/libopencv_imgcodecs.so
 +
LIBS += /usr/local/lib/libopencv_imgproc.so
 +
LIBS += /usr/local/lib/libopencv_features2d.so
 +
LIBS += /usr/local/lib/libopencv_calib3d.so
 +
LIBS += /usr/local/lib/libopencv_videoio.so
 +
 +
Edit /etc/ld.so.conf, and add
 +
 +
/usr/local/lib
 +
 +
and compile it
 +
 +
ldconfig -v

Revision as of 09:45, 13 April 2020

Schema

Kameie.png

Protocol

Authentication

{ "pin": "00000000" }
{ "success": [true|false] }

Pin is the password (hardcoded in the software).

Manual commands

{ "command": "[preview|save|rugosity|colorChange|bubbles]", "msgId": I, "camera": J, ["prefix": "KKK"], ["left": L], ["right": M], ["junction": [true|false]] }
{ "success": [true|false], "communicationId": I, "camera": J, ["errorCode": N], ["avgIntensity": O], ["maxIntensity": P], ["extension": Q], ["redDiff": R], ["greenDiff": S], ["blueDiff": T], ["number": U], ["maxDimension": V] }

Preview: optional prefix.

Save: optional prefix.

Rugosity: returns avgIntensity, maxIntensity, extension.

ColorChange: optional left, right, junction. Returns redDiff, greenDiff, blueDiff.

Bubbles: returns number, maxDimension.

Configuration commands

{ "settings": "[setDutyCycles|pwmOn|pwmOff]", "msgId": I, "pwmId": J, ["white": K], ["red": L], ["green": M], ["blue": N] }
{ "success": [true|false], "communicationId": I, "pwmId": J, ["errorCode": N] }

Automatic commands

{ "gpioCommand": "[save]", "camera": I, "gpio": J, "sequence": K }
{ "event": L, "camera": I, "severity": [0|1|2], ["filename": "MMM"], ["sequence": N] }

GpioCommand comes from GpioInterrupt.

Save: severity = 0.

Build Howto

Prerequisites: having an Opencv environment (see the corrispondent section).

Create the directory /root/Kameie/ ,

mkdir /root/Kameie

and copy the following files to it:

*.cpp
*.h
Kameie.pro

Convert them to unix format

dos2unix /root/Kameie/*

Then, edit Kameie.pro, and change the include from

INCLUDEPATH += C:\OpenCV\build\include

LIBS += C:\OpenCV\opencv-build\bin\libopencv_core411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_highgui411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_imgcodecs411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_imgproc411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_features2d411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_calib3d411.dll
LIBS += C:\OpenCV\opencv-build\bin\libopencv_videoio411.dll

to

INCLUDEPATH += /usr/local/include

LIBS += /usr/local/lib/libopencv_core.so
LIBS += /usr/local/lib/libopencv_highgui.so
LIBS += /usr/local/lib/libopencv_imgcodecs.so
LIBS += /usr/local/lib/libopencv_imgproc.so
LIBS += /usr/local/lib/libopencv_features2d.so
LIBS += /usr/local/lib/libopencv_calib3d.so
LIBS += /usr/local/lib/libopencv_videoio.so

Edit /etc/ld.so.conf, and add

/usr/local/lib

and compile it

ldconfig -v