The invention relates to an Online bar section image automatic counting device and method. The invention relates to the
digital image processing and applying technologies. The image counting device of the invention includes an upper computer, an image collection card, a
CCD camera and a lighting equipment; wherein the upper computer is connected with the image collection card; and the image collection card is respectively connected with the
CCD camera and the lighting equipment. The image counting method of the invention includes the steps of sensing and opening the image, pre-
processing the image,
processing edge detection operators, converting 2D distances, searching and counting seed points as well as displaying the counting result. After adopting the
gray level image threshold segmentation and pseudocolor coding technologies, the invention not only can process gray images on the end surface of the bar section, but also can process blue or yellow images on the end surface of the bar section; the
system adaptation is wider; the invention discloses a method for obtaining the perimeter, area and number of the bar sections in the image; the counting precision of the seed searching method is relatively higher, which can count partial bar sections with irregular end surface shapes and different shooting sizes.