A system for imaging an object comprising: - an optical imaging unit defining an optical axis and comprising a multicore fiber configured to collect light from the object at an input edge of the multicore fiber and transfer the collected light to an output edge of the multicore fiber, wherein the multicore fiber has a diameter D, and a plurality of cores having a pitch d; - a detector array configured to have formed thereon, by the optical imaging unit, an image of the object; - a detection unit configured to detect a longitudinal distance between the object and the input edge of the multicore fiber, and to determine thereby if the object is in a near field or a far field of the optical imaging unit; - a displacing unit configured to shift the input edge of the multicore fiber relative to the object in a plane substantially perpendicular to the optical axis and along the optical axis, forming thereby a set of shifted images of the object on the detector array; - an operating unit configured to: receive data from the detection unit indicative of the longitudinal distance between the object and the input edge of the multicore fiber; and operate the displacing unit by setting a shifting amplitude to either a first shifting amplitude inferior or equal to the diameter of a core of the multicore fiber or a second shifting amplitude superior or equal to the diameter of the multicore fiber; - a processing unit connectable to the detection array and configured to receive and process data indicative of the set of shifted images, and to interlace one or more of said shifted images to obtain a combined image, wherein: the operating unit comprises a shift controller configured to set the shifting amplitude based on the longitudinal distance between the input edge and the object to either: the first shifting amplitude inferior or equal to the diameter of a core of the multicore fiber; or the second shifting amplitude superior or equal to the diameter D of the multi core fiber. - an optical imaging unit defining an optical axis and comprising a multicore fiber configured to collect light from the object at an input edge of the multicore fiber and transfer the collected light to an output edge of the multicore fiber, wherein the multicore fiber has a diameter D, and a plurality of cores having a pitch d; - a detector array configured to have formed thereon, by the optical imaging unit, an image of the object; - a detection unit configured to detect a longitudinal distance between the object and the input edge of the multicore fiber, and to determine thereby if the object is in a near field or a far field of the optical imaging unit; - a displacing unit configured to shift the input edge of the multicore fiber relative to the object in a plane substantially perpendicular to the optical axis and along the optical axis, forming thereby a set of shifted images of the object on the detector array; - an operating unit configured to: receive data from the detection unit indicative of the longitudinal distance between the object and the input edge of the multicore fiber; and operate the displacing unit by setting a shifting amplitude to either a first shifting amplitude inferior or equal to the diameter of a core of the multicore fiber or a second shifting amplitude superior or equal to the diameter of the multicore fiber; - a processing unit connectable to the detection array and configured to receive and process data indicative of the set of shifted images, and to interlace one or more of said shifted images to obtain a combined image,