Algorithms, Computer Engineering

Assignment Help:
Design an algorithm (using pseudocode) that takes in as an input, two 2-D int arrays that are assumed to be 2 black-and-white images: initialImage x, whose dimensions are IxJ, and finalImage y, whose dimensions are IxK. The algorithm will compare x to the y, row-by-row, as defined below. Your algorithm will employ a dynamic programming scheme to compare X to Y identifying the minimal difference between each row.

Because you are working with black-and-white images only, you should assume that each image is a 2-D int array consisting of 2 possible values: 0 or 1, where 0 represents black and 1 represents white. Thus, this 2-D grid of 0 and 1 values comprise a 2-D black-and-white image. Each row of this image is then simply a 1-D int array filled with either 0s or 1s. Therefore, you must define how you will measure the difference between the strings of 0s and 1s in each row.

Remember that you will do the comparison one row in the images at a time.

First, compare X1,* to Y1,*. (Here X1,* is the first row in image X and Y1,* is the first row in image Y ). Next, compare X2 to Y2... Each one of these comparisons will require the construction of a D (distance) matrix.

In the following example, the first row of X is X1,*, and the first row of Y is Y1,* = 00110.



Use the following recurrence relation to develop your pseudocode:



After the D matrix is completed, the minimum number in the bottom row is the minimal mismatch for this row. You will assign this value to the variable minVali. This number tells how different row X1,* is from row Y1,* . You will then repeat this comparison for all rows i and aggregate the difference when complete into variable totalDifference = Si minVali.

As a result, the algorithm will compare the total difference to a threshold value called thresh. If total value is above the threshold, the images are declared different, otherwise they are declared to be similar images. You can assume that the thresh variable is supplied as an input to your algorithm.

Part 1

Create a portfolio that includes all previous IPs.

Part 2a:

Design pseudocode for the image comparison algorithm discussed above, given input Images X, Y, and thresh. The output is a declaration: The images are similar, or the images are different.

Part 2b:

Discuss the optimality of the dynamic programming solution. Discuss the time complexity of this algorithm in terms of the size of the inputs X and Y.

Related Discussions:- Algorithms

Analysis of amdahls law, Q. Analysis of Amdahls law? The conclusions of...

Q. Analysis of Amdahls law? The conclusions of analysis of Amdahl's law are: 1) To optimize performance of parallel computers modified compilers should be developed that sho

Create a complete mp3 player, Write a GUI/MP3 program called MP3Random that...

Write a GUI/MP3 program called MP3Random that reads all MP3 les in a directory and plays them in random order. The GUI should have a little window with: 1. A button Next that s

Applications of generic framework for e-commerce executed, How are applicat...

How are applications of generic framework for e-commerce executed? To execute applications, this is essential to have Supporting Information and Organizational Infrastructure a

Fibre optics, #questifind core radius for single mode operation at 850nm in...

#questifind core radius for single mode operation at 850nm in SI fibre with n1=1.480 & n2=1.47 what is NAon..

Subscript and an index in a table definition, What is the difference betwee...

What is the difference between a subscript and an index in a table definition? Ans) A subscript is a working storage data definition item, typically a PIC (999) where a value mu

Write a program to event advertised, A museum has a collection of old poste...

A museum has a collection of old posters advertising events of various kinds (theatre, sport, fairs, lectures etc.). It wishes to keep a record of these, containing, for each poste

Commutativity of connectives, Commutativity of Connectives : In this y...

Commutativity of Connectives : In this you will be aware of the fact that some arithmetic operators that have a property which it doesn't matter that way around you give the o

What is the main use of structures, What is The main use of structures ...

What is The main use of structures The main use of structures is to lump together collections of disparate variable types, so they can conveniently be treated as a unit. For ex

Define the programmable logic devices (pld), Define the Programmable logic ...

Define the Programmable logic devices (PLD)? In the world of digital electronic systems there are three essential kinds of devices 1.memory, 2.microprocessors, and 3.logic. The

How a java program compiles, How a Java program compiles? First sou...

How a Java program compiles? First source file name should be extended with .java extension. For example Myprog.java Execute javac compiler. javac compiler creates

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