We present a novel multiscale methodology for automatic machine vision application aiming at detecting the size ratio of tobacco leave, and the inspection data will be feedback to adjust running parameters of packaging systems. Firstly, the image is represented by a multiscale Markov Random Field(MRF) model, namely, hidden Markov tree(HMT), which models inter and intra scale dependices of wavelet coefficients. Secondly, according to convex optimization theorem, the energy on hidden Markov tree model is reformulated as a convex version in terms of pseudo marginals. Finally we give the tobacco target segmentation results of the inspection system, which appears to be of better segmentation quality compared to that of the conventional nonconvex energy function.