<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.atalasoft.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rick Minerich's Development Wonderland : fp, research, ideas</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/tags/fp/research/ideas/default.aspx</link><description>Tags: fp, research, ideas</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Image Processing as Sets of Transformations</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx</link><pubDate>Tue, 28 Apr 2009 00:21:00 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:18366</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><comments>http://www.atalasoft.com/cs/blogs/rickm/comments/18366.aspx</comments><wfw:commentRss>http://www.atalasoft.com/cs/blogs/rickm/commentrss.aspx?PostID=18366</wfw:commentRss><wfw:comment>http://www.atalasoft.com/cs/blogs/rickm/rsscomments.aspx?PostID=18366</wfw:comment><description>&lt;p&gt;In the image processing world, like most computational problems, we often think our work is composed of only two basic ideas: representation and transformation.&amp;nbsp; Of course, one may have many layers of both representations of transformations and transformations of representations which can make things appear quite complex at times. &lt;/p&gt;  &lt;p&gt;However,&amp;nbsp; the problem is much more simple than it appears.&amp;nbsp; This is because a representation can be considered as a transformation from a zero or identity state.&amp;nbsp; Thus, in writing a symbolic language for image processing, we are left with only a single idea to consider:&amp;nbsp; transformations.&amp;nbsp; By composting layers of transformations we can apply image processing techniques in way which is not only bidirectional and platform agnostic but also comes along with a host of other benefits.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Let us consider a simplified example of processing an image:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1) We read in a file (representation) and use a codec (transformation) to convert it into a format understood by our API (representation).&lt;/p&gt;  &lt;p&gt;2) We then perform some type of algorithm on that data (transformation) which results in some type of output (representation).&lt;/p&gt;  &lt;p&gt;3) Finally, via another codec (transformation), another file is saved to disk (representation). &lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;In most cases there are a great number of intermediate representations.&amp;nbsp; Each is a full copy of the previous iteration with whatever changes have been so far applied.&amp;nbsp; Essentially, the same information is copied over and over again in memory.&amp;nbsp; We do allow for some kinds of in-place processing, however, this is bad as when the operation has been completed, the previous representation has been destroyed.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Instead, what if we batched up sets of transformations?&amp;nbsp; This could have many benefits:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1) The most obvious benefit is that of parallelization.&amp;nbsp; Even at the simplest level of functional composition, these transformations could be handed off to a cluster for asynchronous processing or saved for a later batch processing job.&lt;/p&gt;  &lt;p&gt;2) With an intermediate symbolic transformation language, processing algorithms could potentially be combined and reduced to produce a single transformation out of many.&amp;nbsp; This would significantly reduce the processing overhead as well as the number of intermediate memory representations.&lt;/p&gt;  &lt;p&gt;3) An intermediate symbolic language which encompassed both codec and processing may make it possible to push the processing transformation through the codec transformation and in so doing no longer need to have any intermediate memory representation.&amp;nbsp; This could provide significant memory and processing speed time benefit.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;4) The intermediate symbolic language could be saved into the files themselves thus removing the need for the codec to be present on the end machine.&amp;nbsp; Admittedly, the user would also need the image language interpreter. &lt;/p&gt;  &lt;p&gt;5) Instead of applying simple image processing algorithms to an image, the symbolic representation could be appended to the end of the file.&amp;nbsp; This would be quite similar to layers in practice.&amp;nbsp; In this way it would be possible to view the image at all stages of transformation. &lt;/p&gt;  &lt;p&gt;6) For large or proprietary transformations, the representation could be kept on the internet and either be downloaded or, in the case where the owner did not want to expose their algorithm, a flattened representation could be sent out and a processing delta could be sent back.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Conclusion &lt;/b&gt;&lt;br&gt;&lt;/p&gt;  &lt;p&gt;Of course, when I speak of data I don’t only mean the image itself.&amp;nbsp; This technique could also be applied to many classes of data or algorithm.&amp;nbsp; Most notably for us, image metadata.&lt;/p&gt;  &lt;p&gt;My initial goal is to build a basic codec representation along with some simple transformations.&amp;nbsp; Currently, I am researching bidirectional, reversible and declarative languages as examples.&amp;nbsp; With F# as a base language I believe it will be possible to build something portable to other ML variants. &lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;;subject=Image+Processing+as+Sets+of+Transformations" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;;title=Image+Processing+as+Sets+of+Transformations" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;title=Image+Processing+as+Sets+of+Transformations" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;;title=Image+Processing+as+Sets+of+Transformations" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx&amp;amp;;title=Image+Processing+as+Sets+of+Transformations&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/04/27/image-processing-as-sets-of-transformations.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.com/cs/aggbug.aspx?PostID=18366" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/programming/default.aspx">programming</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/simplicity/default.aspx">simplicity</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/ideas/default.aspx">ideas</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/.NET/default.aspx">.NET</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/languages/default.aspx">languages</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/haskell/default.aspx">haskell</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/research/default.aspx">research</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/abstract/default.aspx">abstract</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/fp/default.aspx">fp</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/image+processing/default.aspx">image processing</category></item></channel></rss>