<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=OpenCV%2FImageProcessing%2FExtractChannel</id>
		<title>OpenCV/ImageProcessing/ExtractChannel - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=OpenCV%2FImageProcessing%2FExtractChannel"/>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=OpenCV/ImageProcessing/ExtractChannel&amp;action=history"/>
		<updated>2026-06-15T12:54:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://www.programmingexamples.net/w/index.php?title=OpenCV/ImageProcessing/ExtractChannel&amp;diff=5221&amp;oldid=prev</id>
		<title>Daviddoria: Created page with &quot;You will want to make sure that you include the imgproc, highgui, and core, libraries in your project settings.  ==ExtractChannel.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &quot;highgui.h...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=OpenCV/ImageProcessing/ExtractChannel&amp;diff=5221&amp;oldid=prev"/>
				<updated>2015-05-15T13:02:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;You will want to make sure that you include the imgproc, highgui, and core, libraries in your project settings.  ==ExtractChannel.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;quot;highgui.h...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;You will want to make sure that you include the imgproc, highgui, and core, libraries in your project settings.&lt;br /&gt;
&lt;br /&gt;
==ExtractChannel.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;highgui.h&amp;quot; // required for imread()&lt;br /&gt;
#include &amp;quot;cv.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
int main(int, char*argv[])&lt;br /&gt;
{&lt;br /&gt;
  cv::Mat image = cv::imread(argv[1], CV_LOAD_IMAGE_COLOR);&lt;br /&gt;
 &lt;br /&gt;
  if(image.empty())&lt;br /&gt;
  {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;Can't read the image&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return -1;&lt;br /&gt;
  }&lt;br /&gt;
  std::vector&amp;lt;cv::Mat&amp;gt; channels;&lt;br /&gt;
  cv::split(image, channels);&lt;br /&gt;
  cv::Mat r_channel = channels[0];&lt;br /&gt;
&lt;br /&gt;
  for(int i=0; i &amp;lt; r_channel.rows; i++)&lt;br /&gt;
  {&lt;br /&gt;
    for(int j=0; j &amp;lt; r_channel.cols; j++)&lt;br /&gt;
    {&lt;br /&gt;
      std::cout &amp;lt;&amp;lt; r_channel.at&amp;lt;uchar&amp;gt;(i,j) &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
&lt;br /&gt;
PROJECT(ExtractChannel)&lt;br /&gt;
&lt;br /&gt;
FIND_PACKAGE(OpenCV REQUIRED )&lt;br /&gt;
INCLUDE_DIRECTORIES( ${OPENCV_INCLUDE_DIR} )&lt;br /&gt;
&lt;br /&gt;
ADD_EXECUTABLE(ExtractChannel ExtractChannel.cpp)&lt;br /&gt;
TARGET_LINK_LIBRARIES(ExtractChannel ${OpenCV_LIBS})&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>