DSA Project Report
Author
Javid
Last Updated
6 years ago
License
LaTeX Project Public License 1.3c
Abstract
DSA Project Report
DSA Project Report
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{color}
\usepackage{listings}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{indentfirst}
%\usepackage{fontspec}
%\usepackage[utf8]{inputenc}
%\setmainfont{Futura}[ItalicFont={Futura Italic}]
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colIdentifier}{rgb}{0,0,0}
\definecolor{colComments}{rgb}{0,0.5,1}
\definecolor{colString}{rgb}{0.6,0.1,0.1}
\lstset{%configuration de listings
float=hbp,
basicstyle=\ttfamily\small,
identifierstyle=\color{colIdentifier},
keywordstyle=\color{colKeys},
stringstyle=\color{colString},
commentstyle=\color{colComments},
columns=flexible,
tabsize=2,
%frame=trBL,
frameround=tttt,
extendedchars=true,
showspaces=false,
showstringspaces=false,
numbers=left,
numberstyle=\tiny,
breaklines=true,
breakautoindent=true,
captionpos=b,
xrightmargin= 1cm,
xleftmargin= 1cm
}
\lstset{language=c++}
\lstset{commentstyle=\textit}
\parskip 5pt plus 2pt minus 2pt
\textwidth=14cm
\oddsidemargin=1cm
\evensidemargin=1cm
\topmargin=-0.5cm
\headheight=0cm
\headsep=1cm
\textheight=23cm
\parindent=1.5cm
\begin{document}
\thispagestyle{empty}
\begin{center}
\fbox{\large\bf DSA Project Report by Javid Mammadli and Hikmat Pirmammadov}
\end{center}
\bigskip
\section*{1. INTRODUCTION}
\noindent 1.1) What does this program do?
Firstly,we find psf values for each 200 height (with Geeqie program)
Then,we find maximum psf value.
This program resize the bmp image with the following psf values.After resizing,it save the strip as another BMP image.
\noindent 1.2) Included files
Folder "Stips : 16 strips
main\textunderscore\
for\textunderscore\
resize.c, resize.c resice.h : They are the source codes of the program.
makefile\textunderscore
for\textunderscore
resize : It enables quick compilation of the program via command "make".
After and during compilation their object files are created as "main\textunderscore\
for\textunderscore\
resize.o", "resize.o".
extractStrip.c extractStrip.h main\textunderscore\
for\textunderscore\
extract.c : They are the source codes of the program from last year.This functions for extract from resized images.
makefile\textunderscore
for\textunderscore
extract : It enables quick compilation of the program via command "make".
After and during compilation their object files are created as main\textunderscore\
for\textunderscore\
resize.o", "extract.o".
PsfValues.txt - This is a file for psf values which we found.His format should be .txt or .psv format.
glue.c : This function glues all images together,and Flattened Pot will be created
readme.txt: It contains some information about program and link for overleaf
\section*{2. PROGRAM MANUAL AND DESCRIPTION}
\noindent 2.1) Usage
\noindent 2.1.1) Compilation
\noindent 2.1.2) Before usage
\noindent 2.1.3) Manual
\noindent 2.1.3.1) Syntax
\textbf{IMPORTANT } We have sent to you already executable files,so you don't need to make file.Just write command which is below.
To use this program you must write name of the program and the arguments in the terminal. We will refer the name of file of the image without extension as \textit{fileName} and give file of psf values \textit{PsfValues.txt} . They will be used in the arguments. The format of usage is as follows:\newline
\indent\textbf{./resize }\textit{fileName.bmp PsfValues}\textbf{.psv}\newline
or\newline
\indent\textbf{./resize }\textit{fileName PsfValues}\textbf{.txt}\newline
the resulting image will be stored there with name:\newline
\indent\textit{fileName}\textbf{Resized}\textit{}\textbf{.bmp}\newline
However in order to refer to build in manual of the program enter:\newline
\indent\textbf{./resize -h}\newline
or\newline
\indent\textbf{./resize --help}
\noindent 2.1.3.2) Arguments
The argument \textit{PsfValues} must be \textbf{.psv} or \textbf{.txt} format. \textit{fileName} must be the relative path to the input image without the extension.
\noindent 2.1.4) resize.sh
In order to apply "resize" to all BMP images in a given directory, enter the following command, where \textit{directory} is the relative path of the needed directory:\newline
\indent \textbf{./resize.sh }\textit{directory PsfValues.psv}
Folder with the name \textbf{ResizedImages} will be created and the resulting image will be stored there
\noindent 2.2) Example of result of successful resizing:
\parindent=0cm
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
AzCroppedPot27.bmp:
\end{verbatim}
\begin{center}
\includegraphics[scale=0.2]{AzCroppedPot27.png}
\end{center}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
AzCroppedPot27Resized.bmp:
\end{verbatim}
\begin{center}
\includegraphics[scale=0.2]{AzCroppedPot27Resized.png}
\end{center}
\end{minipage}
\parindent=1.5cm
\newline
\newline
\newline
\textbf{Also,for extract pixels from the resized image:}
To extract from the resize image,we will refer
a \textbf{ -Width} and the name of file of the image without extension as \textit{fileName} usage is as follows:\newline
\indent\textbf{./extractStrip }\textit{-Width} \textbf{fileName.bmp}\newline
or\newline
\indent\textbf{./extractStrip}\textit{ -Width} \textbf{fileName.BMP}\newline
resulting image will be stored there with the name:\newline
\indent \textit{ fileName}\textbf{Resized\textunderscore\
S\textit{Width}}\textit{}\textbf{.bmp}\newline
However in order to refer to build in manual of the program enter:\newline
\indent\textbf{./extractStrip -h}\newline
or\newline
\indent\textbf{./extractStrip --help}
\noindent 2.1.4) extractStrip.sh
In order to apply "extractStrip" to all BMP images in a given directory, enter the following command, where \textit{directory} is the relative path of the needed directory:\newline
\indent \textbf{./extractStrip.sh }\textit{-Width Directory}
Folder with the name \textbf{ResizedImages} will be created and the resulting image will be stored there
\noindent 2.2) Example of result of successful extracting: (for our case is best to extract 75 pixels from the middle)
\parindent=0cm
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
AzCroppedPot27Resized.bmp:
\end{verbatim}
\begin{center}
\includegraphics[scale=0.2]{AzCroppedPot27Resized.png}
\end{center}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
AzCroppedPot27Resized_S75.bmp:
\end{verbatim}
\begin{center}
\includegraphics[scale=0.2]{AzCroppedPot27Resized_S75.png}
\end{center}
\end{minipage}
\parindent=1.5cm
\newline
\newline
\newline
\textbf{For glue all images,just type:}
\textbf{./glue.sh}
it glues all 360 images
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
glue.bmp:
\end{verbatim}
\begin{center}
\includegraphics[scale=0.4]{cc.png}
\end{center}
\end{minipage}
\noindent 2.3) Possible errors
During the runtime of the program some errors might be encountered. In case of errors, the program is terminated.
\noindent 2.3.1) Wrong arguments
If the format of the arguments does not meet the requirements, the following message is displayed:\newline
\indent\textbf{Wrong syntax.}\newline
And, the built in manual is displayed
\noindent 2.3.2) Memory allocation failure
If enough memory cannot be allocated while the BMP image is loaded into main memory, the following message is displayed:\newline
\indent\textbf{Failed to load the image into main memory.}\newline
\indent\textbf{Make sure there is some available space in the main memory.}\newline
If enough memory cannot be allocated while the BMP image is modified, the following message is displayed:\newline
\indent\textbf{Problem with allocation.}\newline
\noindent 2.3.3) Invalid file of psfValues
If file is not \textbf{.psv} or \textbf{.txt} format,or file is empty,message is displayed:\newline
\indent\textbf{ Empty File }\newline
\noindent 2.3.4) File stream failure
If the input file could not be opened or is not present, the following message is displayed:\newline
\indent\textbf{Failed to open the input file.}\newline
If the output file could not be opened or created, the following message is displayed:\newline
\indent\textbf{Failed to open the output file.}\newline
\section*{3. EXTRAS}
\noindent 3.1) Contact us
Kamal Eyubov - kamaleyubov1999@gmail.com\newline
\indent Hikmat Pirmammadov - hikmet.pirmamedov@mail.ru
\noindent 3.2) Table of contents
\noindent\textbf{1. INTRODUCTION\dotfill1}\newline
1.1) What does this program do?\dotfill1\newline
1.2) Included files\dotfill1\newline
\textbf{2. PROGRAM MANUAL AND DESCRIPTION\dotfill1}\newline
2.1) Usage\dotfill1\newline
2.1.1) Compilation\dotfill1\newline
2.1.2) Before usage\dotfill1\newline
2.1.3) Manual\dotfill1\newline
2.1.3.1) Syntax\dotfill1\newline
2.1.3.2) Arguments\dotfill2\newline
2.1.4) resize.sh\dotfill2\newline
2.2) Example of result of successful extraction\dotfill2\newline
2.3) Possible errors\dotfill3\newline
2.3.1) Wrong arguments\dotfill3\newline
2.3.2) Memory allocation failure\dotfill3\newline
2.3.3) Invalid file of PsfValues\dotfill3\newline
2.3.4) File stream failure\dotfill3\newline
\textbf{3. EXTRAS\dotfill4}\newline
3.1) Contact us\dotfill4\newline
3.2) Table of contents\dotfill4\newline
\end{document}