<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Steve on Image Processing</title>
	<atom:link href="http://blogs.mathworks.com/steve/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/steve</link>
	<description>Steve Eddins manages the Image &#38; Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.</description>
	<lastBuildDate>Wed, 22 May 2013 10:54:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>Comment on R2013a &#8211; Looking around in MATLAB by Jos Martin</title>
		<link>http://blogs.mathworks.com/steve/2013/05/15/r2013a-looking-around-in-matlab/#comment-26521</link>
		<dc:creator>Jos Martin</dc:creator>
		<pubDate>Wed, 22 May 2013 10:54:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=840#comment-26521</guid>
		<description><![CDATA[Another strong motivation for using the &#039;like&#039; syntax is to allow other numeric-like types to work with your code. Examples of these are gpuArray and distributed in the PCT toolbox. Imagine that you want to write an algorithm which you know can run on both the CPU and the GPU, and you want to write it just once. However you need to create some arrays that you will use during the algorithm (for example an array of ones). How would you do that today, such that no matter what your input array were, your array of ones was the same?

Prior to &#039;like&#039; you would have to understand both the underlying type of the array (gpuArray, fi, distributed, etc.) and how to create an array of that type. Now you can simply write


function out = myAlgorithm(in)

myOnes = ones(size(in), &#039;like&#039;, in);
callInternalFunction(in, myOnes);
end


In this way the code you write can be resilient to many different types of numeric input, and if we design some new numeric type in the future (which supports &#039;like&#039;) your code will work with that new type as well!]]></description>
		<content:encoded><![CDATA[<p>Another strong motivation for using the &#8216;like&#8217; syntax is to allow other numeric-like types to work with your code. Examples of these are gpuArray and distributed in the PCT toolbox. Imagine that you want to write an algorithm which you know can run on both the CPU and the GPU, and you want to write it just once. However you need to create some arrays that you will use during the algorithm (for example an array of ones). How would you do that today, such that no matter what your input array were, your array of ones was the same?</p>
<p>Prior to &#8216;like&#8217; you would have to understand both the underlying type of the array (gpuArray, fi, distributed, etc.) and how to create an array of that type. Now you can simply write</p>
<p>function out = myAlgorithm(in)</p>
<p>myOnes = ones(size(in), &#8216;like&#8217;, in);<br />
callInternalFunction(in, myOnes);<br />
end</p>
<p>In this way the code you write can be resilient to many different types of numeric input, and if we design some new numeric type in the future (which supports &#8216;like&#8217;) your code will work with that new type as well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on R2013a &#8211; Looking around in MATLAB by Brett Shoelson</title>
		<link>http://blogs.mathworks.com/steve/2013/05/15/r2013a-looking-around-in-matlab/#comment-26511</link>
		<dc:creator>Brett Shoelson</dc:creator>
		<pubDate>Mon, 20 May 2013 12:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=840#comment-26511</guid>
		<description><![CDATA[Sean,
I&#039;m not sure why assignment to B--implicitly using the default class (double)--is so much slower than in the second case above. But I&#039;d point out that if you instead _explicitly_ specified the class, using either:

B = zeros(900,900,class(A));

or

B = zeros(900,900,&#039;double&#039;);

you would see very different behavior. (On my computer, these syntaxes are both faster than &#039;like&#039;,&#039;A&#039;.)

Brett]]></description>
		<content:encoded><![CDATA[<p>Sean,<br />
I&#8217;m not sure why assignment to B&#8211;implicitly using the default class (double)&#8211;is so much slower than in the second case above. But I&#8217;d point out that if you instead _explicitly_ specified the class, using either:</p>
<p>B = zeros(900,900,class(A));</p>
<p>or</p>
<p>B = zeros(900,900,&#8217;double&#8217;);</p>
<p>you would see very different behavior. (On my computer, these syntaxes are both faster than &#8216;like&#8217;,'A&#8217;.)</p>
<p>Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on R2013a &#8211; Looking around in MATLAB by Sean de Wolski</title>
		<link>http://blogs.mathworks.com/steve/2013/05/15/r2013a-looking-around-in-matlab/#comment-26510</link>
		<dc:creator>Sean de Wolski</dc:creator>
		<pubDate>Mon, 20 May 2013 12:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=840#comment-26510</guid>
		<description><![CDATA[Hi Steve,

I was also very impressed with the speed increase with ZEROS by using &#039;like&#039;.


function zeroslike

[t1, t2] = deal(0);
A = magic(2000);
for ii = 1:100
    tic
    B = zeros(900,900);
    t1=t1+toc;
    tic
    C = zeros(900,900,&#039;like&#039;,A);
    t2=t2+toc;
end
    
t1./t2


On my system I&#039;m seeing &gt;100x speedup.]]></description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>I was also very impressed with the speed increase with ZEROS by using &#8216;like&#8217;.</p>
<p>function zeroslike</p>
<p>[t1, t2] = deal(0);<br />
A = magic(2000);<br />
for ii = 1:100<br />
    tic<br />
    B = zeros(900,900);<br />
    t1=t1+toc;<br />
    tic<br />
    C = zeros(900,900,&#8217;like&#8217;,A);<br />
    t2=t2+toc;<br />
end</p>
<p>t1./t2</p>
<p>On my system I&#8217;m seeing &gt;100x speedup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on R2013a &#8211; Looking around in MATLAB by Steve Eddins</title>
		<link>http://blogs.mathworks.com/steve/2013/05/15/r2013a-looking-around-in-matlab/#comment-26499</link>
		<dc:creator>Steve Eddins</dc:creator>
		<pubDate>Fri, 17 May 2013 16:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=840#comment-26499</guid>
		<description><![CDATA[Brett&#8212;Good observation. Another reason why Tom really likes this for working with fixed-point data is that the &#039;like&#039; syntax uses the fixed-point parameters (word length, mantissa bits, signed/unsigned) of the input prototype value.]]></description>
		<content:encoded><![CDATA[<p>Brett&mdash;Good observation. Another reason why Tom really likes this for working with fixed-point data is that the &#8216;like&#8217; syntax uses the fixed-point parameters (word length, mantissa bits, signed/unsigned) of the input prototype value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on R2013a &#8211; Looking around in MATLAB by Brett Shoelson</title>
		<link>http://blogs.mathworks.com/steve/2013/05/15/r2013a-looking-around-in-matlab/#comment-26498</link>
		<dc:creator>Brett Shoelson</dc:creator>
		<pubDate>Fri, 17 May 2013 16:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=840#comment-26498</guid>
		<description><![CDATA[Hi Steve,
The addition of the ability to typecast with &#039;like&#039; initially had me scratching my head, wondering what the fuss was about. After all, it&#039;s no easier to write 

&lt;pre class=&quot;code&quot;&gt;
B = zeros(100,100,&#039;like&#039;,rgb);
&lt;/pre&gt;

than it is to write

&lt;pre class=&quot;code&quot;&gt;
B = zeros(100,100,class(rgb));
&lt;/pre&gt;

But digging in to the doc a bit, I see that Tom&#039;s excitement probably stems more from the rest of what &#039;like&#039; does than just from its class conversion capacity. In particular, &#039;like&#039; reflects complexity (real vs complex) and sparsity, in addition to class. So if, for instance, I created a sparse, complex 3x3 matrix:

&lt;pre class=&quot;code&quot;&gt;
A = sparse(complex(rand(3)));
&lt;/pre&gt;

I can now readily create a matrix of zeros that is also sparse and complex. And, with an additional input, 3x3:

&lt;pre class=&quot;code&quot;&gt;
B = zeros(size(A),&#039;like&#039;,A);
&lt;/pre&gt;

In this case, both A and B are _type double_; sparse matrices are required to be of that class. But one could also use &#039;like&#039; to reflect &quot;complex + single,&quot; for example.

Cheers,
Brett]]></description>
		<content:encoded><![CDATA[<p>Hi Steve,<br />
The addition of the ability to typecast with &#8216;like&#8217; initially had me scratching my head, wondering what the fuss was about. After all, it&#8217;s no easier to write </p>
<pre class="code">
B = zeros(100,100,'like',rgb);
</pre>
<p>than it is to write</p>
<pre class="code">
B = zeros(100,100,class(rgb));
</pre>
<p>But digging in to the doc a bit, I see that Tom&#8217;s excitement probably stems more from the rest of what &#8216;like&#8217; does than just from its class conversion capacity. In particular, &#8216;like&#8217; reflects complexity (real vs complex) and sparsity, in addition to class. So if, for instance, I created a sparse, complex 3&#215;3 matrix:</p>
<pre class="code">
A = sparse(complex(rand(3)));
</pre>
<p>I can now readily create a matrix of zeros that is also sparse and complex. And, with an additional input, 3&#215;3:</p>
<pre class="code">
B = zeros(size(A),'like',A);
</pre>
<p>In this case, both A and B are _type double_; sparse matrices are required to be of that class. But one could also use &#8216;like&#8217; to reflect &#8220;complex + single,&#8221; for example.</p>
<p>Cheers,<br />
Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JPEG and PNG &#8211; lossy and lossless image compression by Steve Eddins</title>
		<link>http://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26485</link>
		<dc:creator>Steve Eddins</dc:creator>
		<pubDate>Tue, 14 May 2013 18:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=835#comment-26485</guid>
		<description><![CDATA[Neo&#8212;The imfinfo function returns some metadata information about a JPEG file, but it does not include the quantization table or Huffman code.]]></description>
		<content:encoded><![CDATA[<p>Neo&mdash;The imfinfo function returns some metadata information about a JPEG file, but it does not include the quantization table or Huffman code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JPEG and PNG &#8211; lossy and lossless image compression by Piyush</title>
		<link>http://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26401</link>
		<dc:creator>Piyush</dc:creator>
		<pubDate>Tue, 07 May 2013 18:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=835#comment-26401</guid>
		<description><![CDATA[Nice explanantion. Thanks]]></description>
		<content:encoded><![CDATA[<p>Nice explanantion. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JPEG and PNG &#8211; lossy and lossless image compression by Knut</title>
		<link>http://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26398</link>
		<dc:creator>Knut</dc:creator>
		<pubDate>Tue, 07 May 2013 08:04:33 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=835#comment-26398</guid>
		<description><![CDATA[While PNG in itself is lossless, I believe that it is possible to pre-process the raw input to PNG in such a manner as to reduce the final filesize.

An obvious approach would be to reduce the number of unique colors.

Perhaps this was what the user thought about?]]></description>
		<content:encoded><![CDATA[<p>While PNG in itself is lossless, I believe that it is possible to pre-process the raw input to PNG in such a manner as to reduce the final filesize.</p>
<p>An obvious approach would be to reduce the number of unique colors.</p>
<p>Perhaps this was what the user thought about?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JPEG and PNG &#8211; lossy and lossless image compression by Neo</title>
		<link>http://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26397</link>
		<dc:creator>Neo</dc:creator>
		<pubDate>Tue, 07 May 2013 04:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=835#comment-26397</guid>
		<description><![CDATA[Is there a method to extract jpeg header, or signature including quantization table and huffman code with matlab?]]></description>
		<content:encoded><![CDATA[<p>Is there a method to extract jpeg header, or signature including quantization table and huffman code with matlab?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JPEG and PNG &#8211; lossy and lossless image compression by jurgen</title>
		<link>http://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/#comment-26369</link>
		<dc:creator>jurgen</dc:creator>
		<pubDate>Fri, 03 May 2013 11:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=835#comment-26369</guid>
		<description><![CDATA[For PNG the proper name for such a parameter would not be &quot;quality&quot; but &quot;compression&quot; or something similar. Come to think of it, maybe the JPEG parameter should be called &quot;qualpression&quot; instead!]]></description>
		<content:encoded><![CDATA[<p>For PNG the proper name for such a parameter would not be &#8220;quality&#8221; but &#8220;compression&#8221; or something similar. Come to think of it, maybe the JPEG parameter should be called &#8220;qualpression&#8221; instead!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
