Purpose: The purpose of this paper is to propose a new framework and improve a bi-directional people counting technique using an RGB-D camera to obtain accurate results with fast computation time. Therefore, it can be used in real-time applications. Design/methodology/approach: First, image calibration is proposed to obtain the ratio and shift values between the depth and the RGB image. In the depth image, a person is detected as foreground by removing the background. Then, the region of interest (ROI) of the detected people is registered based on their location and mapped to an RGB image. Registered people are tracked in RGB images based on the channel and spatial reliability. Finally, people were counted when they crossed the line of interest (LOI) and their displacement distance was more than 2 m. Findings: It was found that the proposed people counting method achieves high accuracy with fast computation time to be used in PCs and embedded systems. The precision rate is 99% with a computation time of 35 frames per second (fps) using a PC and 18 fps using the NVIDIA Jetson TX2. Practical implications: The precision rate is 99% with a computation time of 35 frames per second (fps) using a PC and 18 fps using the NVIDIA Jetson TX2. Originality/value: The proposed method can count the number of people entering and exiting a room at the same time. If the previous systems were limited to only one to two people in a frame, this system can count many people in a frame. In addition, this system can handle some problems in people counting, such as people who are blocked by others, people moving in another direction suddenly, and people who are standing still.