You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<spanid="arrayfire-image-module"></span><h1>arrayfire.image module<aclass="headerlink" href="#module-arrayfire.image" title="Permalink to this headline">¶</a></h1>
<p>Image processing functions.</p>
<dlclass="py function">
<dtid="arrayfire.image.anisotropic_diffusion">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">anisotropic_diffusion</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">image</span></em>, <emclass="sig-param"><spanclass="pre">time_step</span></em>, <emclass="sig-param"><spanclass="pre">conductance</span></em>, <emclass="sig-param"><spanclass="pre">iterations</span></em>, <emclass="sig-param"><spanclass="pre">flux_function_type=<FLUX.QUADRATIC:</span><spanclass="pre">1></span></em>, <emclass="sig-param"><spanclass="pre">diffusion_kind=<DIFFUSION.GRAD:</span><spanclass="pre">1></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#anisotropic_diffusion"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.anisotropic_diffusion" title="Permalink to this definition">¶</a></dt>
<li><p>A 2 D arrayfire array representing an image</p></li>
</ul>
</dd>
<dt><strong>threshold_type</strong><spanclass="classifier">optional: af.CANNY_THRESHOLD. default: af.CANNY_THRESHOLD.MANUAL.</span></dt><dd><p>Can be one of:
- af.CANNY_THRESHOLD.MANUAL
- af.CANNY_THRESHOLD.AUTO_OTSU</p>
</dd>
<dt><strong>low_threshold</strong><spanclass="classifier">required: float.</span></dt><dd><p>Specifies the % of maximum in gradient image if threshold_type is MANUAL.
Specifies the % of auto dervied high value if threshold_type is AUTO_OTSU.</p>
</dd>
<dt><strong>high_threshold</strong><spanclass="classifier">optional: float. default: None</span></dt><dd><p>Specifies the % of maximum in gradient image if threshold_type is MANUAL.
Ignored if threshold_type is AUTO_OTSU</p>
</dd>
<dt><strong>sobel_window</strong><spanclass="classifier">optional: int. default: 3</span></dt><dd><p>Specifies the size of sobel kernel when computing the gradient image.</p>
<li><p>A gaussian kernel of size (rows, cols)</p></li>
</ul>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.gradient">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">gradient</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#gradient"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.gradient" title="Permalink to this definition">¶</a></dt>
<dd><p>Find the horizontal and vertical gradients.</p>
<li><p>Containing the histogram of the image.</p></li>
</ul>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.hsv2rgb">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">hsv2rgb</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#hsv2rgb"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.hsv2rgb" title="Permalink to this definition">¶</a></dt>
<dt><strong>psf: af.Array</strong></dt><dd><p>The kernel(point spread function) known to have caused
the blur in the system.</p>
</dd>
<dt><strong>gamma: scalar.</strong></dt><dd><p>is a user defined regularization constant</p>
</dd>
<dt><strong>algo:</strong></dt><dd><p>takes enum value of type af.INVERSE_DECONV
indicating the inverse deconvolution algorithm to be used</p>
</dd>
</dl>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><dlclass="simple">
<dt>out: af.Array</dt><dd><p>sharp image estimate generated from the blurred input</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.is_image_io_available">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">is_image_io_available</span></code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#is_image_io_available"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.is_image_io_available" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to check if the arrayfire library was built with Image IO support.</p>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.iterativeDeconv">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">iterativeDeconv</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">image</span></em>, <emclass="sig-param"><spanclass="pre">psf</span></em>, <emclass="sig-param"><spanclass="pre">iterations</span></em>, <emclass="sig-param"><spanclass="pre">relax_factor</span></em>, <emclass="sig-param"><spanclass="pre">algo=<ITERATIVE_DECONV.DEFAULT:</span><spanclass="pre">0></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#iterativeDeconv"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.iterativeDeconv" title="Permalink to this definition">¶</a></dt>
<li><p>Specifies if the image is loaded as 1 channel (if False) or 3 channel image (if True).</p></li>
</ul>
</dd>
</dl>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><dlclass="simple">
<dt>image - af.Array</dt><dd><p>A 2 dimensional (1 channel) or 3 dimensional (3 channel) array containing the image.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.load_image_native">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">load_image_native</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">file_name</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#load_image_native"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.load_image_native" title="Permalink to this definition">¶</a></dt>
<dd><p>Load an image on the disk as an array in native format.</p>
<li><p>A 2 D arrayfire array representing an image, or</p></li>
<li><p>A multi dimensional array representing batch of images.</p></li>
</ul>
</dd>
<dt><strong>moment</strong><spanclass="classifier">optional: af.MOMENT. default: af.MOMENT.FIRST_ORDER.</span></dt><dd><p>Moment(s) to calculate. Can be one of:
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">rgb2hsv</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#rgb2hsv"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.rgb2hsv" title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">rgb2ycbcr</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">image</span></em>, <emclass="sig-param"><spanclass="pre">standard=<YCC_STD.BT_601:</span><spanclass="pre">601></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#rgb2ycbcr"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.rgb2ycbcr" title="Permalink to this definition">¶</a></dt>
<dd><p>RGB to YCbCr colorspace conversion.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><dlclass="simple">
<dt><strong>image</strong><spanclass="classifier">af.Array</span></dt><dd><p>A multi dimensional array containing an image or batch of images in RGB format.</p>
<li><p>Can be one of YCC_STD.BT_601, YCC_STD.BT_709, and YCC_STD.BT_2020.</p></li>
</ul>
</dd>
</dl>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><dlclass="simple">
<dt><strong>out</strong><spanclass="classifier">af.Array</span></dt><dd><p>A multi dimensional array containing an image or batch of images in YCbCr format</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dlclass="py function">
<dtid="arrayfire.image.rotate">
<codeclass="sig-prename descclassname"><spanclass="pre">arrayfire.image.</span></code><codeclass="sig-name descname"><spanclass="pre">rotate</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">image</span></em>, <emclass="sig-param"><spanclass="pre">theta</span></em>, <emclass="sig-param"><spanclass="pre">is_crop=True</span></em>, <emclass="sig-param"><spanclass="pre">method=<INTERP.NEAREST:</span><spanclass="pre">0></span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="_modules/arrayfire/image.html#rotate"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink" href="#arrayfire.image.rotate" title="Permalink to this definition">¶</a></dt>