Code a simulation of image compression , Programming Languages

Assignment Help:

Your task will be to code a simulation of image compression based on the approximate low rank structure of the set of image patches. You will write functions .code = my block compress(I, B, nz); .I = my block reconstruct(code, B,m,n);

The function my block compress takes as input an m×n image grayscale I, extracts all the distinct 8 × 8 blocks from the image using the matlab command im2col, and finds the representation of each block in the (64× 64) orthogonal basis B, and then discards all but the nz largest magnitude coefficients over all the blocks in the image. The output code is a nz × 3 array which gives the nz most valuable coefficients for reconstructing all the patches, and the locations. It should be structured as follows: each entry of the first column of the variable code contains a coefficient. Each entry in the second column specifies which block that coefficient belongs to. Each entry in the third column specifies which basis element the coefficient belongs to1.

The function my block reconstructs takes as input a coded array code, a 64 × 64 basis B, and output size parameters m and n. It outputs an m× n image I reconstructed from the coefficients in code; you may use the function col2im if you find it convenient.

For example, suppose I is a 24×24 image. We can write I in block form:
I =0@
I1 I4 I7
I2 I5 I8
I3 I6 I9
1A
,
where Ik is a 8×8 matrix for k 2 {1, 2, ..., 9}. Using im2col on I, we obtain
J = (J1 J2 J3 J4 J5 J6 J7 J8 J9) = im2col(I, [8 8], 'distinct'),


Related Discussions:- Code a simulation of image compression

Computer programming on human algorithm, 1.   You have been asked to write ...

1.   You have been asked to write a computer program that will figure out the total of an order when given the amount of the order ($200) and a sales tax rate of five percent.  I w

Java, How to run java program?

How to run java program?

Determine that the processes are iterative or recursive, Each of the follow...

Each of the following two procedures defines a method for adding two positive integers in  terms of the procedures inc, which increments its argument by 1, and dec, which decrement

.net class libraries in .net, .NET class libraries in .NET Whether you c...

.NET class libraries in .NET Whether you create value in C# or VB.NET, you are getting in touch with techniques in the same .NET category your local library. The same .NET str

Java, program take integer from user and print in alphabets

program take integer from user and print in alphabets

Design and implement program, Tamagochi were all the rage in the 90's as a ...

Tamagochi were all the rage in the 90's as a small toy that had limited functionality but modelled a pet. The "owner" could do the following • Feed the pet • Heal the pet

Object-oriented languages, Object-oriented languages Languages that sup...

Object-oriented languages Languages that support OOP features can be classified into the following two categories: 1.    Object-based programming languages, and 2.      O

Creates an object and prompt the user to enter the name, Design an object d...

Design an object definition named Pet, which should have the following fields: name: The name field holds the name of a Pet type: The type field holds the type of anima

Visual basic, Lennie McPherson, proprietor of Lennie''s Bail Bonds, needs t...

Lennie McPherson, proprietor of Lennie''s Bail Bonds, needs to calculate the amount due for setting the bail. Lennie requires something of value as collateral, and his fee is 10%

Operating systems, list of 10 operating systems with their hardware specifi...

list of 10 operating systems with their hardware specification and also list any 5 software associated with each operating system

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd