Using networks of GNSS receivers along with appropriate post-processing techniques, estimated maps of vertical TEC (integrated electron density) can be
derived.
Conversion between any/all of BGR, RGB, and GBR may be necessary when working with
Matplotlib pyplot.imshow(): M x N x 3 image, where last dimension is RGB.
OpenCV imshow(): M x N x 3 image, where last dimension is BGR
Scientific Cameras: some output M X N x 3 image, where last dimension is GBR
Note: as in any programming language, operations on memory-contiguous arrays are most efficient.
In particular, OpenCV in-place operations require a contiguous array from Python to avoid unexpected results.
The safest approach is to always make a copy of the array as in the examples below.
Use .copy() to avoid unexpected results if using OpenCV.
If just using Matplotlib, .copy() is not necessary–but performance (speed) may benefit from .copy().
BGR to RGB: OpenCV image to Matplotlib
rgb = bgr[...,::-1].copy()
RGB to BGR: Matplotlib image to OpenCV
bgr = rgb[...,::-1].copy()
RGB to GBR:
gbr = rgb[...,[2,0,1]].copy()
The axis order convention for Python images:
3-D: W x H x 3, where the last axis is color (e.g. RGB)
4-D: W x H x 3 x 1, where the last axis is typically an alpha channel
Non-standard language options and incomplete feature support are normal for compilers across virtually all programming languages from BASIC to Fortran and here C++.
Modern C++ features typically require using specific compiler flags to enable support.
Knowing what compiler flags to set can be confusing for those new to modern C++ features.
Setup of C++ compiler flags for modern C++ features is easily and automatically handled by
CMake.
C++ fstream allows writing files to disk.
Some operations need to manage directory slashes (Windows vs. POSIX).
C++
std::filesystem::path::preferred_separator
manages platform-agnostic path separators.
Akin to Python pathlib, use std::filesystem::path.
C++ filesystem works on almost all current C++ compilers.
Note: Winget
might be preferred for Windows packages.
Scoop
brings easy install like scoop install gcc of developer programs in the
package list
to Microsoft Windows.
Scoop works from a fresh Windows install, for example a
free Windows virtual machine image.
Install
Scoop,
then install Git and SSH via Scoop, so that Scoop can update its recipes:
scoop install git openssh
Commmon development tools:
gcc / gfortran: scoop install gcc
make / cmake: scoop install make cmake
clang / LLVM: scoop install clang
GNU Octave: scoop install octave
From time to time scoop update gcc or similar to update individual packages.
If you have problems playing back the .avi file, try omitting the -c:v ffv1 parameter.
Don’t go below a framerate of about 3 frames/second because some viewers won’t work (e.g. VLC).
FFmpeg file globbing does NOT work on Windows, even with FFMPEG 4.x.
The error on Windows is like:
Pattern type ‘glob’ was selected but globbing is not supported by this libavformat build
Matlab and GNU Octave are constantly adding new functionality.
However, legacy versions remain in use for years.
Overloading a built-in function in Matlab and Octave requires logic to account for Octave providing many functions as m-files rather than builtin as in Matlab.