I need to program a software that can count the number of bars in a bundle of TMT bars when a camera shot is taken from one side of the bundle. The program should count accurately the number of pieces taken into consideration the space between each bar and that bars will not be completely aligned. Attached is a picture showing multiple bundles of bars. I want to be able to count each bundle separately. after the program is developed perfectly i want to create a mobile app.