DOC PREVIEW
U of M PSY 5036W - Computational Vision

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Computational VisionU. Minn. Psy 5036Daniel KerstenLecture 11: Image CodingInitialize‡Read in Statistical Add-in packages:In[480]:=Off@General::"spell1"D;<< "BarCharts`"; << "Histograms`"; << "PieCharts`"SetOptions@ArrayPlot, ColorFunction Ø "GrayTones", DataReversed Ø True,Frame Ø False, AspectRatio Ø Automatic, Mesh Ø False,PixelConstrained Ø True, ImageSize Ø SmallD;OutlineLast timeFinal projectsImage operationsPoint non-linearities, and simple statisticsUsing function interpolation for image morphing, symbolic differentiation.Properties of the fourier transforms of images (in the online class tutorial: Fourier_neural_image.nb )E.g., if you haven't tried it yet, look at the relative importance of amplitude and phase spectra in object recognitionTodayNatural image statistics and efficient codingUnderstanding first-order statistics in terms of efficient coding of natural imagesEfficient coding: 1rst order statistics & point operationsEfficient coding: 1rst order statistics & point operationsIn 1981, Simon Laughlin published a paper in which he showed that the contrast response function of LMC interneurons ("large monopolar cells") of the fly's ommatidium had a sigmoidal non-linearity as shown below. This kind of non-linearity wasn't new, and is common, especially in sensory response functions, that it is a de facto standard point non-linearity in generic neural network models. But why the sigmoidal shape? The mechanistic explanation for this kind of sigmoidal shape was and has been that small signals tend to get suppressed (e.g. a "soft" threshold), and at the high end, signals get saturated because of biophysical limitations.Laughlin came up with a different kind of answer, based on a functional argument that went along the following lines: the fly lives in a visual world in which big contrasts (local intensity relative to a global mean) (negative or positive) are less common than contrasts near zero, so neurons should devote more of their resolving capacity to the middle contrasts, i.e. those near zero. This kind of argument is based on information theory. In this lecture, we'll develop some basic tools of information theory to understand his model and others like it.In image processing jargon, the fly's visual neuron is doing "histogram equalization". Let's see what that means.Caveat2 11.CodingEfficiency.nbCaveatIn the next two lectures we are going to study statistical regularities found in natural images. Efficient coding takes advantage of regularities to represent images with fewer bits. We'll illustrate these regularities with arbitrary images that haven't been photometrically calibrated. Depending on the kind of compression (e.g. "lossy"), images like jpeg images have statistical properties that can deviate from the original uncompressed image. There exist several carefully calibrated image data sets, such as the "van Hateren" database: http://hlab.phys.rug.nl/archive.html.Import image file‡Using Import[]As noted earlier, you can use "Get File Path" from the "Input" menu to paste in the directory name of a file, or to use as an argument for SetDirectory. You can use Import[ ] to read in image files of various formats.E.g. on my computer, granite = Import["PowerBookHD:Research:kersten-lab:courses:Psy5036:Lectures:11. Efficient coding:granite64x64.jpg"];Alternatively, you can use the following to open a dialog window to look for the image file you want. I'm going to read in: ColorAlpine256x256.jpgIn[483]:=graniteg = Import@Experimental`FileBrowse@FalseDDOut[483]=graniteg is of type Ü Graphics Ü. To manipulate pixel values, we need to pull out the first element [[1,1]], which is the image matrix of pixel values that we want, and then average the RGB channels (using arbritrary weights) to produce a grayscale image we'll call granite.11.CodingEfficiency.nb 3graniteg is of type Ü Graphics Ü. To manipulate pixel values, we need to pull out the first element [[1,1]], which is the image matrix of pixel values that we want, and then average the RGB channels (using arbritrary weights) to produce a grayscale image we'll call granite.In[525]:=granite =RoundB255 * MapB0.3333 Ò@@1DD + 0.3333 Ò@@2DD + 0.333 Ò@@3DD255.&,N@granitegP1, 1TD, 82<FF;ArrayPlot@graniteDOut[526]=Let's calculate the max, mean and standard deviation. The standard deviation gives us a measure of contrastiness (see previous lecture's definitions of contrast)In[527]:=width = Dimensions@graniteD@@1DDMax@Flatten@graniteDDN@Mean@Flatten@graniteDDDN@StandardDeviation@Flatten@graniteDDDOut[527]=256Out[528]=255Out[529]=127.466Out[530]=46.85184 11.CodingEfficiency.nbHistogramLet's calculate some first-order statistics. First-order means that we are looking at the frequency of occurrence of pixel intensity values, i.e. the histogram. In the next lecture we'll will look at second-order statistics that describe how pixel intensities at one location are related to nearby ones. ‡Define histogram function that accepts an image with graylevels [lowlimt,highlimit], and outputs a histogram normalized to 1:In[531]:=histogram@image_, binsize_, lowlimit_, highlimit_D := Module@8histx<,histx = BinCounts@Flatten@imageD, 8lowlimit, highlimit, binsize<D;Return@N@histx êPlus üü histxDD;D;The histogram gives us an estimate of pi, the probability of the ith intensity, e.g. the probability of a pixel's value being say graylevel 103.In[532]:=histograniteimage = histogram@granite, 1, 0, 255D;ListPlot@histograniteimage, PlotStyle Ø [email protected][533]=501001502002500.0020.0040.0060.0080.0100.012Recall that can also use:11.CodingEfficiency.nb 5In[534]:=Histogram@Flatten@graniteD, ImageSize Ø SmallDOut[534]=50100150200250200400600800What is the frequency of occurrence of graylevel 103?EntropyEntropy provides a scalar measure of the degree of disorder in an image. "Disorder" isn't necessarily bad because it is intuitively related to the degree of novelty or surprise in a pattern. We want a measure of information that reflects degree of surprise in a formal objective sense. A highly ordered or regular pattern is by definition somewhat predictable--there is a "pattern there". You might be able to predict one part of the pattern from another. The pattern is said to have redundant information. A pattern can also be predictable because certain elements are just more likely to occur than others. For example, some gray values in the above histogram are more frequent than other gray values.A highly probable event


View Full Document

U of M PSY 5036W - Computational Vision

Download Computational Vision
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Computational Vision and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Computational Vision 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?