The invention relates to a platform automatic leveling device based on machine vision, which comprises an omnibearing-inclined sensor shell, an LED lighting source, a transparent cone container, opaque liquid, a camera, an embedded system, a power source, a compass, a platform, a platform supporting leg position servo control unit and a platform supporting leg position servo control drive unit. The transparent cone container is combined into a closed container by using two cones with the same size in a back-to-back way, and the container contains the opaque liquid which is half of the volume of the container; the transparent part of the transparent cone container, shot by the camera in a positive body focus, is analyzed, judged and calculated to obtain measuring parameters, including incline angle, dip azimuth and the like of the tested platform, and then the platform is automatically leveled through the measuring parameters according to different leveling strategies. The invention has the advantages of simple maintenance and adjustment, high measurement precision and control precision, wide measurement range, low manufacturing cost, rich leveling means, real-time performance, security and reliability.