Counting and Packing Machine: Efficient Solutions for Accurate Product Counting and Automated Packing