<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab Computer Vision Module
 * Copyright (C) 2017 - Scilab Enterprises
 *
 -->
<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg"  xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab"
  xml:lang="fr" xml:id="imread">
  <info>
    <pubdate>$LastChangedDate$</pubdate>
  </info>
  <refnamediv>
    <refname>imread</refname>
    <refpurpose>Loads an image</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <title>Syntax</title>
    <synopsis>img = imread(filename[, flags])</synopsis>
  </refsynopsisdiv>
  <refsection>
    <title>Parameters</title>
    <variablelist>
      <varlistentry>
        <term>filename</term>
        <listitem>
          <para>Path of file to be loaded (<literal>string</literal>).</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>flags</term>
        <listitem>
          <para>Flag specifying the color type of the loaded image (<literal>int</literal>):</para>
          <itemizedlist>
            <member><literal>CV_LOAD_IMAGE_ANYDEPTH</literal>: return a 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.</member>
            <member><literal>CV_LOAD_IMAGE_COLOR</literal>: convert to a color image.</member>
            <member><literal>CV_LOAD_IMAGE_GRAYSCALE</literal>: convert to a grayscale image.</member>
          </itemizedlist>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>img</term>
        <listitem>
          <para>Loaded image (<link linkend="Mat">Mat</link>).</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>
  <refsection>
    <title>Description</title>
    <para><function>imread</function> loads an image from the specified file path and returns the <link linkend="Mat">Mat</link> object containing it.</para>
  </refsection>
  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
    scicv_Init();

    img = imread(getSampleImage("lena.jpg"));

    matplot(img);

    delete_Mat(img);
 ]]></programlisting>
 <programlisting role="example"><![CDATA[
    scicv_Init();

    img_gray = imread(getSampleImage("lena.jpg"), CV_LOAD_IMAGE_GRAYSCALE);

    matplot(img_gray);

    delete_Mat(img_gray);
 ]]></programlisting>
  </refsection>
  <refsection>
    <title>See also</title>
    <simplelist type="inline">
      <member><link linkend="imwrite">imwrite</link></member>
      <member><link linkend="Mat">Mat</link></member>
    </simplelist>
  </refsection>
</refentry>