Gastric cancer is the fourth common cancer and the second major cause of cancer death worldwide. Early detection of gastric cancer by endoscopy surveillance is actively investigated to improve patient survival, especially using the newly developed magnifying narrow-band imaging endoscopy in the stomach. However, meticulous examination of the aforementioned images is both time and experience demanding and interpretation could be variable among different doctors, which hindered its widespread application. In this study, we developed a new image analysis system by adopting local binary pattern and vector quantization to perform pattern comparison between known training abnormal images and testing images of magnifying narrow band endoscopy images in the stomach. Our preliminary results demonstrated promising potential for automatically labeled region of interest for endoscopy doctors to focus on abnormal lesions for subsequent targeted biopsy, with the rates of recall 0.46-1.00 and precision 0.39-0.87.