An image processing apparatus for generating a captured image based on a signal value generated by a plurality of pixels according to one of white illumination light in white light imaging and narrow band illumination light in a narrow band light imaging, the white illumination light including red, green, and blue wavelength bands, the narrow band illumination light being included in one of the red, green, and blue wavelength bands, the image processing apparatus comprising:
- a processor configured to:
- perform averaging processing on pixel values of pixels included in a group of a plurality of pixels having different color filters to obtain a signal value for generating motion detection images, and generate the motion detection images for detecting motion between captured images at different points in time based on the signal value obtained by the averaging processing in such a way that, in the white light imaging, a weight of a pixel value of a pixel having a filter for passing light of a luminance component of a captured image in the white light imaging is set to be larger than or equal to a weight of a pixel value of a pixel having a different type of filter while in the narrow band imaging, a weight of a pixel value of a pixel having a filter for passing light of a luminance component of a captured image in the narrow band imaging is set to be larger than or equal to a weight of a pixel value of a pixel having a different type of filter;
- and
- detect, based on the generated motion detection images, the motion between two of the motion detection images generated based on the captured images at the different points in time.