PROBLEM TO BE SOLVED: To provide an endoscopic diagnostic apparatus, image processing method, program, and recording medium capable of eliminating fogging of the light-transmissive protection substrate mounted on the light-receiving surface of the CMOS image sensor, without upsizing the apparatus.SOLUTION: A fogging detection unit analyzes an endoscope image captured by a CMOS image sensor mounted in the distal end of an endoscope to detect whether or not fogging is present on a light-transmissive protection substrate which protects the light-receiving surface of the CMOS image sensor. When fogging on the light-transmissive protection substrate is detected, an operation mode setting unit enables a heat generation mode. In the heat generation mode, a control unit sets n to an integer of 2 or more to make the frame rate for operation of the CMOS image sensor n times that in the normal mode and the exposure time of the CMOS image sensor to capture one frame image one-nth of one frame time, so that an imaging unit captures frame images of two sheets or more and n sheets or less in one frame time.SELECTED DRAWING: Figure 2COPYRIGHT: (C)2017,JPO&INPIT