anchor.diff:  
   *5. MATLAB Layout as Shared Memory*
   
  -This approach is the same as (4) with the difference that the Java translation layer is bypassed entirely by using shared memory via link:https://mathworks.com/help/matlab/ref/memmapfile.html[memmapfile]. Shared memory is typically used for inter-process communication, but it can also be used within a single process. Running within the same process also simplifies synchronization since MATLAB can access Java locks.
  +The fifth approach is the same as the fourth with the difference that the Java translation layer is bypassed entirely by using shared memory via link:https://mathworks.com/help/matlab/ref/memmapfile.html[memmapfile]. Shared memory is typically used for inter-process communication, but it can also be used within a single process. Running within the same process also simplifies synchronization since MATLAB can access Java locks.
   
   [source,matlab]
   ----
  
positive.code: By default MATLAB image matrices convert to `byte[height][width][channels]` Java arrays. However, when converting back to MATLAB there are some additional problems:
  
  * `byte` gets converted to `int8` instead of `uint8`, resulting in an invalid image matrix
  * changing the type back to `uint8` gets somewhat messy because the `uint8(matrix)` cast would set all negative values to zero, and the alternative `typecast(matrix, 'uint8')` only works on vectors
  
  Thus, converting the data to a valid image matrix still required several operations.
  
  [source,matlab]
  ----
  
negative.code: 
  All benchmarks were run in MATLAB 2017b on an link:https://www.intel.com/content/www/us/en/products/boards-kits/nuc/kits/nuc6i7kyk.html[Intel NUC6I7KYK]. The performance was measured using MATLAB's link:https://mathworks.com/help/matlab/ref/timeit.html[timeit] function. The background color of each cell in the result tables represents a rough classification of the overhead on the main MATLAB thread.
  
  {set:cellbgcolor:white}
  
  [.text-center]
  .Color classification
  [width="50%",options="header",cols="^a,^a,^a"]
  |====================
  | Color |  Overhead | 30 Frames / Sec |
  Green |  <10% | <3.3 ms | 
  Yellow | <50% | <16.5 ms |
  Orange | <100% | <33.3 ms | 
  Red |  >100% | >33.3 ms  |
  |====================
  
  {set:cellbgcolor!}
  
  The two tables below show the results for converting color (RGB) images as well as grayscale images. All measurements are in milliseconds.
  
  