A method for detecting a capsule camera entering into or exiting the GI tract, includes (a) taking a first test image under the condition that an illumination system of the capsule camera is disabled (b) taking a second test image under the same condition as the first test image (c) comparing selected corresponding pixel values of the first test image and the second test image to determine if a significant change in pixel values has occurred and (d) upon detecting the significant change in pixel values, determining if the capsule camera has entered or exited the GI tract, and performing operations appropriate to follow such determination.