To solve the need for automatic counting of fishery breeding and transportation, a fish identification algorithm design and programming based on machine vision is proposed. Using digital image recognition and classification technology, proved that Scale Invariant Feature Transform SIFT and Speed Up Robust Feature SURF algorithm can effectively detect and label fish image feature points. A Fast Library for Approximate Nearest Neighbors FLANN matching algorithm is designed to test rotation and generalized fish target finding based on image features proving that the SURF feature is good for individual detection and SIFT feature is good for generalization target detection. In view of the fragmentation characteristics of FLANN image feature matching, combined with the actual situation of image information area aggregation, and using the template detection method for reference, a template detection algorithm for image segmentation scanning and feature matching is designed; using Maximally Stable Extremal Regions MSER method to eliminate the redundancy of the recognition results, test result proved that the algorithm can correctly identify the multi- fish target. This study found that the algorithm and software could successfully identify multiple fish targets in the images, with good test results and strong practical implications.