⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 464-467.html

📁 The primary purpose of this book is to explain various data-compression techniques using the C progr
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>The Data Compression Book-:Fractal Image Compression</TITLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><SCRIPT><!--function displayWindow(url, width, height) {        var Win = window.open(url,"displayWindow",'width=' + width +',height=' + height + ',resizable=1,scrollbars=yes');}//--></SCRIPT></HEAD><BODY  BGCOLOR="#FFFFFF" VLINK="#DD0000" TEXT="#000000" LINK="#DD0000" ALINK="#FF0000"><TD WIDTH="540" VALIGN="TOP"><!--  <CENTER><TABLE><TR><TD><FORM METHOD="GET" ACTION="http://search.itknowledge.com/excite/cgi-bin/AT-foldocsearch.cgi"><INPUT NAME="search" SIZE="20" VALUE=""><BR><CENTER><INPUT NAME="searchButton" TYPE="submit" VALUE="Glossary Search"></CENTER><INPUT NAME="source" TYPE="hidden" VALUE="local" CHECKED> <INPUT NAME="bltext" TYPE="hidden" VALUE="Back to Search"><INPUT NAME="sp" TYPE="hidden" VALUE="sp"></FORM></TD><TD><IMG SRC="http://www.itknowledge.com/images/dotclear.gif" WIDTH="15"   HEIGHT="1"></TD><TD><FORM METHOD="POST" ACTION="http://search.itknowledge.com/excite/cgi-bin/AT-subscriptionsearch.cgi"><INPUT NAME="search" SIZE="20" VALUE=""><BR><CENTER><INPUT NAME="searchButton" TYPE="submit" VALUE="  Book Search  "></CENTER><INPUT NAME="source" TYPE="hidden" VALUE="local" CHECKED> <INPUT NAME="backlink" TYPE="hidden" VALUE="http://search.itknowledge.com:80/excite/AT-subscriptionquery.html"><INPUT NAME="bltext" TYPE="hidden" VALUE="Back to Search"><INPUT NAME="sp" TYPE="hidden" VALUE="sp"></FORM></TD></TR></TABLE></CENTER> --><!-- ISBN=1558514341//--><!-- TITLE=The Data Compression Book-//--><!-- AUTHOR=Mark Nelson//--><!-- PUBLISHER=IDG Books Worldwide, Inc.//--><!-- IMPRINT=M & T Books//--><!-- CHAPTER=13//--><!-- PAGES=464-467//--><!-- UNASSIGNED1//--><!-- UNASSIGNED2//--><CENTER><TABLE BORDER><TR><TD><A HREF="461-464.html">Previous</A></TD><TD><A HREF="../ewtoc.html">Table of Contents</A></TD><TD><A HREF="467-471.html">Next</A></TD></TR></TABLE></CENTER><P><BR></P><P>The compressor first partitions the input image into a set of non-overlapping ranges. The ranges are generally squares or rectangles, but good results can also be obtained with other shapes such as triangles. For each range, the compressor looks for a part of the input image called a domain, which is similar to the range. The domain plays the role of the pixel pattern in Vector Quantization, but here it must be larger than the range to ensure that the mapping from the domain to the range is contractive in the spatial dimensions.</P><BLOCKQUOTE><P><FONT SIZE="-1"><HR><B>Note:&nbsp;&nbsp;</B>Barnsley has reversed the meanings of range and domain, but we prefer keeping the established terminology: a transformation maps <I>from</I> a domain <I>to</I> a range.<HR></FONT></BLOCKQUOTE><P>In general, the compressor looks for domains that are twice as large as the range, but other ratios are possible. As opposed to ranges, domains may overlap.</P><P>The test file LISAW.GS is shown in Figure 13.1. The same file compressed with fractal compression at a compression ratio of 96% is shown in Figure 13.2.</P><P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/13-01.jpg',320,200)"><IMG SRC="images/13-01t.jpg"></A><BR><A HREF="javascript:displayWindow('images/13-01.jpg',320,200)"><FONT COLOR="#000077"><B>Figure 13.1</B></FONT></A>&nbsp;&nbsp;The original LISAW.GS (64000 bytes).</P><P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/13-02.jpg',320,200)"><IMG SRC="images/13-02t.jpg"></A><BR><A HREF="javascript:displayWindow('images/13-02.jpg',320,200)"><FONT COLOR="#000077"><B>Figure 13.2</B></FONT></A>&nbsp;&nbsp;LISAW with fractal compression (2849 bytes).</P><P>In Figure 13.2, two ranges and the two corresponding domains selected by the compression algorithm have been highlighted. The algorithm has found similarity between two unrelated portions of the image: a range below the eye and a domain, twice as large, on the forehead. The compressor has also found self-similarity within one domain, in the chin. In the latter case, the range and the domain overlap. This kind of self-similarity is quite frequent in real-world images, and fractal compression takes advantage of this.</P><P>To assess the similarity between a domain D and a range R, the compressor finds the best possible mapping w from the domain to the range, so that the image w(D) is as close as possible to the image R. As we have seen previously, affine transformations are convenient for this purpose, but non-linear transformations could also be used as long as they are contractive. Two-dimensional transformations were used for black and white images. Three dimensions are needed for grey scale images: two for the spatial components and one for the luminance component. An affine map is then composed of a geometric part which maps the domain into the range, and of a luminance part which changes the pixel intensity values.</P><P>More precisely, a point (x, y) with luminance z belonging to domain D<SUB>i</SUB> is mapped into:</P><P ALIGN="CENTER"><IMG SRC="images/13-02d.jpg"></P><P>The constants a<SUB>i,j</SUB> and d<SUB>i,j</SUB> specify the geometric part, the constants c<SUB>i</SUB> and b<SUB>i</SUB> specify the luminance part. c<SUB>i</SUB> represents a contrast factor, which must be smaller than one to make sure that the mapping is contractive in the luminance dimension. b<SUB>i</SUB> represents a brightness offset applied after the contrast has been reduced.</P><P>In practice, the compressor does not have to determine explicitly the constants a<SUB>i,j</SUB>  and d<SUB>i,j</SUB>  for each domain. They are implicitly defined by the relative size, orientation and position of the domain with respect to the range. In particular, if the compressor only looks for domains that are exactly twice as large as the range, the scaling factor which would normally be derived from the a<SUB>i,j</SUB> values is already imposed and is equal to 0.5. Similarly, if domains and ranges are restricted to be squares, there are only 8 possible orientations of the domain relative to the square: 4 rotations and 4 symmetries. Thus 3 bits are sufficient to encode this orientation. Finally, the translation constants d<SUB>i,j</SUB> are determined by the position of the top left corner of the domain.</P><P>The simplifications described above may seem too drastic, but they are actually necessary to reduce the complexity of the &#147;inverse problem&#148; to manageable proportions. In theory, ranges and domains can have potato shapes instead of a square shape, the contractive mappings can be non linear instead of being affine maps, etc... However the total search space would become much too large and as a result the compression would be too slow for practical use. But even with simple affine maps, finding the optimal domain for a given range can still be an expensive operation.</P><P>For a given range R, the compressor must examine a number of possible domains. For each such domain D, the compressor must find the optimal affine map from D to R. The best one is the map w which minimizes the distance between the image R and the image w(D), where the distance is taken in the luminance dimension, not the spatial dimensions.</P><P>Such a distance can be defined in various ways, but to simplify the computations it is convenient to use the Root Mean Square (RMS) metric (the program GSDIFF.C given in the previous chapter computes such a distance). For a given range and and a given domain, the RMS distance depends only on the contrast factor c<SUB>i</SUB> and the brightness offset b<SUB>i</SUB> The distance is minimum when the partial derivatives with respect to these two variables are both zero. c<SUB>i</SUB> and b<SUB>i</SUB> can thus be obtained by solving two simple linear equations, as we will see later in our sample fractal compression program.</P><P>Once the RMS distances between the range and all selected domains have been determined, the compressor chooses the domain with the smallest distance, encodes the corresponding affine map, and goes on working on the next range.</P><P><BR></P><CENTER><TABLE BORDER><TR><TD><A HREF="461-464.html">Previous</A></TD><TD><A HREF="../ewtoc.html">Table of Contents</A></TD><TD><A HREF="467-471.html">Next</A></TD></TR></TABLE></CENTER></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -