Accurate detection and segmentation of the pedicels are important tasks in a melon quality-rating system which is based on image processing. It presents a novel method of detecting the pedicels and erasing them in the melon images. The corners of a melon image are extracted firstly, and most of them distributes in the pedicel. Utilizing this feature, the pedicels exactly and erase them easily can be detected. The proposed method is not sensitive to variations of their shape, length, thickness of pedicels, and thus is adaptable. The experimental results show that, compared with the several existing approaches, the accuracy of the proposed method is improved and the average time cost is reduced.