Cameras that count numbers of pills etc are used in the process industry but cost a lot of money. Fitting any form of camera should be a deterrent however and you would expect to see a reduction in thefts because *most* people dont know how smart the camera is, only that they are being watched.
A more cost effective solution maybe:
With clever camera placement you might be able to identify suspicious individuals who for instance turn away from the camera or carry products off screen when there is no good reason. Fitting wide angle cameras to cover most of the store and using narrower cameras for areas such as prep areas and tills would be sensible.
A slightly more costly but setup to aspire to maybe:
To put overt/obvious cameras everywhere and leave a deliberate and obvious blind spot. The thieves may then take advantage of this and you can fit a hidden/covert camera in this spot to catch them.
Beyond all this, after weedling out the bad eggs, paying your good staff well and showing you value them can sometimes be the most effective solution.
Best of luck