Ferico:
1.IS THERE ANY OTHER WAY TO COUNT PEOPLE OTHER THAT USING LASER TRIP WIRE?
Install a subway style turnstile
Use a pressure sensitive floor mat
Use an infrared emitter/detector pair
Use a reflective infrared proximity sensor
Use a passive infrared motion sensor
Use a camera and image processing software
Use a mechanical feeler switch that people brush by
Use a gesture sensor (like the APDS-9960)
Use an RFID reader and make each person carry an RFID tag
Use vibration sensors in the floor
Use a very sensitive capacitive sensor
Use a sensitive metal detector to detect keys and coins in pockets, belt buckles, zippers, snaps, etc.
Use a trained monkey to push a button as each person passes
There are many ways to approach a problem. Each one has their strengths and weaknesses, some are more practical than others. The choice depends on your requirements, budget, installation restrictions, convenience to the people, appearance requirements, and expertise.
2.CAN I MAKE IT RUN FOR 24/7?
Of course!
3.PLEASE HELP ME OUT WITH THE CODING A LITTLE.JUST AN ALGORITHM IS NECESSARY FOR ME.I CAN FIGURE OUT THE REST.
Before worrying too much about an algorithm, make sure you have clearly and concisely specified your requirements. Do you want to just get a total count? Do you want to know when people are passing so you can characterize traffic patterns over time? Do you need to know direction? How tolerant do you need to be about people walking close together or even side-by-side? How accurate does it need to be? What kind of budget do you have? What installation and power restrictions do you have?
Once you've clearly figured out WHAT you want to do, you can then start figuring HOW you're going to do it. This includes sensor selection and starting to figure out an algorithm (which will depend heavily on the above requirements and also on the selected sensor.) I think it's way too early to start talking about algorithms at this point.