Detecting objects of interest from a video sequence is a fundamental and critical task in automated visual surveillance. Those objects can either be moving or stationary. However, most of current approaches only focus on discriminating moving objects by background subtraction. In this work, we propose layers segmentation to detect both of moving and stationary target objects from surveillance video. We first construct a codebook with set of codewords for each pixel and then extend the Matrix Entropy statistical model to segment layers with codewords features. Our experimental results are presented in terms of success layer segmentation rate.