Manual peeling of Poria cocos has low efficiency and large loss, and other peeling methods are not suitable for Poria cocos peeling. To solve this problem, this study designed and fabricated a set of automatic peeling equipment for Poria cocos, which combined image processing technology with the structure and function of the vertical milling machine. This paper mainly reports the image detection algorithm of Poria cocos epidermis position for automatic peeling. Firstly, the blue marks were glued to the movable and the immovable parts of clamping parts, and the initial window was determined through them. Then, the grayscale image within the initial window was obtained with the help of the chromatic aberration |2r-g-b| (red (r), green (g), blue (b) of pixels). The processing window was calculated with the aid of the distribution graph of the grayscale accumulation. Next, the grayscale image was taken into the process of the automatic binarization based on the Otsu method and the binary image was restored through dilation, erosion and denoising algorithm. Finally, pixel columns in the processing window were scanned column-by-column from the left to the right and the direction of each pixel column is from the bottom to the top. The first pixel with a value of 0 on each pixel column was set as the epidermis position of the current pixel column. The experiment results implied that, under the set light source, the average detection accuracy was 98.8%, and the average time to detect epidermis position once was 0.024 s. The detection accuracy and real-time performance of this algorithm meets the actual operation requirements of Poria cocos peeling. It lays the foundation for the automatic peeling operation of Poria cocos.