Initial commit. Working.
This commit is contained in:
@@ -0,0 +1,107 @@
|
|||||||
|
# Point Grey / FLIR SWIR camera on Ubuntu 24.04 / Linux Mint 22
|
||||||
|
|
||||||
|
Setup for a legacy **Point Grey Research USB 2.0 camera** (USB vendor `1e10`) on a modern Debian/Ubuntu-family machine. Tested against the camera that reports:
|
||||||
|
|
||||||
|
```
|
||||||
|
idVendor=1e10 idProduct=2005
|
||||||
|
Product: USB 2.0 Digital Imaging Camera
|
||||||
|
Manufacturer: Point Grey Research
|
||||||
|
```
|
||||||
|
|
||||||
|
These cameras predate FLIR's Spinnaker SDK and are supported only by the older **FlyCapture2 SDK** (here, version 2.13.3.31). Spinnaker will not see them.
|
||||||
|
|
||||||
|
## What gets installed
|
||||||
|
|
||||||
|
The FlyCapture2 SDK was built for Ubuntu 18.04. Its GUI applications (`FlyCap2`, `UpdatorGUI`) depend on GTK2-era libraries (`libgtkmm-2.4`, `libglademm-2.4`, `libgtkglextmm`) that no longer exist in Ubuntu 24.04, so we do not install them. The **core** libraries only need `libusb` and `libraw1394`, which are still present, so this setup installs:
|
||||||
|
|
||||||
|
- `libflycapture2` / `libflycapture-c2` and their `-dev` packages (C++ and C runtime + headers).
|
||||||
|
- `FlyCapture2Test` and `FlyCapture2Test_C` — prebuilt command-line tools that list attached cameras and grab test frames. They link only the core library, so they run fine without the GUI stack.
|
||||||
|
- `fc2view` — a small **live viewer** built from `fc2view.cpp` in this repo, using OpenCV. It replaces the vendor's GTK2 GUI: it streams the first camera into a window and saves snapshots (see below).
|
||||||
|
- The example source tree at `/usr/src/flycapture/src` for building your own capture programs.
|
||||||
|
|
||||||
|
It also does the two bits of host configuration these cameras need:
|
||||||
|
|
||||||
|
- **A udev rule + `flirimaging` group** so the camera is readable/writable without root.
|
||||||
|
- **A larger USBFS buffer** (`usbcore.usbfs_memory_mb=1000`, up from the 16 MB default). Camera frames exceed the default buffer, which otherwise shows up as grab failures or dropped images.
|
||||||
|
|
||||||
|
The vendor GUI itself is the only thing lost by not being on 18.04, and `fc2view` covers the common need for a live viewport. If you specifically need the vendor GUI (e.g. for firmware updates via `UpdatorGUI`), run it in an 18.04/20.04 container.
|
||||||
|
|
||||||
|
## Live viewer (`fc2view`)
|
||||||
|
|
||||||
|
`install.sh` compiles `fc2view.cpp` and installs it as `/usr/local/bin/fc2view`. With the camera plugged in:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fc2view
|
||||||
|
```
|
||||||
|
|
||||||
|
It connects to the first camera, prints its model and serial, and opens a live window. Keys: **`s`** saves a snapshot to the current directory as `fc2-<serial>-<timestamp>.png` (saved from the raw frame, so a Mono16 SWIR sensor keeps its full bit depth); **`q`** or **Esc** quits. It converts each frame to BGR for display, so it works on mono/SWIR and colour sensors alike.
|
||||||
|
|
||||||
|
It's about 130 lines and depends only on OpenCV and the FlyCapture2 core library. Treat it as a starting point for your own acquisition code. Rebuild by hand with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
g++ fc2view.cpp -I/usr/include/flycapture $(pkg-config --cflags --libs opencv4) -lflycapture -o fc2view
|
||||||
|
```
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
The SDK `.deb` files are bundled under `sdk/` because FLIR's download is behind a login, so the repo is self-contained. From this directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Then **log out and back in** (for the `flirimaging` group to apply). The USBFS limit is set live during install and made permanent on the next reboot; a reboot covers both at once.
|
||||||
|
|
||||||
|
Verify, with the camera plugged in:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
FlyCapture2Test # prints camera info + grabs frames
|
||||||
|
fc2view # opens the live window
|
||||||
|
```
|
||||||
|
|
||||||
|
`FlyCapture2Test` should show the camera's serial, model and firmware, then a batch of grabbed frames. That serial should match the one in `dmesg`/`lsusb` (`00FBA0C0` on the reference machine).
|
||||||
|
|
||||||
|
## Rolling out to another machine
|
||||||
|
|
||||||
|
The camera model and the OS release are the same across your machines, so:
|
||||||
|
|
||||||
|
1. Copy this whole directory (it includes `sdk/` with the `.deb` files).
|
||||||
|
2. Run `sudo ./install.sh`.
|
||||||
|
3. Log out and back in (or reboot).
|
||||||
|
|
||||||
|
The script is idempotent, so re-running it to repair a machine is safe. If a machine is a **different architecture** (e.g. arm64) or a **different OS release**, the bundled amd64 debs will not apply; get the matching FlyCapture2 build from FLIR and drop its debs into `sdk/`.
|
||||||
|
|
||||||
|
## Building your own capture program
|
||||||
|
|
||||||
|
Headers are in `/usr/include/flycapture`; the library links with `-lflycapture`. A minimal build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
g++ my_capture.cpp -I/usr/include/flycapture -lflycapture -o my_capture
|
||||||
|
```
|
||||||
|
|
||||||
|
Or start from a worked example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp -r /usr/src/flycapture/src/FlyCapture2Test ~/fc2test && cd ~/fc2test
|
||||||
|
g++ FlyCapture2Test.cpp -I/usr/include/flycapture -lflycapture -o FlyCapture2Test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Uninstall
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ./uninstall.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This removes the libraries, CLI tools, example source and udev rule. It leaves the `flirimaging` group, the GRUB USBFS setting and the apt dependencies in place (they are harmless and may be shared); the script prints how to undo those by hand.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- **`FlyCapture2Test` finds no camera** — confirm `lsusb` shows `1e10:2005`. If it does, you probably have not logged out/in since install, so you lack the `flirimaging` group (`id` should list it). As a one-off check you can run `sudo FlyCapture2Test`.
|
||||||
|
- **Camera detected but frames fail or time out** — the USBFS buffer did not take. Check `cat /sys/module/usbcore/parameters/usbfs_memory_mb` (should read `1000`); if it reads `16`, reboot so the GRUB setting applies.
|
||||||
|
- **`error while loading shared libraries: libflycapture.so.2`** — run `sudo ldconfig`.
|
||||||
|
- **USB 2.0 bandwidth** — this is a USB 2.0 camera (~480 Mbps shared). On a busy hub you may need to lower resolution or frame rate. Plugging it into its own port/controller helps.
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
- Vendor SDK README: `sdk/README`.
|
||||||
|
- FLIR "Configuring USBFS" note explains the buffer limit (the SDK README links to `ptgrey.com/tan/10685`, now under flir.com support).
|
||||||
+111
@@ -0,0 +1,111 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// fc2view — minimal live viewer for Point Grey / FLIR FlyCapture2 cameras.
|
||||||
|
//
|
||||||
|
// The vendor GUI (FlyCap2) can't run on Ubuntu 24.04 (dead GTK2 deps), so
|
||||||
|
// this is a small native replacement built on OpenCV. It connects to the
|
||||||
|
// first camera on the bus, streams frames into a window, and lets you save
|
||||||
|
// snapshots.
|
||||||
|
//
|
||||||
|
// Keys: q or Esc quit
|
||||||
|
// s save a snapshot (PNG, native bit depth) to $PWD
|
||||||
|
//
|
||||||
|
// Build: g++ fc2view.cpp -I/usr/include/flycapture \
|
||||||
|
// $(pkg-config --cflags --libs opencv4) -lflycapture -o fc2view
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
#include "FlyCapture2.h"
|
||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
#include <ctime>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
using namespace FlyCapture2;
|
||||||
|
|
||||||
|
static void printError(const Error &e) { e.PrintErrorTrace(); }
|
||||||
|
|
||||||
|
// Timestamped filename like fc2-<serial>-20260929-142530.png
|
||||||
|
static std::string snapshotName(unsigned int serial)
|
||||||
|
{
|
||||||
|
std::time_t t = std::time(nullptr);
|
||||||
|
std::tm tm = *std::localtime(&t);
|
||||||
|
std::ostringstream s;
|
||||||
|
s << "fc2-" << serial << "-"
|
||||||
|
<< std::put_time(&tm, "%Y%m%d-%H%M%S") << ".png";
|
||||||
|
return s.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BusManager busMgr;
|
||||||
|
unsigned int numCameras = 0;
|
||||||
|
Error error = busMgr.GetNumOfCameras(&numCameras);
|
||||||
|
if (error != PGRERROR_OK) { printError(error); return 1; }
|
||||||
|
if (numCameras == 0)
|
||||||
|
{
|
||||||
|
std::cerr << "No FlyCapture2 cameras detected. Check `lsusb` for "
|
||||||
|
"1e10:xxxx and your 'flirimaging' group membership.\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
PGRGuid guid;
|
||||||
|
error = busMgr.GetCameraFromIndex(0, &guid);
|
||||||
|
if (error != PGRERROR_OK) { printError(error); return 1; }
|
||||||
|
|
||||||
|
Camera cam;
|
||||||
|
error = cam.Connect(&guid);
|
||||||
|
if (error != PGRERROR_OK) { printError(error); return 1; }
|
||||||
|
|
||||||
|
CameraInfo camInfo;
|
||||||
|
if (cam.GetCameraInfo(&camInfo) == PGRERROR_OK)
|
||||||
|
{
|
||||||
|
std::cout << "Connected: " << camInfo.modelName
|
||||||
|
<< " serial " << camInfo.serialNumber
|
||||||
|
<< " (" << camInfo.sensorResolution << ")\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
error = cam.StartCapture();
|
||||||
|
if (error != PGRERROR_OK) { printError(error); cam.Disconnect(); return 1; }
|
||||||
|
|
||||||
|
const std::string win = "fc2view";
|
||||||
|
cv::namedWindow(win, cv::WINDOW_NORMAL);
|
||||||
|
std::cout << "Streaming. Keys: 'q'/Esc quit, 's' save snapshot.\n";
|
||||||
|
|
||||||
|
Image rawImage, bgrImage;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
error = cam.RetrieveBuffer(&rawImage);
|
||||||
|
if (error != PGRERROR_OK) { printError(error); continue; }
|
||||||
|
|
||||||
|
// Convert whatever the sensor delivers (mono, Bayer, ...) to 8-bit BGR
|
||||||
|
// so it maps straight onto an OpenCV CV_8UC3 Mat with no reordering.
|
||||||
|
error = rawImage.Convert(PIXEL_FORMAT_BGR, &bgrImage);
|
||||||
|
if (error != PGRERROR_OK) { printError(error); continue; }
|
||||||
|
|
||||||
|
cv::Mat frame(bgrImage.GetRows(), bgrImage.GetCols(), CV_8UC3,
|
||||||
|
bgrImage.GetData(), bgrImage.GetStride());
|
||||||
|
if (frame.empty()) continue;
|
||||||
|
|
||||||
|
cv::imshow(win, frame);
|
||||||
|
|
||||||
|
int key = cv::waitKey(1) & 0xFF;
|
||||||
|
if (key == 'q' || key == 27) break; // q or Esc
|
||||||
|
if (key == 's')
|
||||||
|
{
|
||||||
|
// Save the raw frame so native bit depth (e.g. Mono16 on a SWIR
|
||||||
|
// sensor) is preserved, not the 8-bit display copy.
|
||||||
|
std::string name = snapshotName(camInfo.serialNumber);
|
||||||
|
PNGOption png;
|
||||||
|
if (rawImage.Save(name.c_str(), &png) == PGRERROR_OK)
|
||||||
|
std::cout << "Saved " << name << "\n";
|
||||||
|
else
|
||||||
|
std::cerr << "Failed to save " << name << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cam.StopCapture();
|
||||||
|
cam.Disconnect();
|
||||||
|
cv::destroyAllWindows();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Executable
+138
@@ -0,0 +1,138 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# install.sh — get a legacy Point Grey / FLIR USB2 camera running on
|
||||||
|
# Ubuntu 24.04 / Linux Mint 22 using the FlyCapture2 SDK (v2.13.3.31).
|
||||||
|
#
|
||||||
|
# These cameras (USB vendor 1e10) predate the Spinnaker SDK and are only
|
||||||
|
# supported by FlyCapture2. On a modern release we install just the core
|
||||||
|
# runtime + development libraries, whose only real dependencies are
|
||||||
|
# libusb and libraw1394. We deliberately skip the GUI packages (FlyCap2,
|
||||||
|
# UpdatorGUI): they need GTK2-era libraries (libgtkmm-2.4, libglademm-2.4,
|
||||||
|
# libgtkglextmm) that no longer exist in Ubuntu 24.04. Instead we install
|
||||||
|
# the prebuilt command-line tool FlyCapture2Test, which links only the
|
||||||
|
# core library, plus the example source tree for building your own apps.
|
||||||
|
#
|
||||||
|
# Run: sudo ./install.sh
|
||||||
|
# Undo: sudo ./uninstall.sh
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
GROUP="flirimaging"
|
||||||
|
USBFS_MB=1000
|
||||||
|
UDEV_RULES="/etc/udev/rules.d/40-flir.rules"
|
||||||
|
GRUB_FILE="/etc/default/grub"
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
SDK_DIR="${SDK_DIR:-$SCRIPT_DIR/sdk}"
|
||||||
|
|
||||||
|
# The user who should own the camera (the human running sudo, not root).
|
||||||
|
TARGET_USER="${SUDO_USER:-${USER:-}}"
|
||||||
|
|
||||||
|
log() { printf '\n\033[1;32m==>\033[0m %s\n' "$*"; }
|
||||||
|
warn() { printf '\033[1;33m[warn]\033[0m %s\n' "$*" >&2; }
|
||||||
|
die() { printf '\033[1;31m[error]\033[0m %s\n' "$*" >&2; exit 1; }
|
||||||
|
|
||||||
|
[ "$(id -u)" -eq 0 ] || die "Run as root: sudo ./install.sh"
|
||||||
|
[ -n "$TARGET_USER" ] && [ "$TARGET_USER" != "root" ] || \
|
||||||
|
die "Could not determine the target user. Run with sudo from your normal account."
|
||||||
|
[ -d "$SDK_DIR" ] || die "SDK directory not found: $SDK_DIR"
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "1/7 Installing dependencies (libusb, libraw1394, build tools, OpenCV)"
|
||||||
|
apt-get update -qq
|
||||||
|
# libusb/libraw1394: core SDK. g++/libopencv-dev: to build the fc2view viewer.
|
||||||
|
apt-get install -y libusb-1.0-0 libraw1394-11 g++ libopencv-dev
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "2/7 Installing FlyCapture2 core libraries"
|
||||||
|
# Order matters: runtime before its -dev, C API after the C++ core.
|
||||||
|
dpkg -i "$SDK_DIR"/libflycapture-2.13.3.31_amd64.deb \
|
||||||
|
"$SDK_DIR"/libflycapture-2.13.3.31_amd64-dev.deb \
|
||||||
|
"$SDK_DIR"/libflycapture-c-2.13.3.31_amd64.deb \
|
||||||
|
"$SDK_DIR"/libflycapture-c-2.13.3.31_amd64-dev.deb
|
||||||
|
ldconfig
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "3/7 Installing the FlyCapture2Test command-line tool + example source"
|
||||||
|
# The prebuilt CLI binaries and the C/C++ example source live inside the
|
||||||
|
# flycap package, but that package's *dependencies* pull in dead GTK2 libs.
|
||||||
|
# So we extract the useful files without installing (dpkg) the package.
|
||||||
|
TMP_EXTRACT="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$TMP_EXTRACT"' EXIT
|
||||||
|
dpkg-deb -x "$SDK_DIR"/flycap-2.13.3.31_amd64.deb "$TMP_EXTRACT"
|
||||||
|
install -m 0755 "$TMP_EXTRACT/usr/bin/FlyCapture2Test" /usr/local/bin/FlyCapture2Test
|
||||||
|
install -m 0755 "$TMP_EXTRACT/usr/bin/FlyCapture2Test_C" /usr/local/bin/FlyCapture2Test_C
|
||||||
|
# Example source tree (build your own apps against the SDK).
|
||||||
|
rm -rf /usr/src/flycapture
|
||||||
|
cp -a "$TMP_EXTRACT/usr/src/flycapture" /usr/src/flycapture
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "4/7 Building the fc2view live viewer"
|
||||||
|
# Native OpenCV-based replacement for the vendor GUI (which needs dead GTK2
|
||||||
|
# libs). Best-effort: a failure here does not abort the core install.
|
||||||
|
if g++ "$SCRIPT_DIR/fc2view.cpp" \
|
||||||
|
-I/usr/include/flycapture $(pkg-config --cflags opencv4) \
|
||||||
|
$(pkg-config --libs opencv4) -lflycapture \
|
||||||
|
-o /usr/local/bin/fc2view; then
|
||||||
|
echo "Installed /usr/local/bin/fc2view"
|
||||||
|
else
|
||||||
|
warn "fc2view build failed; the CLI tools still work. Build it by hand later:"
|
||||||
|
warn " g++ fc2view.cpp -I/usr/include/flycapture \$(pkg-config --cflags --libs opencv4) -lflycapture -o fc2view"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "5/7 Configuring device permissions (udev rule + '$GROUP' group)"
|
||||||
|
groupadd -f "$GROUP"
|
||||||
|
usermod -aG "$GROUP" "$TARGET_USER"
|
||||||
|
# Point Grey / FLIR USB product IDs are 0x2000-0x2005 and 0x3xxx. Grant the
|
||||||
|
# group read/write on matching USB nodes. (Trimmed from FLIR's flycap2-conf;
|
||||||
|
# we drop the blanket "all USB devices" rule it shipped.)
|
||||||
|
{
|
||||||
|
for pid in 2000 2001 2002 2003 2004 2005 \
|
||||||
|
3000 3001 3004 3005 3006 3007 3008 300A 300B \
|
||||||
|
3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3300; do
|
||||||
|
echo "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1e10\", ATTRS{idProduct}==\"${pid}\", MODE=\"0664\", GROUP=\"${GROUP}\""
|
||||||
|
done
|
||||||
|
} > "$UDEV_RULES"
|
||||||
|
udevadm control --reload-rules
|
||||||
|
udevadm trigger
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "6/7 Raising the USBFS buffer limit to ${USBFS_MB} MB"
|
||||||
|
# Default is 16 MB, too small for camera frames -> grab failures / dropped
|
||||||
|
# images. Apply now for this boot, and persist via the kernel command line.
|
||||||
|
echo "$USBFS_MB" > /sys/module/usbcore/parameters/usbfs_memory_mb || \
|
||||||
|
warn "Could not set usbfs_memory_mb live; a reboot will apply the persistent setting."
|
||||||
|
|
||||||
|
if [ -f "$GRUB_FILE" ]; then
|
||||||
|
if grep -q "usbcore.usbfs_memory_mb" "$GRUB_FILE"; then
|
||||||
|
sed -i -E "s/usbcore\.usbfs_memory_mb=[0-9]+/usbcore.usbfs_memory_mb=${USBFS_MB}/" "$GRUB_FILE"
|
||||||
|
else
|
||||||
|
# Append inside the existing GRUB_CMDLINE_LINUX_DEFAULT="..." quotes.
|
||||||
|
sed -i -E "s/^(GRUB_CMDLINE_LINUX_DEFAULT=\")(.*)\"/\1\2 usbcore.usbfs_memory_mb=${USBFS_MB}\"/" "$GRUB_FILE"
|
||||||
|
fi
|
||||||
|
update-grub
|
||||||
|
else
|
||||||
|
warn "$GRUB_FILE not found; skipped persistent USBFS setting. Set usbcore.usbfs_memory_mb=${USBFS_MB} on your bootloader manually."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
log "7/7 Done"
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
FlyCapture2 core SDK installed.
|
||||||
|
|
||||||
|
Live viewer : fc2view (streams the camera; 's' saves a snapshot)
|
||||||
|
Test tool : FlyCapture2Test (lists cameras and grabs frames)
|
||||||
|
Headers : /usr/include/flycapture
|
||||||
|
Examples : /usr/src/flycapture/src
|
||||||
|
|
||||||
|
Two things need a fresh login/boot to take effect:
|
||||||
|
* group '$GROUP' membership for '$TARGET_USER' -> log out and back in
|
||||||
|
* the persistent USBFS limit -> applied live now, made
|
||||||
|
permanent on next reboot
|
||||||
|
|
||||||
|
Quick check (after re-login), with the camera plugged in:
|
||||||
|
FlyCapture2Test # confirms detection + grabs frames
|
||||||
|
fc2view # live window
|
||||||
|
|
||||||
|
EOF
|
||||||
+197
@@ -0,0 +1,197 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// Copyright (c) 2001-2018 FLIR Systems, Inc. All Rights Reserved.
|
||||||
|
//
|
||||||
|
// This software is the confidential and proprietary information of FLIR
|
||||||
|
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
|
||||||
|
// shall not disclose such Confidential Information and shall use it only in
|
||||||
|
// accordance with the terms of the license agreement you entered into
|
||||||
|
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
|
||||||
|
//
|
||||||
|
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
|
||||||
|
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
|
||||||
|
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
|
||||||
|
// THIS SOFTWARE OR ITS DERIVATIVES.
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
==
|
||||||
|
== README
|
||||||
|
==
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
TABLE OF CONTENTS
|
||||||
|
===============================================================================
|
||||||
|
1. DEPENDENCIES
|
||||||
|
1.1. DEPENDENCY INSTALLATION
|
||||||
|
2. USB RELATED NOTES
|
||||||
|
3. FLYCAPTURE2 INSTALLATION
|
||||||
|
4. FLYCAPTURE2 REMOVAL
|
||||||
|
5. RUNNING PREBUILT UTILITIES
|
||||||
|
5.1. FLYCAP2
|
||||||
|
5.2. UPDATORGUI2
|
||||||
|
5.3. UPDATORCLI2
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
1. DEPENDENCIES
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
To install FlyCapture2 on linux you will need to have a few prerequisite
|
||||||
|
libraries installed. Below is a list of libs that flycapture2 depends on.
|
||||||
|
|
||||||
|
Required:
|
||||||
|
1) libraw1394-11
|
||||||
|
2) libavcodec57
|
||||||
|
3) libavformat57
|
||||||
|
4) libswscale4
|
||||||
|
5) libswresample2
|
||||||
|
6) libavutil55
|
||||||
|
7) libgtkmm-2.4-dev
|
||||||
|
8) libglademm-2.4-dev
|
||||||
|
9) libgtkglextmm-x11-1.2-dev
|
||||||
|
10) libusb-1.0-0 (version 1.0.17 or greater recommended)
|
||||||
|
|
||||||
|
Strongly recommended:
|
||||||
|
Ubuntu 16.04 LTS: Linux kernel version 4.4.19-35 or later.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
1.1. DEPENDENCY INSTALLATION
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
To install these dependencies, the most straightforward approach is to use your
|
||||||
|
system's built-in package management utility. In the case of Ubuntu, the utility
|
||||||
|
is named "apt". Below is a set of one-line commands that can be used to install
|
||||||
|
all the required dependencies for various releases of Ubuntu Long Term Support
|
||||||
|
(LTS).
|
||||||
|
|
||||||
|
Ubuntu 18.04:
|
||||||
|
user$: sudo apt-get install libraw1394-11 libavcodec57 libavformat57 \
|
||||||
|
libswscale4 libswresample2 libavutil55 libgtkmm-2.4-1v5 \
|
||||||
|
libglademm-2.4-1v5 libgtkglextmm-x11-1.2-0v5 libgtkmm-2.4-dev \
|
||||||
|
libglademm-2.4-dev libgtkglextmm-x11-1.2-dev libusb-1.0-0
|
||||||
|
|
||||||
|
Ubuntu 16.04:
|
||||||
|
user$: sudo apt-get install libraw1394-11 libavcodec-ffmpeg56 \
|
||||||
|
libavformat-ffmpeg56 libswscale-ffmpeg3 libswresample-ffmpeg1 \
|
||||||
|
libavutil-ffmpeg54 libgtkmm-2.4-dev libglademm-2.4-dev \
|
||||||
|
libgtkglextmm-x11-1.2-dev libusb-1.0-0
|
||||||
|
|
||||||
|
After installing raw1394 you may need to add the raw1394 module to be loaded on
|
||||||
|
start. To do this just add "raw1394" to the /etc/modules file.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
2. USB RELATED NOTES
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
On Linux systems, image size is restricted to 2MiB or less by default. To
|
||||||
|
increase this limit so that you can make use of your imaging hardware's full
|
||||||
|
capabilities, you will need to make a minor change to your system. Full
|
||||||
|
instructions on making this change can be found at
|
||||||
|
<https://www.ptgrey.com/tan/10685#ConfiguringUSBFS>.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
3. FLYCAPTURE2 INSTALLATION
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
Once all the Dependencies are installed, just install the flycapture deb files.
|
||||||
|
There are ten different packages that need to be installed.
|
||||||
|
|
||||||
|
The flycapture packages are:
|
||||||
|
- libflycapture-<version>_<platform>.deb
|
||||||
|
- libflycapture-<version>_<platform>-dev.deb
|
||||||
|
- libflycapturegui-<version>_<platform>.deb
|
||||||
|
- libflycapturegui-<version>_<platform>-dev.deb
|
||||||
|
- libflycapture-c-<version>_<platform>.deb
|
||||||
|
- libflycapture-c-<version>_<platform>-dev.deb
|
||||||
|
- libflycapturegui-c-<version>_<platform>.deb
|
||||||
|
- libflycapturegui-c-<version>_<platform>-dev.deb
|
||||||
|
- flycap-<version>_<platform>.deb
|
||||||
|
- flycapture-doc-<version>_<platform>.deb
|
||||||
|
|
||||||
|
The packages with a preceding 'lib' are all the shared objects and their
|
||||||
|
respective dev packages. The flycap package installs the capture application
|
||||||
|
which can be launched by typing 'flycap' in a terminal or through the
|
||||||
|
Applications menu. The flycapture-doc package contains our documentation in
|
||||||
|
pdf format.
|
||||||
|
|
||||||
|
To install these packages, we provide an easy to use install script. You can
|
||||||
|
run the script in the same directory that you have unpacked the software into.
|
||||||
|
The install script is called 'install_flycapture.sh'
|
||||||
|
|
||||||
|
code eg:
|
||||||
|
user$ sudo sh install_flycapture.sh
|
||||||
|
|
||||||
|
This script will install all the flycapture libraries, example code, example
|
||||||
|
apps and documentation. The flycapture install script will also ask you to
|
||||||
|
configure udev so that a user will be able to use the 1394 and usb devices. If
|
||||||
|
you choose to configure the 1394 and usb devices this script will change
|
||||||
|
permissions on the nodes to give this particular user full read and write
|
||||||
|
access to the device nodes. It will overwrite the default ubuntu permissions.
|
||||||
|
After running this script everything should be installed and set up for use.
|
||||||
|
|
||||||
|
Unfortunately restarting udev doesn't seem to set the permissions on the device
|
||||||
|
nodes immediately. You may need to restart the machine before the user can
|
||||||
|
access the device nodes.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
4. FLYCAPTURE2 REMOVAL
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
To remove flycapture2 just run the uninstall script that we provide. The
|
||||||
|
removal script will also remove the udev rules therefore restoring the original
|
||||||
|
ubuntu permissions on the device nodes.
|
||||||
|
|
||||||
|
code eg:
|
||||||
|
user$: sudo sh remove_flycapture.sh
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
5. RUNNING PREBUILT UTILITIES
|
||||||
|
===============================================================================
|
||||||
|
In addition to prebuilt examples (ie: FlyCapture2Test, CustomImageEx, etc),
|
||||||
|
along with the source code for these examples, FlyCapture2 SDK ships with a
|
||||||
|
a number of prebuilt tools for evaluating cameras (ie: FlyCap2), upgrading
|
||||||
|
firmware (ie: UpdatorGUI2, UpdatorCLI2), and so on. Since some of these tools
|
||||||
|
make use of libglademm, they require their corresponding <.glade> files to be
|
||||||
|
in the present working directory (ie: "PWD") when launched.
|
||||||
|
|
||||||
|
To make using these
|
||||||
|
tools more convenient, FlyCapture2 SDK ships with a few command-line scripts
|
||||||
|
used to automatically set the appropriate environment variables so these tools
|
||||||
|
can be run from any PWD via the command-line, or when launching the tools via
|
||||||
|
a custom icon/shortcut. To run the following tools, simply invoke their
|
||||||
|
"launcher" command via the command line, and you will not have to change the PWD
|
||||||
|
to "/usr/bin" or modify environment variables in order to launch them.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
5.1. FLYCAP2
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
FlyCap2: A graphical application for testing cameras and viewing live streaming
|
||||||
|
of image data from all supported FLIR cameras.
|
||||||
|
Location: /usr/bin/FlyCap2
|
||||||
|
Short Name: FlyCap2
|
||||||
|
Launcher: flycap
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
5.2. UPDATORGUI2
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
UpdatorGUI2: A graphical application for updating the firmware on FLIR cameras.
|
||||||
|
Location: /usr/bin/UpdatorGUI2
|
||||||
|
Short Name: UpdatorGUI2
|
||||||
|
Launcher: updatorgui
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
5.3. UPDATORCLI2
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
UpdatorCLI2: A command-line application for updating the firmware on FLIR
|
||||||
|
cameras so that updates can be run in batch mode, and so that an
|
||||||
|
XFree86/Xorg session does not need to be active.
|
||||||
|
Location: /usr/bin/UpdatorCLI2
|
||||||
|
Short Name: UpdatorCLI2
|
||||||
|
Launcher: n/a - Doesn't require a launcher script.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# uninstall.sh — reverse install.sh. Removes the FlyCapture2 core libraries,
|
||||||
|
# the CLI tools, the udev rule and the example source. Leaves the '$GROUP'
|
||||||
|
# group, the GRUB USBFS setting and the apt dependencies in place (harmless,
|
||||||
|
# and other things may rely on them); comments below show how to undo those.
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
UDEV_RULES="/etc/udev/rules.d/40-flir.rules"
|
||||||
|
|
||||||
|
[ "$(id -u)" -eq 0 ] || { echo "Run as root: sudo ./uninstall.sh" >&2; exit 1; }
|
||||||
|
|
||||||
|
echo "==> Removing FlyCapture2 packages"
|
||||||
|
dpkg -r libflycapture-c2-dev libflycapture-c2 libflycapture2-dev libflycapture2 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "==> Removing CLI tools, viewer and example source"
|
||||||
|
rm -f /usr/local/bin/FlyCapture2Test /usr/local/bin/FlyCapture2Test_C /usr/local/bin/fc2view
|
||||||
|
rm -rf /usr/src/flycapture
|
||||||
|
|
||||||
|
echo "==> Removing udev rule"
|
||||||
|
rm -f "$UDEV_RULES"
|
||||||
|
udevadm control --reload-rules && udevadm trigger
|
||||||
|
|
||||||
|
cat <<'EOF'
|
||||||
|
|
||||||
|
Done. Not removed (undo manually if you want to):
|
||||||
|
* group 'flirimaging' -> sudo groupdelete flirimaging
|
||||||
|
* USBFS kernel arg -> edit /etc/default/grub, remove
|
||||||
|
'usbcore.usbfs_memory_mb=1000', then
|
||||||
|
sudo update-grub
|
||||||
|
EOF
|
||||||
Reference in New Issue
Block a user