Gastroesophageal reflux disease (GERD) is one the most prevalent digestive disorders. Columnar lined epithelium in lower esophagus and consequently adenocarcinaoma are potential complications of this disorder. Endoscopic diagnosis of pathological changes in gastroesophageal junction including esophagitis (defined by Los Angles classification) and Barrett's mucosa (as defined by Prague consensus) is based on visual detection of two boundaries: mucosal color change between esophagus and stomach, and top end point of gastric folds. Presence and pattern of mucosal breaks on gastroesophageal mucosal junction (Z line) classify esophagitis in patients and distance between the two boundaries points to possible columnar lined epithelium. Since visual detection may face intra- and inter-observer variability, our objective was to define the boundaries automatically based on image processing algorithms that may enable us measure the detentions of changes in future studies. \\\\ To identify Z-line, at first step artifacts of endoscopy images are eliminated, and non linear diffusion filtering is applied to emphasize the differences between the regions inside and outside of Z-line. In the second step by using SUSAN edge detector, Mahalanobis distance criteria and gabor filter bank, an initial contour will be estimated for Z-line. Using Region Based Active Contours, thi contour converges to the Z-line and therfore region inside Z-line will be segmented. At last by applying morphological operators and gabor filter bank to the regio inside of Z-line, gastric folds will be identified. For evaluating results a data base included 26 images and their ground truths has been collected. the average of accuracy, sensitivity and specificity of Z-line segmentation are 0/97 ,0/95,0/90 respectively. Also ABD criteria which shows the average distance between the boundary detected by the algorithm and that detected by practitioner is 4/18 pixels. Also two critera that compare segmentatoin of folds with several ground truths, that is SSC and JIGS, are 0/90 and 0/84 respectively. Accordingly, considering these results, segmentation of Z-line and gastric folds are matched to the ground truths with an appropriate accuracy. Kew Words: 1. Adenocarcinoma, 2. Barrett's esophagus 3. Demarcating Z-line and gastric folds boundary, 4. Segmentation of LES endoscopy images,