Anda di halaman 1dari 86

5/7/2015

ZOOME
Make a Photo Moasic
ZOOME | PHOTO MOASIC SOFTWARE

ZOOME | PHOTO MOASIC SOFTWARE

INTRODUCTION:
Looking for a way to create the perfect image for anniversaries,
mothers day, birthdays, team events, invitations, and weddings
or simply to say thanks? You just found it.

Or perhaps you want to memorize your friends with a photo


mosaic that is slowly assembling itself? Look! No further.

ZOOME | PHOTO MOASIC SOFTWARE

Table of Contents
Table of Contents............................................................................................................................................ 2
Chapter 1 ....................................................................................................................................................... 4
Chapter 2 ........................................................................................................................................................ 8
Chapter 3 ...................................................................................................................................................... 28
Chapter 4 ...................................................................................................................................................... 41
Chapter 5 ...................................................................................................................................................... 45
Chapter 6 ...................................................................................................................................................... 58
Chapter 7 ...................................................................................................................................................... 68

ZOOME | PHOTO MOASIC SOFTWARE

Chapter One
1-Overview
2- Motivation
3-Problem view
4- System Objectives
5-System Overview & Top Features
6- Document Organization
7- Summary

1-Overview

ZOOME | PHOTO MOASIC SOFTWARE

This chapter will present the reasons behind choosing this project, a
problem view and our suggested solution.
Also we will present system objective and main features inbrief , plus some
possible scenarios that can be applied by this system.

2- Motivation
The use of different technologies and social medias and the wide use of
photos , videos and media in the society is expanding and always need to be
updated and elevated to the next level.

3-Problem view
As per the expansion happening and the evolution of media , as well for the
excess use of social media as facebook , instagram and snapchat that mainly
use images as data , evolution of sales and marketing techniques and the
use of high resolution photos and filters , some new features , ideas ,
techniques and applications has to be added and developed .

4- System Objectives
4

ZOOME | PHOTO MOASIC SOFTWARE

Zoome is looking forward to making one high resolution photo that gathers
memories for families and friends , add a plus to the marketing campaigns
that relay on photos , change in the photo based social medias and , elevate
a side of entertainment world .

5-System Overview & Top Features


The System of ZooMe is a desktop application that makes a mosaic photo
for a base photo using tiles of different other chosen photos with different
sizes , where zooming in shows the tiles while zooming out shows the base
photo.

Top Features:

Creates photo mosaic of a good quality


Allows user to choose between different resolutions
Allow user to choose the dimensions of the tiles

6- Document Organization
Chapter 1:
5

ZOOME | PHOTO MOASIC SOFTWARE

Introduces Zoome and presents its objectives and features.


Chapter 2:
Provides a background about the technologies and techniques used in the
system, and present some of the similar related systems.
Chapter 3:
Presents the analysis phase of the system.
Chapter 4:
Presents the design phase of the system.
Chapter 5:
Focuses on implementation and technical parts issues of the system.
Chapter 6:
Describes a set of test case scenarios for the system.
Chapter 7:
Concludes the system and lists some future work.

7- Summary
In this chapter we have presented the motivation to choose this project and
we presented the proposed system overview and objective, also we have

ZOOME | PHOTO MOASIC SOFTWARE

presented the top features of the proposed system and some scenarios of
use that are predicted .

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Two
1-background about Technologies
2-Similar and Related Systems
3- Summary

1-background about Technologies


We Use In ZOOME
8

ZOOME | PHOTO MOASIC SOFTWARE

MOSAIC
Mosaic makes figure or image by attaching small pieces or tiles in various
colors on the basic draft . When mosaic images are viewed in short
distance, we can see small pieces and when they are viewed in long
distance, we can see one large form made by the pieces. Mosaic has been
mostly done by artists. In these days, such mosaic work is fixed as one of
unrealistic rendering techniques by researchers of computer graphics.
The images made by this technique enhance the interest and artistic
property of image. In the past, many materials should be collected for long
time for this mosaic. However, this problem is considerably solved by lowpriced digital device that is launched recently in wide variety. Because of
the appearance of software that can be easily used by general users, they are
much interested in mosaic management. Thus, unrealistic rendering
technique recently becomes the target of embodiment for many graphic
designers rather than technology of some researchers and mosaic in diverse
types are introduced.
Photo-mosaic refers to make one large photo by collecting many small
photos. Due to the recent development of digital imaging technology, these
photo-mosaic technologies are actively used in magazine, poster,
installation, music video and TV advertisement . Since the mosaic images
are mostly made by specialized graphic designer manually, it is difficult for
general users to make photo-mosaic images. Even specialized graphic
designer takes long time to make mosaic image, because work is done
manually

ZOOME | PHOTO MOASIC SOFTWARE

Mosaic is an image assembled from small pieces of some material. In a


photo mosaic these pieces are small images by itself.

10

ZOOME | PHOTO MOASIC SOFTWARE

When you look at a photo mosaic from a distance, you see one big image, but as
you move close, you understand that it's not just a single, large picture but rather a
collection of small, separate images.
The application has two modes hue adjustment and extended search, that will
produce different styles of output image. In addition, the application managed
memory such that it can deal with very large image sizes and hundreds of tile
images.

11

ZOOME | PHOTO MOASIC SOFTWARE

The Basic Process


Firstly , lets pick a master image.

We will compose this mosaic using 50 tile images.


12

ZOOME | PHOTO MOASIC SOFTWARE

The photo mosaic process can be summed up in two phases averaging and
tiling.

AVERAGING

1. Get the master image, the defined tile size, and the list of tile images.
2. Break the master image down into a grid of tiles of the defined size.
3. Calculate the average pixel color of each tile and record it.
4. For each tile image, calculate its average pixel color and record it.
After this phase, the application holds in memory a grid of tiles and their average
colors
On completion of this phase, you should have essentially two lists of averages, our
source tile averages, and our target master image averages .
Thus it then becomes a straightforward process of matching one set of averages to
another.

13

ZOOME | PHOTO MOASIC SOFTWARE

If one of our tile images has a similar average to one of our master image grid
tiles , then it would simply slot in that position.
In reality, however, it is not likely you will regularly find exact matches for these
averages, short of having literally millions of images with enough average colours
to cover your whole master image.
The approach I have taken is to supply two different tiling modes which will
produce different images based on all the images you are using and their
composition.

14

ZOOME | PHOTO MOASIC SOFTWARE

Tile searching

Iterate through the averages of each of our master image tiles.

15

ZOOME | PHOTO MOASIC SOFTWARE

For each master image tile, try and find a matching tile from our source tile
list, within a given threshold.

If the list is exhausted and no tile is found within the threshold, increase the
threshold and try again.
Keep repeating until a tile is found (the threshold will eventually widen to
include all the tiles in our list).
Put the source tile found into the master tile grid.

16

ZOOME | PHOTO MOASIC SOFTWARE

Hue Adjustment (BEST QUALITY)

-Iterate through the averages of each of our master image tiles.

17

ZOOME | PHOTO MOASIC SOFTWARE

-For each master image tile, pick a random tile from our list, making sure
that it hasnt been used in the last (X) tiles.

-Adjust the color of the tile so that it is closer in average to the master
image tile.
-Put the (adjusted) source tile into the master tile grid.

18

ZOOME | PHOTO MOASIC SOFTWARE

Memory Management
The application has been refined so that it shouldnt run out of memory for
conventionally sized images, which can still be quite large.
The specific exception will literally pause the loading while the .NET
garbage collector frees up memory after large IO operations.

Additionally, you do not have to resize your tile images , because the
application performs that automatically.
In order to minimize concurrent memory usage, the application will load,
resize, then re-save all the tile images to a defined cache folder;
these files are then re-loaded in their smaller tile size.

The other feature that optimizes performance is the use of the LockBitmap
class
The LockBitmap class allows for extremely fast manipulation of pixels
without using unsafe code.

19

ZOOME | PHOTO MOASIC SOFTWARE

Reference of PAPERS :
*Auto generation of Fractal Photographic Mosaic Images
-http://www.uoguelph.ca/~jbrown16/Fractal.pdf
*An artistic photographic collage on a mobile device
-http://link.springer.com.sci-hub.org/article/10.1007/s11042-014-2316-4
*A study on stackable mosaic generation for mobile devices (Dongwann
Kang Sanghyun Seo Seungtaek Ryoo Kyunghyun Yoon)
-http://link.springer.com.sci-hub.org/article/10.1007/s11042-012-1065-5
*Generation of Photo-Mosaic Images through Block Matching and Color
Adjustment (World Academy of Science, Engineering and Technology
International Journal of Computer, Control, Quantum and Information
Engineering Vol:8, No:3, 2014)
-http://waset.org/publications/9997759/generation-of-photo-mosaicimages-through-block-matching-and-color-adjustment
*Describe a process for creating an image mosaic (Image Mosaics | Adam
Finkelstein and Marisa Range)
-http://gfx.cs.princeton.edu/proj/mosaic/princeton-cs-tr-574-98.pdf
*Design a process for creating photo mosaics (Mati Krner - University of
Tartu, Institute of Computer Science)
-http://kodu.ut.ee/~b04866/poster.pdf

20

ZOOME | PHOTO MOASIC SOFTWARE

2-Similar and Related Systems


1.MOSAnICK

A play on the developers name, Nick Reed, MOSAnICk is a lightweight


utility for creating mosaic-based pictures. You simply provide a database of
images and a source image (the big picture) and then adjust the
composition controls. MOSAnICk also has a mirroring option which, when
selected, allows the program to flip your images if it detects they would
better fit the mosaic.

21

ZOOME | PHOTO MOASIC SOFTWARE

2. Andrea Mosaic

Another free photo mosaic software program that is named after its
developer, AndreaMosaic is packed full of customizable features. The
software allows you to set several parameters that will dictate the final
appearance of your photo mosaic, including the pixel width, number of tiles
per row, tile spacing and duplication, and color changes. You even have the
option to create photo mosaics from videos. Theres a 41-page MANUAL

22

ZOOME | PHOTO MOASIC SOFTWARE

that walks you through the features of the software and you can also
download a library of over 500 sample images you can use to create your
photo mosaic.
3. Mosaizer Pro

23

ZOOME | PHOTO MOASIC SOFTWARE

Like the other options listed here, this feature-rich photo mosaic software is
completely free to use. Unlike other mosaic creators which limit the user to
only creating photo mosaics, Mozaizer Pro boasts that it provides its users
with, almost unlimited freedom to create your photographic paintings
yourself, based on a library of bitmaps with an extensive range of
supporting creativity tools. We offer an exotic range of additional effects to
play with pattern, texture, shadow, color, shape and other effects that you
find in many bitmap editing software. Actually, we have combined the
basics of photo editing and painting with the possibilities of photo mosaic
creation.

4. Mosaically

24

ZOOME | PHOTO MOASIC SOFTWARE

Mosaically is extremely easy-to-use, and because its an online tool there is


no need to download or install any software to your computer. Mosaically
breaks the mosaic creation process into three simple steps:

-Upload the photo that you want made into the big picture.

25

ZOOME | PHOTO MOASIC SOFTWARE

-Upload all the smaller images you wish the mosaic to be made from you
can add up to 10,000 images and choose to upload photos from your
computer, the web, or Facebook.
-Generate your photo mosaic, adjusting the tile size and colorization to your
liking.

5. EasyMoza

EasyMoza is another online option that REQUIRES no downloads,


installations, or even the need to register its free and easy to use. Similar
to the other photo mosaic software options listed here, you simply upload

26

ZOOME | PHOTO MOASIC SOFTWARE

your main image and all the smaller images youd like your mosaic to be
made of. If youd prefer, EasyMoza offers a library of 100 flower photos and
100 animal photos you can choose from. After your photos are uploaded,
the online tool will automatically crop and resize your images into squares.
EasyMoza recommends you use a minimum of 250 photos for your mosaic.

Just a Small Piece of the Big Picture

This is just a taste of the numerous free photo mosaic software options
available. Have you ever created a photo mosaic? If so, what program did
you use? Leave a comment to let us know

3- Summary
In this chapter we have presented the Technologies that the system Include
with details of each of them , and the similar and Related Systems .

27

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Three
1-Overview
2-System Functional Requirements
3- Non-Functional Requirements
4-System Use-case Diagram
5-System Sequential Diagram
6-Summary

28

ZOOME | PHOTO MOASIC SOFTWARE

1-Overview
Systems analysis is the study of sets of interacting entities , including
computer systems analysis. This field is closely related to requirements
analysis or operations research. It is also "an explicit formal inquiry carried
out to help someone (referred to as the decision maker) identify a better
course of action and make a better decision than he might otherwise have
made."
In this chapter we will present ZOOME system analysis including
(Functional requirements, nonfunctional requirements, Use case diagrams
and Sequence diagrams).

2-System Functional Requirements


In software engineering, a functional requirement defines a function of a
software system or its component. A function is described as a set of inputs,
the behavior, and outputs. Functional requirements may be calculations,
technical details, data manipulation and processing and other specific
functionality that define what a system is supposed to accomplish.
Behavioral requirements describing all the cases where the system uses the
functional requirements are captured in use cases.

System Functions :
the main Function of our Application is to create Moasic.
FN1 : Upload Master Image.
Browse to upload the Master Image which you need to make mosaic on it ,
the master image will be converted into BitMap Image to ease our
operation

29

ZOOME | PHOTO MOASIC SOFTWARE

FN2: Upload Small Images for Tiles.


Browse to upload the small Images which you need to make mosaic by
them , small images will be converted into BitMap Images to ease our
operation and we resize them into the size of tiles that ll be given .
FN3 : Choose Folder to Save Tiles
choose a folder to save the tiles after resizing them . it lead us to save
memory and save time in our operation
FN4 : Choose the Height and Width of Tiles
choose the height and width of the tiles to control the Quality of our Moasic
.
FN5 : Choose One Model of two Models For Generating Moasic.
there are two models of our operation , default model is tiling searching
model
you can choose the another model to get a high resolution HUE Quality
Model
FN6 : Generate Moasic
Generating Moasic with the given information and loading for making it
FN7 : Get Result.
Save the Result in Your Application Files.

3- Non-Functional Requirements

30

ZOOME | PHOTO MOASIC SOFTWARE

In systems engineering and requirements engineering, a non-functional


Requirement is a requirement that specifies criteria that can be used to
judge the operation of a system, rather than specific behaviors. This should
be contrasted with functional requirements that define specific behavior or
Functions. The plan for implementing functional requirements is detailed
in the system design. The plan for implementing non-functional
requirements is detailed in the system architecture.
1-Performance
The application has been refined so that it shouldnt run out of memory for
conventionally sized images, which can still be quite large.
You will see this block in parts of the code:
while (!bLoaded)
{
try
{
... try opening some image files
bLoaded = true;
}
catch (OutOfMemoryException)
{
GC.WaitForPendingFinalizers();
}
}

31

ZOOME | PHOTO MOASIC SOFTWARE

The specific exception will literally pause the loading while the .NET garbage
collector frees up memory after large IO operations.
- Additionally , you do not have to resize your tile images because the application
performs that automatically.
In order to minimize concurrent memory usage , the application will load , resize,
then re-save all the tile images to a defined cache folder because these files are
then re-loaded in their smaller tile size.
- The other feature that optimizes performance is the use of the LockBitmap class.
We use a Class Library from Link:
http://www.codeproject.com/Tips/240428/Work-with-bitmap-faster-with-Csharp
The LockBitmap class allows for extremely fast manipulation of pixels without
using unsafe code .
2-Maintainability
- The maintainability is the ability to maintain system bugs And issues with
less loss that doesnt affect the services or stop it.
3-Portability
The system now works as a Desktop Application, it can run at any
Operating system Support .NET Framework
- Future Phase will work as a Mobile Application that run at IOS ,
ANDRIOD and WINDOWS PHONE
Future Plan at Chapter Seven
4-Usability:
ZOOME don't need any experience because it have Simple User Interface
(UI) to make ease of use the application To use by anyone have experience
or Not .

32

ZOOME | PHOTO MOASIC SOFTWARE

5-Quality:
We achieved very good resolution whin the two modes tile Searching and
Hue Quality .
such that this resolution didnt reached in many applications which
generate mosaic photos and heres an example of the following photos:

33

ZOOME | PHOTO MOASIC SOFTWARE

34

ZOOME | PHOTO MOASIC SOFTWARE

35

ZOOME | PHOTO MOASIC SOFTWARE

4-System Use-case Diagram


A use case analysis is the most common technique used to identify the
requirements of a system (normally associated with software/process
design) and the information used to both define processes used and classes
(which are a collection of actors and processes) which will be used both in
36

ZOOME | PHOTO MOASIC SOFTWARE

the use case diagram and the overall use case in the development or
redesign of a software system or program. The use case analysis is the
foundation upon which the system will be built.

5-System Sequential Diagram


37

ZOOME | PHOTO MOASIC SOFTWARE

A sequence diagram is a kind of interaction diagram that shows how


processes operate with one another and in what order. It is a construct of a
Message Sequence Chart. A sequence diagram shows object interactions
arranged in time sequence. It depicts the objects and classes involved in the
scenario and the sequence of messages exchanged between the objects
needed to carry out the functionality of the scenario. Sequence diagrams
are typically associated with use case realizations in the Logical View of the
system under development. Sequence diagrams are sometimes called event
diagrams, event scenarios, and timing diagrams.

6-Summary
On this chapter we talked about ZOOME system analysis including system
functional and nonfunctional requirements, Use case analysis and sequence
38

ZOOME | PHOTO MOASIC SOFTWARE

of system use (sequences diagrams).

39

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Four
System Design
1-Overview
2-Class Diagram
3- Sequence Diagram
4-Activity Diagram
5-Architecture Diagram
6-Summary

40

ZOOME | PHOTO MOASIC SOFTWARE

1-Overview
Systems design is the process of defining the architecture , components ,
modules, interfaces , and data for a system to satisfy specified requirements
. Systems design could be seen as the application of systems theory to
product development. There is some overlap with the disciplines of systems
analysis, systems architecture and systems engineering.

2-Class Diagram
In software engineering, a class diagram in the Unified Modeling Language
(UML) is a type of static structure diagram that describes the structure of a
system by showing the system's classes, their attributes, operations (or
methods), and the relationships among the classes.

41

ZOOME | PHOTO MOASIC SOFTWARE

3- Sequence Diagram
A Sequence Diagrams in Unified Modeling Language (UML) is a kind of
interaction diagram that shows how processes operate with one another
and in what order. It is a construct of a Message Sequence Chart. The
following figures show the detailed process sequence between the system
users and the proposed system.

42

ZOOME | PHOTO MOASIC SOFTWARE

4-Activity Diagram
An activity diagram is represented by shapes that are connected by arrows.
Arrows run from activity start to completion and represent the sequential
order of performed activities. Black circles represent an initial workflow
state. A circled black circle indicates an end state. Rounded rectangles
represent performed actions, which are described by text inside each
rectangle.

43

ZOOME | PHOTO MOASIC SOFTWARE

5-State Diagram
is one of the five UML diagrams used to model dynamic nature of a system.
They define differentstates of an object during its lifetime. And these states
are changed by events. So State chart diagrams are useful to model reactive
systems. Reactive systems can be defined as a system that responds to
44

ZOOME | PHOTO MOASIC SOFTWARE

external or internal events.

6-Summary
In this chapter, the design phase of the proposed Application .
45

ZOOME | PHOTO MOASIC SOFTWARE

First, the system components and interaction among them are described in
system architecture. The components interaction leads to define proposed
application processes and data. The proposed application processes are
described in Process Modeling section and data are described in Data
Modeling section. The processes modeling section describes the full
Sequence Diagrams of the system that describes the full interaction
between system and user. However, the class diagram describes the
proposed system processes as object oriented classes.

46

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Five
System Implementation

FN1 : GenerateMoasic();
This is the function that mainly creates the mosaic .
1)Load Master Photo
2)spilt masterPhoto into grids with a given Height and width
3)call another function to get average
47

ZOOME | PHOTO MOASIC SOFTWARE

4)Load the average of tiles after getting it


5)Destructor for the master photo
6)Call another Function to resize the tiles
7)Call another Function that getting the average of tiles
8)replace matched tiles with grids
9)Appling Hue Quality if user choose it

public static LockBitmap GenerateMosaic(String fMaster,


String[] fTiles, Size szTile, Label lblUpdate, ProgressBar
pgbUpdate, Boolean bAdjustHue, String fCache)
{
try
{
Boolean bLoaded = false;
Bitmap bMaster = null;
LockBitmap bOut = null;
/// Notification
lblUpdate.Text = String.Format("Loading
Master File {0}...", fMaster);
Application.DoEvents();
/// File Load Phase
while (!bLoaded)
{
try
{
bMaster = new Bitmap(fMaster);
bLoaded = true;
}
catch (OutOfMemoryException)
{
GC.WaitForPendingFinalizers();
48

ZOOME | PHOTO MOASIC SOFTWARE

}
}
/// Notification
lblUpdate.Text = String.Format("Averaging
Master Bitmap...");
Application.DoEvents();
/// Average Master Image Phase
int tX = bMaster.Width / szTile.Width;
int tY = bMaster.Height / szTile.Height;
Color[,] avgsMaster = new Color[tX, tY];
/// Notification
pgbUpdate.Maximum = tX * tY;
pgbUpdate.Value = 0;
for (int x = 0; x < tX; x++)
{
for (int y = 0; y < tY; y++)
{
avgsMaster[x, y] =
GetTileAverage(bMaster, x * szTile.Width, y * szTile.Height,
szTile.Width, szTile.Height);
pgbUpdate.Value++;
Application.DoEvents();
}
}
/// Output Load Phase
bLoaded = false;
while (!bLoaded)
{
try
{
bOut = new LockBitmap(bMaster);

49

ZOOME | PHOTO MOASIC SOFTWARE

bLoaded = true;
}
catch (OutOfMemoryException)
{
GC.WaitForPendingFinalizers();
}
}
/// Close Master Image Phase
bMaster.Dispose();
bMaster = null;
/// Notification
lblUpdate.Text = String.Format("Loading and
Resizing Tile Images...");
Application.DoEvents();
/// Tile Load And Resize Phase
List<Tile> bTiles = new List<Tile>();
String errorFiles = String.Empty;
Bitmap bTile;
/// Notification
pgbUpdate.Maximum = fTiles.Count();
pgbUpdate.Value = 0;
for (int i = 0; i < fTiles.Count(); i++)
{
try
{
bTile =
(Bitmap)Bitmap.FromFile(fTiles[i]);
bTile = ResizeBitmap(bTile, szTile);
bTile.Save(fCache + "\\tile" +
i.ToString() + ".bmp");
bTile.Dispose();

50

ZOOME | PHOTO MOASIC SOFTWARE

pgbUpdate.Value++;
Application.DoEvents();
}
catch (ArgumentException e)
{
errorFiles += String.Format("{0}:
{1}\r\n", fTiles[i], e.Message);
}
catch (OutOfMemoryException)
{
GC.WaitForPendingFinalizers();
i--;
}
}
if (errorFiles.Length > 0) { throw new
Exception(errorFiles); }
/// Notification
lblUpdate.Text = String.Format("Reloading
Tiles...");
pgbUpdate.Maximum = fTiles.Count();
pgbUpdate.Value = 0;
Application.DoEvents();
/// Tile Reload Phase
for (int i = 0; i < fTiles.Count(); i++)
{
bTile = new Bitmap(fCache + "\\tile" +
i.ToString() + ".bmp");
bTiles.Add(new Tile(bTile,
Color.Black));
pgbUpdate.Value++;
Application.DoEvents();
}

51

ZOOME | PHOTO MOASIC SOFTWARE

/// Notification
lblUpdate.Text = String.Format("Averaging
Tiles...");
pgbUpdate.Maximum = bTiles.Count();
pgbUpdate.Value = 0;
Application.DoEvents();
/// Average Tile Images Phase
foreach (Tile t in bTiles)
{
t.setColor(GetTileAverage(t.getBitmap(),
0, 0, t.getBitmap().Width, t.getBitmap().Height));
pgbUpdate.Value++;
Application.DoEvents();
}
/// Iterative Replacement Phase / Search
Phase
if (bTiles.Count > 0)
{
/// Notification
lblUpdate.Text = String.Format("Applying
Search Pattern...");
pgbUpdate.Maximum = tX * tY;
pgbUpdate.Value = 0;
Application.DoEvents();
Random r = new Random();
if (bAdjustHue)
{
// Adjust hue - get the first
(random) tile found and adjust its colours
// to suit the average
List<Tile> tileQueue = new
List<Tile>();
Tile tFound = null;

52

ZOOME | PHOTO MOASIC SOFTWARE

int maxQueueLength = Math.Min(1000,


Math.Max(0, bTiles.Count - 50));
for (int x = 0; x <
{
for (int y = 0;
{
int index =
// Check if

tX; x++)
y < tY; y++)
0;
it's the same as

the last (X)?


if (tileQueue.Count > 1)
{
while
(tileQueue.Contains(bTiles[index]))
{
index =
r.Next(bTiles.Count);
}
}
// Add to the 'queue'
tFound = bTiles[index];
if ((tileQueue.Count >=
maxQueueLength) && (tileQueue.Count > 0 )) {
tileQueue.RemoveAt(0); }
tileQueue.Add(tFound);
// Adjust the hue
Bitmap bAdjusted =
AdjustHue(tFound.getBitmap(), avgsMaster[x, y]);
// Apply found tile to
section
for (int w = 0; w <
szTile.Width; w++)
{

53

ZOOME | PHOTO MOASIC SOFTWARE

for (int h = 0; h <


szTile.Height; h++)
{
bOut.SetPixel(x *
szTile.Width + w, y * szTile.Height + h,
bAdjusted.GetPixel(w, h));
Application.DoEvents();
}
}
// Increment the progress
bar
pgbUpdate.Value++;
}
}
}
else
{
// Don't adjust hue - keep searching
for a tile close enough
for (int x = 0; x < tX; x++)
{
for (int y = 0; y < tY; y++)
{
// Reset searching threshold
int threshold = 0;
int index = 0;
int searchCounter = 0;
Tile tFound = null;
while (tFound == null)
{
index =
r.Next(bTiles.Count);
if
(GetDifference(avgsMaster[x, y], bTiles[index].getColor()) <
threshold)

54

ZOOME | PHOTO MOASIC SOFTWARE

{
tFound =
bTiles[index];
Application.DoEvents();
}
else
{
searchCounter++;
if (searchCounter >=
bTiles.Count) { threshold += 5; }
Application.DoEvents();
}
}
// Apply found tile to
section
for (int w = 0; w <
szTile.Width; w++)
{
for (int h = 0; h <
szTile.Height; h++)
{
bOut.SetPixel(x *
szTile.Width + w, y * szTile.Height + h,
tFound.getBitmap().GetPixel(w, h));
Application.DoEvents();
}
}
// Increment the progress
bar
pgbUpdate.Value++;
}
}
}

55

ZOOME | PHOTO MOASIC SOFTWARE

}
// Close Files Phase
foreach (Tile t in bTiles)
{
t.Close();
}
/// Notification
lblUpdate.Text = String.Format("Job
Completed");
Application.DoEvents();
return bOut;
}
catch
{
throw;
}
}

FN2 : GetTileAverage();
Get Average Color of an Image RGB Average

public static Color GetTileAverage(Bitmap bSource, int x, int y, int width, int height)
{
long aR = 0;
long aG = 0;
long aB = 0;
for (int w = x; w < x + width; w++)
{
for (int h = y; h < y + height; h++)
{
Color cP = bSource.GetPixel(w, h);
aR += cP.R;

56

ZOOME | PHOTO MOASIC SOFTWARE

aG += cP.G;
aB += cP.B;
}
}
aR = aR / (width * height);
aG = aG / (width * height);
aB = aB / (width * height);
return Color.FromArgb(255, Convert.ToInt32(aR), Convert.ToInt32(aG),
Convert.ToInt32(aB));
}

FN3 : GetDifference();
Get Difference between tiles and grids by comparing two colors
to operate Tiling search Algorithm
public static int GetDifference(Color source, Color target)
{
int dR = Math.Abs(source.R - target.R);
int dG = Math.Abs(source.G - target.G);
int dB = Math.Abs(source.B - target.B);
int diff = Math.Max(dR, dG);
diff = Math.Max(diff, dB);
return diff;
}

FN4 : AdjustHue();
Set RGB Effects On the Random tiles to Get the best Quality .

57

ZOOME | PHOTO MOASIC SOFTWARE

public static Bitmap AdjustHue(Bitmap bSource, Color


targetColor)
{
Bitmap result = new Bitmap(bSource.Width,
bSource.Height);
for (int w = 0; w < bSource.Width; w++)
{
for (int h = 0; h < bSource.Height; h++)
{
// Get current output color
Color clSource = bSource.GetPixel(w, h);
int R = Math.Min(255, Math.Max(0,
((clSource.R + targetColor.R) / 2)));
int G = Math.Min(255, Math.Max(0,
((clSource.G + targetColor.G) / 2)));
int B = Math.Min(255, Math.Max(0,
((clSource.B + targetColor.B) / 2)));
Color clAvg = Color.FromArgb(R, G, B);
result.SetPixel(w, h, clAvg);
Application.DoEvents();
}
}
return result;
}

FN5 : ResizeBitmap();
Resize the tiles with a given height and width and save it in your
PC to Save memory

private static Bitmap ResizeBitmap(Bitmap bSource, Size


newSize)
58

ZOOME | PHOTO MOASIC SOFTWARE

{
Bitmap result = new Bitmap(newSize.Width,
newSize.Height);
using (Graphics g = Graphics.FromImage(result))
{
g.DrawImage(bSource, 0, 0, newSize.Width,
newSize.Height);
g.Dispose();
}
return result;
}
}

59

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Six
System Testing
1-Overview
2-Scinarios and test Cases
4-Summary

1-Overview
System testing of software or hardware is testing conducted on a
complete, integrated system to evaluate the system's compliance with
its specified requirements. System testing falls within the scope of black
60

ZOOME | PHOTO MOASIC SOFTWARE

box testing, and as such, should require no knowledge of the inner design
of the code or logic.We will present on this chapter some test cases and
scenarios of use

2-Scinarios And Testcases


When we start running application a welcome screen appears that contain
logo of xoome and an overview about the system such that it illustrates
what is mosaic and how could we use this application

After the user sees welcome page , he will press on the logo to navigate to
the main screen in which he will use the application.

61

ZOOME | PHOTO MOASIC SOFTWARE

This is the look of the application before using (its very simple and its UI is
simple for the user to understand and use
Then the user will follow the following steps as follows :
1)Choose master photo

62

ZOOME | PHOTO MOASIC SOFTWARE

2)Choose tiles with any number

63

ZOOME | PHOTO MOASIC SOFTWARE

3)Choose tile size

64

ZOOME | PHOTO MOASIC SOFTWARE

Browse for the destination we would save our app small tiles for
database management

65

ZOOME | PHOTO MOASIC SOFTWARE

4) Then decide which mode he wants (Tiling or Hue)

66

ZOOME | PHOTO MOASIC SOFTWARE

5) Then press go to start generating mosaic

67

ZOOME | PHOTO MOASIC SOFTWARE

68

ZOOME | PHOTO MOASIC SOFTWARE

4-Summary
This chapter presented test cases and some possible scenarios of use.
After the test cases that are presented, the proposed system is verified
to work properly according to the end user needs and actions provided in
system requirement chapter 3

69

ZOOME | PHOTO MOASIC SOFTWARE

Chapter Seven
1-Conclustion
2-Future Work
3- Glossary

70

ZOOME | PHOTO MOASIC SOFTWARE

1-Conclusion
Xoome is a powerful system in the field of image processing, that lets
you create a photo consists of many small photos via
some algorithms and functions to save the quality. This software is
developed to run on PCs as we using the huge amount of processing
comparing it with the small processing of mobiles and tablets.
We have discussed in chapter one what are the functionalities that our
system perform. But we will not stop at this point anymore. We have our
plans to continue it in the future. We have designed this software to be a
commercial product. By applying our market research we found that,
people are very fond of taking photos. So our project will target some
segments. Lets see

71

ZOOME | PHOTO MOASIC SOFTWARE

2-Future Work
Our Project

Touristic
village

Supermarket
Offers

New Cities

Weddings

Internationa
l Schools

New Malls

Educational
programs

Virtual
Tour

72

ZOOME | PHOTO MOASIC SOFTWARE

Lets talk briefly about each point:1- Tourist Villages


by the increasing of requests on beaches every year, we see a lot of
new tourist villages. This villages are need to perfect marketing to
shine and attract people. So our plan is to make a very large photo
which present the logo of the village or the view of it and when you
zooming in it you can see each place, restaurant, shops, spa , etc.
Not only these but also you can zoom in each shop and see some
photos of it. It will be an incredible idea.

73

ZOOME | PHOTO MOASIC SOFTWARE

2- New cities :
are almost like Tourist Villages in addition to we can create this very
big photo and put it up of street bridges. By narrowing from it you will
see the change of the big photo and the consist of it will be shown step
by step.

74

ZOOME | PHOTO MOASIC SOFTWARE

75

ZOOME | PHOTO MOASIC SOFTWARE

3-Weddings :
Now we see the millions of weddings and every day brides and grooms
need amazing ideas to have a unique wedding. So our plan is to create a
large mosaic on the front of the hall this mosaic is a photo of bride and
groom and when you get zooming in it you will see some memories of them
together, their childhood, their friends, etc.

76

ZOOME | PHOTO MOASIC SOFTWARE

4-Supermarket offers:
Now the big supermarkets like Carrefour, Spinneys and so on make offers
like you can by 10 chocolates by 20 LE or you can pay it and have 10 Bags of
Chipsy. And more and more of those offers which can be represented by
photo of 20 ponds and when you zooming in it you can see the offer
packages.

77

ZOOME | PHOTO MOASIC SOFTWARE

5- International Schools:
these schools can attract the parents by uploading some of their photos
combined together in one photo by our project to facilitate the process of
choosing a suitable school for their children.

78

ZOOME | PHOTO MOASIC SOFTWARE

79

ZOOME | PHOTO MOASIC SOFTWARE

6- Educational programs :
people can use our system in education field by making a photo of a letter
and when you zooming in it you can see the objects which start with this
letter.

80

ZOOME | PHOTO MOASIC SOFTWARE

7-New Malls :
everyday new places are explored and set in them new malls but you have
to make a wonderful idea to distinguish between your mall and the others
malls which are located in your city. People always love creative ideas and
searching for the latest marketing ideas. By applying the idea of tourist
81

ZOOME | PHOTO MOASIC SOFTWARE

village and new cities which we discussed up.

82

ZOOME | PHOTO MOASIC SOFTWARE

8-Instgram update:
We will contact Instagram and Facebook owners and make our software is
a built in feature in them.

83

ZOOME | PHOTO MOASIC SOFTWARE

And , finally Our plan will be extended to reach Virtual tours but this we
have no idea about it now and make sure we will rock .

ZOOME

3-Glossary
Activity Class: in Android, a class takes care of creating a window for you
in which you can place your While activities are often presented to the user
as full-screen windows.
Class Diagram : a type of static structure diagram that describes the
structure of a system by showing the system's classes, their attributes,
operations(or)methods and the relationships between the classes.
Framework : reusable set of libraries or classes for a software system.
Functional Requirements: defines a function of a software system or its
component. A function is described as a set of inputs, the behavior and
outputs.
Global Positioning System: a space-based global navigation satellite
system (GNSS) that provides location and time information in all weather,
anywhere on or near the Earth. of arrival at a destination.
Non-Functional Requirements: a requirement that specifies criteria
that can be used to judge the operation of a system, rather than specific
behaviors.

84

ZOOME | PHOTO MOASIC SOFTWARE

Sequence Diagrams: a kind of interaction diagram that shows how


processes operate with one another and in what order. It is a construct of a
Message Sequence Chart.
Stakeholders: person, group, or organization that has direct or indirect
stake in the proposed system because it can affect or be affected by the
project's actions and objectives.
System architecture: System architecture is the conceptual model that
defines the structure, behavior, and more views of a system. An architecture
description Glossary is a formal description and representation of a system,
organized in a way that supports reasoning about the structure of the
system which comprises system components, the externally visible
properties of those components, the relationships (e.g. the behavior)
between them.
System Requirements: are two types functional and non-functional
requirements.
Use Case Diagram: a diagram demonstrates the system usage from its
users perspective.

85

Anda mungkin juga menyukai