Insight is a program we wrote which works in conjunction with the DriverStationDisplay (see https://github.com/Team3512/DriverStationDisplay) to perform vision processing on objects relating to the current FRC game using images from an IP camera.
If one is building on Windows, we recommend using the MSYS2 compiler. The following libraries are required as dependencies and should be installed using either your package manager of choice or MSYS2's pacman:
- Qt 5
- libjpeg-turbo (used for fast JPEG compression/decompression)
- OpenCV (a vision processing library written in C++)
To build the project, first run qmake dir
within a terminal from the desired build directory, where "dir" is the relative location of the Insight.pro file. This will generate three makefiles. If a debug build is desired, run make -f Makefile.Debug
. The default behavior when simply running make
is to perform a release build.
To cross-compile from Linux to Windows, install the MinGW-w64 toolchain (mingw-w64-gcc
and a MinGW-w64 build of Qt 5 (mingw-w64-qt5-base
), then run publish-win32.sh
to build LiveGrapher and create a .zip of the application binary and necessary files.
The IPSettings.txt in the root directory of the project should be kept with the executable since it looks for it in its current directory.
The required entries in IPSettings.txt are as follows:
IP address of the MJPEG stream for Insight to process
Port from which the MJPEG stream is served
Path to the MJPEG stream at the given IP address
Note: If any one of these settings is incorrect, no MJPEG stream will be displayed or processed. If "streamServerPort" is incorrect, Insight will still work but clients will not be able to receive the processed image.
Robot's IP address
Port to which to send data relating to the processed image. The data may be target coordinates, drive commands, etc.
This entry can be either 'true' or 'false'. It determines whether images containing the intermediate steps of processing will be written to disk.
This entry has a valid range of 0 through 100 inclusive. The slider in Insight's window can be used to adjust the size of the rectangle drawn on the raw image presented in the window and served to clients. This option sets the size of that rectangle when Insight is started. The rectangle will have the same aspect ratio as and be concentric with respect to the image.