⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image.tex

📁 图像中非刚性曲线的蛇形检测算法
💻 TEX
📖 第 1 页 / 共 2 页
字号:
\rhead {class IMAGE}
\section{IMAGE : The raw image object}

{\tt IMAGE} is a class for manipulating and displaying image data. Image data can be stored, retrieved, copied, cut, and viewed for different purposes. In addition, histogram processing, image correlation and Gaussian kernel generation are also provided for image enhancement and smoothing purpose. An {\tt IMAGE} object has the following structure :

\begin{verbatim}
            CLASS IMAGE {
                  protected :
                     float *data;
                     int row, col;

                  public :
                     XIMAGE *ximg;
            }
\end{verbatim}

Image data is built up of a matrix of size row x col, which can be generated as an X window image.


\subsection{IMAGE Constructor}

\subsubsection*{Synopsis}
\begin{verbatim}	
	IMAGE()
\end{verbatim}

\subsubsection*{Description}
The constructor initializes an image data of matrix size 0 x 0, and sets the X window image pointer to NULL. 

%
\subsection{IMAGE Destructor}

\subsubsection*{Synopsis} 

\begin{verbatim}
	~IMAGE()
\end{verbatim}

\subsubsection*{Description} 
The destructor frees the memory allocated to the image data and the X window image.

%
\subsection{Resetting an IMAGE}

\subsubsection*{Synopsis}
\begin{verbatim}
reset()
\end{verbatim}

\subsubsection*{Description}
{\tt reset} allows the reuse of an {\tt IMAGE} object. The memory allocated previously is freed and the image data of matrix size 0 x 0 is initialized. 

%
\subsection{Initializing image matrix}

\subsubsection*{Synopsis} 
\begin{verbatim}
	int init(int _row, int _col);
\end{verbatim}

\subsubsection*{Arguments} 
\begin{tabular}{ll}
	{\tt \_row} & The number of rows in an image. \\
	{\tt \_col} & The number of columns in an image.
\end{tabular}

\subsubsection*{Returns}
\begin{tabular}{ll}
	{\tt NOERROR} & Memory allocation is successful. \\
	{\tt MEMORYERROR} & Otherwise.
\end{tabular}

\subsubsection*{Description}
{\tt init} allocates memory of type float and size \_row x \_col to image data.

%
\subsection{Initializing Gaussian template}

\subsubsection*{Synopsis} 
\begin{verbatim}
	void initAsGauss()
\end{verbatim}

\subsubsection*{Description} 		
{\tt initAsGauss} initializes the image data into a 3 x 3 Gaussian kernel which can be used for image smoothing. A larger Gaussian kernel can be obtained by correlating the template with itself. The content of kernel is as below :
\begin{table}[thbp]
    \begin{center}
	\begin{tabular}{||c|c|c||} \hline
		0.049997 & 0.122466 & 0.049997 \\ \hline
		0.122466 & 0.299975 & 0.122466 \\ \hline
		0.049997 & 0.122466 & 0.049997 \\ \hline
	\end{tabular}
     \end{center}
\caption{Gaussian generating kernel}
\label{tbl:pe}
\end{table}

%
\subsection{Putting data into image matrix}

\subsubsection*{Synopsis} 
\begin{verbatim}
	void put(int m, int n, float val)
\end{verbatim}

\subsubsection*{Arguments} 
\begin{tabular}{ll}
	{\tt m} & Row coordinate. \\
	{\tt n} & Column coordinate.  \\
	{\tt val} & Floating point data 
\end{tabular}

\subsubsection*{Description} 		
{\tt put} stores the floating point data into location (m,n) of the image matrix.  The user should ensure that the row and column coordinates are within the valid range. 

%
\subsection{Getting data from image matrix}

\subsubsection*{Synopsis} 
\begin{verbatim}
	float get(int m, int n)
\end{verbatim}

\subsubsection*{Arguments}
\begin{tabular}{ll}
	{\tt m} & Row coordinate. \\
	{\tt n} & Column coordinate.
\end{tabular}

\subsubsection*{Description} 
{\tt get} returns the floating point data at location (m,n) of the image data. The validity of the row and column coordinates are not checked.

%
\subsection{Getting IMAGE row and col}

\subsubsection*{Synopsis} 
\begin{verbatim}		
	int getRow()
	int getCol()
\end{verbatim}

\subsubsection*{Returns}
Row or column size of the image data.

\subsubsection*{Description} 
{\tt get} returns the row and column size of the image matrix.

%
\subsection{Printing image data} 

\subsubsection*{Synopsis} 
\begin{verbatim}
	void print()
\end{verbatim}

\subsubsection*{Description} 
{\tt print} displays onto the screen all the values of the image matrix.

%
\subsection{Displaying image} 

\subsubsection*{Synopsis} 
\begin{verbatim}
void show(unsigned char blowup = 1, int num, 
          int h_offset = 0, int v_offset)
\end{verbatim}

\subsubsection*{Arguments}
\begin{tabular}{ll}
	{\tt blowup} & Image magnification factor. \\
	{\tt num} & The number of times the length of the window to 
		   be increased. \\
	{\tt h\_offset} & Horizontal offset of the image against the window 	
			 origin. \\
	{\tt v\_offset} & Vertical offset of the image against the window 	
			 origin. \\
\end{tabular}
	
\subsubsection*{Description} 
{\tt show} displays the image data on an X window. When {\tt h\_offset} and {\tt v\_offset} are not specified or set to 0, an X window of the image size will be created. Otherwise, no window will be generated and the image will be shown on an existing window. The parameter {\tt num} allows the user to create a larger window so that more than one image can be displayed on the same window. For instance, a second image can be shown next to the original image by calling the method {\tt show} with {\tt num} = 1 and {\tt h\_offset} = column of the original image.

%
\subsection{Reading image data from file}

\subsubsection*{Synopsis} 
\begin{verbatim}	
	int read(char *filename)
\end{verbatim}

\subsubsection*{Arguments}
\begin{tabular}{ll}
	{\tt filename} & Image file name.  
\end{tabular}

\subsubsection*{Returns}
\begin{tabular}{ll}
	{\tt NOERROR} & Successful read operation. \\
	{\tt MEMORYERROR} & Memory allocation failure. \\
	{\tt FILEIOERROR} & File I/O error. 
\end{tabular}

\subsubsection*{Description} 
By using the appropriate filter, {\tt read} can access the file of type SUN raster (\_ras) or binary (\_bin). Memory allocation is done automatically. However, reading of incorrect file format will cause memory allocation error. For a SUN raster colour image file, the image will probably need to be conditioned before it can be viewed clearly.

%
\subsection{Writing image data to file} 

\subsubsection*{Synopsis} 
\begin{verbatim}	
	int write(char *filename,int filetype = _ras)
\end{verbatim}

\subsubsection*{Arguments}
\begin{tabular}{ll}
	{\tt filename} & Image file name. \\
	{\tt filetype} & File type, either \_bin or \_ras.
\end{tabular}
	
\subsubsection*{Returns}
\begin{tabular}{ll}
	{\tt NOERROR} & Write is successful. \\
	{\tt MEMORYERROR} & Unable to create write buffers in memory. \\
	{\tt FILEIOERROR} & File interface error.
\end{tabular}

\subsubsection*{Description} 
	
{\tt write} converts the floating point image data to unsigned characters and linearly mapped them to the full range of 0 to 255 before they are written to the file specified. If the file is of SUN raster format, the raster file header, consisting of 8 bytes of integers, will be written as below :
\begin{quote}

\begin{verbatim}
		ras_magic    = 0x59a66a95    (Magic number of sun raster file) 
		ras_width    = column size   (Image column)
		ras_height   = row size	     (Image row)
		ras_depth    = 8             (Depth of colour plane)
		ras_length   = row * col     (Size in bytes of image)
		ras_type     = 1             (Old or new format raster file)
		ras_maptype  = 0             (Colour Map type) 	
		ras_maplength= 0             (Colour Map length)
\end{verbatim}     
\end{quote}

%
\subsection{Histogram conditioning of image}

\subsubsection*{Synopsis} 
\begin{verbatim}
void condition(double low_pct=0.9, double high_pct=0.95,
               double low_val=0.2, double high_val=0.9,
               double imm_pow=1.0)
\end{verbatim}

\subsubsection*{Arguments}
\begin{tabular}{ll}
	{\tt low\_pct, high\_pct} & Percentage range which the image 
				  pixels are to be mapped from.  \\
	{\tt low\_val, high\_val} & Intensity range over which
				  the pixels are to be mapped to. \\
	{\tt imm\_pow} & Exponential power used by the transformation

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -