1 2 3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5<html xmlns="http://www.w3.org/1999/xhtml"> 6 <head> 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 8 9 <title>Basics - Boost.GIL documentation</title> 10 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> 11 <link rel="stylesheet" href="../_static/style.css" type="text/css" /> 12 <script type="text/javascript"> 13 var DOCUMENTATION_OPTIONS = { 14 URL_ROOT: '../', 15 VERSION: '', 16 COLLAPSE_MODINDEX: false, 17 FILE_SUFFIX: '.html' 18 }; 19 </script> 20 <script type="text/javascript" src="../_static/jquery.js"></script> 21 <script type="text/javascript" src="../_static/underscore.js"></script> 22 <script type="text/javascript" src="../_static/doctools.js"></script> 23 <link rel="index" title="Index" href="../genindex.html" /> 24 <link rel="search" title="Search" href="../search.html" /> 25 <link rel="top" title="Boost.GIL documentation" href="../index.html" /> 26 <link rel="up" title="Design Guide" href="index.html" /> 27 <link rel="next" title="Concepts" href="concepts.html" /> 28 <link rel="prev" title="Design Guide" href="index.html" /> 29 </head> 30 <body> 31 <div class="header"> 32 <table border="0" cellpadding="7" cellspacing="0" width="100%" summary= 33 "header"> 34 <tr> 35 <td valign="top" width="300"> 36 <h3><a href="../index.html"><img 37 alt="C++ Boost" src="../_static/gil.png" border="0"></a></h3> 38 </td> 39 40 <td > 41 <h1 align="center"><a href="../index.html"></a></h1> 42 </td> 43 <td> 44 <div id="searchbox" style="display: none"> 45 <form class="search" action="../search.html" method="get"> 46 <input type="text" name="q" size="18" /> 47 <input type="submit" value="Search" /> 48 <input type="hidden" name="check_keywords" value="yes" /> 49 <input type="hidden" name="area" value="default" /> 50 </form> 51 </div> 52 <script type="text/javascript">$('#searchbox').show(0);</script> 53 </td> 54 </tr> 55 </table> 56 </div> 57 <hr/> 58 <div class="content"> 59 <div class="navbar" style="text-align:right;"> 60 61 62 <a class="prev" title="Design Guide" href="index.html"><img src="../_static/prev.png" alt="prev"/></a> 63 <a class="up" title="Design Guide" href="index.html"><img src="../_static/up.png" alt="up"/></a> 64 <a class="next" title="Concepts" href="concepts.html"><img src="../_static/next.png" alt="next"/></a> 65 66 </div> 67 68 <div class="section" id="basics"> 69<h1>Basics</h1> 70<p>Images are essential in any image processing, vision and video project, and 71yet the variability in image representations makes it difficult to write 72imaging algorithms that are both generic and efficient. In this section we 73will describe some of the challenges that we would like to address.</p> 74<p>In the following discussion an <em>image</em> is a 2D array of pixels. A <em>pixel</em> is a 75set of color channels that represents the color at a given point in an image. 76Each <em>channel</em> represents the value of a color component. There are two common 77memory structures for an image. <em>Interleaved</em> images are represented by 78grouping the pixels together in memory and interleaving all channels together, 79whereas <em>planar</em> images keep the channels in separate color planes. Here is a 804x3 RGB image in which the second pixel of the first row is marked in red, 81in interleaved form:</p> 82<img alt="../_images/interleaved.jpg" src="../_images/interleaved.jpg" /> 83<p>and in planar form:</p> 84<img alt="../_images/planar.jpg" src="../_images/planar.jpg" /> 85<p>Note also that rows may optionally be aligned resulting in a potential padding 86at the end of rows.</p> 87<p>The Generic Image Library (GIL) provides models for images that vary in:</p> 88<ul class="simple"> 89<li>Structure (planar vs. interleaved)</li> 90<li>Color space and presence of alpha (RGB, RGBA, CMYK, etc.)</li> 91<li>Channel depth (8-bit, 16-bit, etc.)</li> 92<li>Order of channels (RGB vs. BGR, etc.)</li> 93<li>Row alignment policy (no alignment, word-alignment, etc.)</li> 94</ul> 95<p>It also supports user-defined models of images, and images whose parameters 96are specified at run-time. GIL abstracts image representation from algorithms 97applied on images and allows us to write the algorithm once and have it work 98on any of the above image variations while generating code that is comparable 99in speed to that of hand-writing the algorithm for a specific image type.</p> 100<p>This document follows bottom-up design. Each section defines concepts that 101build on top of concepts defined in previous sections. It is recommended to 102read the sections in order.</p> 103</div> 104 105 106 <div class="navbar" style="text-align:right;"> 107 108 109 <a class="prev" title="Design Guide" href="index.html"><img src="../_static/prev.png" alt="prev"/></a> 110 <a class="up" title="Design Guide" href="index.html"><img src="../_static/up.png" alt="up"/></a> 111 <a class="next" title="Concepts" href="concepts.html"><img src="../_static/next.png" alt="next"/></a> 112 113 </div> 114 </div> 115 <div class="footer" role="contentinfo"> 116 Last updated on 2020-08-11 15:08:48. 117 Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.6. 118 </div> 119 </body> 120</html>