Apparatus, comprising: a probe, configured to be inserted into an aperture of a human patient, the probe comprising: an insertion tube; a tubular deflectable section connected distally to the insertion tube; a camera, attached to the tubular deflectable section and having a direction of view; a first magnetic field sensor coil, which has a first coil axis of symmetry and is attached to the tubular deflectable section with the first axis parallel to the direction of view (y) of the camera; and a second magnetic field sensor coil, which has a second coil axis of symmetry and is attached to the insertion tube with the second axis perpendicular to the direction of view of the camera; a display, coupled to display images output by the camera; and a processor, which is coupled to receive signals generated by the first and second sensor coils in response to a magnetic field traversing the coils, and is configured: in response to the signals received at a first time, to identify an initial orientation of an initial image produced by the camera, in response to the signals received at a second time, subsequent to the first time, to identify a subsequent orientation of a subsequent image produced by the camera, wherein the processor is configured to determine a signal-based camera rotation in response to the signals received at the first and second times, and wherein the processor is further configured to compare and analyze the initial and the subsequent images so as to determine an image-based camera rotation, and to rotate the subsequent image on the display so as to reorient the subsequent image to the initial orientation, wherein rotating the subsequent image comprises applying an average of the signal-based camera rotation and the image-based camera rotation to reorient the subsequent image. a probe, configured to be inserted into an aperture of a human patient, the probe comprising: an insertion tube; a tubular deflectable section connected distally to the insertion tube; a camera, attached to the tubular deflectable section and having a direction of view; a first magnetic field sensor coil, which has a first coil axis of symmetry and is attached to the tubular deflectable section with the first axis parallel to the direction of view (y) of the camera; and a second magnetic field sensor coil, which has a second coil axis of symmetry and is attached to the insertion tube with the second axis perpendicular to the direction of view of the camera; an insertion tube; a tubular deflectable section connected distally to the insertion tube; a camera, attached to the tubular deflectable section and having a direction of view; a first magnetic field sensor coil, which has a first coil axis of symmetry and is attached to the tubular deflectable section with the first axis parallel to the direction of view (y) of the camera; and a second magnetic field sensor coil, which has a second coil axis of symmetry and is attached to the insertion tube with the second axis perpendicular to the direction of view of the camera; a display, coupled to display images output by the camera; and a processor, which is coupled to receive signals generated by the first and second sensor coils in response to a magnetic field traversing the coils, and is configured: in response to the signals received at a first time, to identify an initial orientation of an initial image produced by the camera, in response to the signals received at a second time, subsequent to the first time, to identify a subsequent orientation of a subsequent image produced by the camera, wherein the processor is configured to determine a signal-based camera rotation in response to the signals received at the first and second times, and wherein the processor is further configured to compare and analyze the initial and the subsequent images so as to determine an image-based camera rotation, and to rotate the subsequent image on the display so as to reorient the subsequent image to the initial orientation, wherein rotating the subsequent image comprises applying an average of the signal-based camera rotation and the image-based camera rotation to reorient the subsequent image. in response to the signals received at a first time, to identify an initial orientation of an initial image produced by the camera, in response to the signals received at a second time, subsequent to the first time, to identify a subsequent orientation of a subsequent image produced by the camera, wherein the processor is configured to determine a signal-based camera rotation in response to the signals received at the first and second times, and wherein the processor is further configured to compare and analyze the initial and the subsequent images so as to determine an image-based camera rotation, and to rotate the subsequent image on the display so as to reorient the subsequent image to the initial orientation, wherein rotating the subsequent image comprises applying an average of the signal-based camera rotation and the image-based camera rotation to reorient the subsequent image.