An image processing apparatus comprising: image capturing means configured to acquire a captured image; holding means configured to hold a first background image of a monitoring target area, wherein the first background image is an image preliminarily captured and does not include a protection target; moving object detection means configured to detect a foreground object as a moving object in the captured image; updating means configured to generate a second background image which is updated based on the foreground object detected by the moving object detection means, such that the second background image does not include the protection target; congestion state sensing means configured to sense a congestion state, where a large number of moving objects exist, or a non-congestion state, where a small number of moving objects exist, in the monitoring target area, based on information on the foreground object; the image processing apparatus characterized in that it further comprises: an image comparison means configured to generate a first mask image corresponding to the protection target in the captured image by comparing the captured image with the first background image if the congestion state sensing means sense the congestion state, wherein the image comparison means generate a second mask image corresponding to the protection target in the captured image by comparing the captured image with the second background image if the congestion state sensing means sense the non-congestion state; and an image combining means configured to generate a privacy protection image by combining the first mask image with the first background image if the congestion state sensing means sense the congestion state, wherein the image combining means generate a privacy protection image by combining the second mask image with the second background image if the congestion state sensing means sense the non-congestion state. image capturing means configured to acquire a captured image; holding means configured to hold a first background image of a monitoring target area, wherein the first background image is an image preliminarily captured and does not include a protection target; moving object detection means configured to detect a foreground object as a moving object in the captured image; updating means configured to generate a second background image which is updated based on the foreground object detected by the moving object detection means, such that the second background image does not include the protection target; congestion state sensing means configured to sense a congestion state, where a large number of moving objects exist, or a non-congestion state, where a small number of moving objects exist, in the monitoring target area, based on information on the foreground object; the image processing apparatus characterized in that it further comprises: an image comparison means configured to generate a first mask image corresponding to the protection target in the captured image by comparing the captured image with the first background image if the congestion state sensing means sense the congestion state, wherein the image comparison means generate a second mask image corresponding to the protection target in the captured image by comparing the captured image with the second background image if the congestion state sensing means sense the non-congestion state; and an image combining means configured to generate a privacy protection image by combining the first mask image with the first background image if the congestion state sensing means sense the congestion state, wherein the image combining means generate a privacy protection image by combining the second mask image with the second background image if the congestion state sensing means sense the non-congestion state. an image comparison means configured to generate a first mask image corresponding to the protection target in the captured image by comparing the captured image with the first background image if the congestion state sensing means sense the congestion state, wherein the image comparison means generate a second mask image corresponding to the protection target in the captured image by comparing the captured image with the second background image if the congestion state sensing means sense the non-congestion state; and an image combining means configured to generate a privacy protection image by combining the first mask image with the first background image if the congestion state sensing means sense the congestion state, wherein the image combining means generate a privacy protection image by combining the second mask image with the second background image if the congestion state sensing means sense the non-congestion state.