Simultaneous acquiring and synthesizing images through an optical fiber on a moving mechanism

The research prototypes an optical fiber-scanning mechanism for capturing fiber-acquired multiple images. First, the study develops an image processing firmware embedded in high-speed hardware for image cropping, rotation, sharpening, and stitching, especially synchronizing with the moving mechanism. Then, the embedded firmware successively builds panoramic images while iteratively acquiring images as the mechanism in motion. This research applies a 3D printing technology to prototype the mechanism components and employs servomotors for mechanism motions during the prototyping stage. Next, the mechanism guides the scanning motions to follow prescribed trajectories while capturing images of specified regions. Finally, the research embeds the firmware developed on a Linux OS platform into a high-speed controller board. The resolution tests verify that the best image resolution for the prototyped optical mechanism reaches 14.30 line pairs per millimeter, and the achievable image resolution for an inspected object is 35 μm. Through acquiring and synthesizing images simultaneously by the embedded firmware while the optical fiber-scanning mechanism is in motion, this research demonstrates that the developed system effectively constructs panoramic images for an endoscope device at a lower cost.


Introduction
With recent advancements in science and technology, human beings' living environment becomes more comfortable in all aspects. Still, rapidly evolving technologies also bring harmful * Author to whom any correspondence should be addressed.
Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. side effects to numerous societies, and environmental pollutions seriously harm human health [1]. Henceforth, biomedical technology developments have become critical issues during the last 2 decades [2]. Among the advances, microsurgery technology has proposed minimal invasive surgery techniques through endoscopy or other imaging means. The technology allows doctors to complete the surgery with no largescale wounds, implying that surgeons can observe internal tissues inside a human body through endoscopy with minor wounds [3]. Henceforward, endomicroscopy has become an emerging imaging technology in facilitating image acquisitions for in vivo and in situ optical objects, and fiber-bundled endomicroscopy is a widely employed technique nowadays for clinical applications [4].
Even the endomicroscopy technology being beneficial for the patients, its applications make orientation and manipulation challenging for surgeons because the endoscope limits the field of view [5], which inside an image-acquiring probe is often smaller than the inspected object size. Researchers usually perform image stitching on acquired image tiles of scanned objects and assemble the intermediates into more extensive mosaics to obtain seamless panoramic images, but various optical aberrations crossing the tile boundaries may result in edge artifact problems [6,7]. Among the image stitching approaches to reconstruct seamless panoramic views, feature-based techniques extracting acquired images to determine adjacent images' correlations are prevalent. Another approach to retrieving lost information due to a limited field of view is that researchers integrate a piezo tube scanner at the tip of a fiber bundle and rapidly spin the fiber tip over a range to acquire images at different locations of examined objects [8,9].
Researchers have also introduced various image stitching techniques to expand the medical view for limited inspected regions with several features registration methods in acquired images [10,11]. Researchers also apply a statistical model to develop a robust elastic local alignment method to filter out outsiders during the image registration process [12], and others apply a feedback strategy to develop an adaptive as-natural-as-possible approach to generate more natural panoramic views [13]. Nevertheless, the applications demand a more precise and automatic process to obtain panoramic views of the examined regions, requiring tilting or panning motions for the image-acquiring fiber equipped with a highspeed image processing facility.
When an image capturing mechanism moves considerate displacements quickly to capture images for distanced objects, building a parallax while composing large-scale panoramic views is necessary [14]. Researchers usually quantitatively evaluate the magnitudes and variations of parallax levels through the matching errors and patch similarity metrics [15]. Thus for image acquisition of distanced objects, while the camera moves for considerable distances quickly, it is necessary to evaluate the generated parallax errors quantitatively [16,17].
Several works of literature report various methods to evaluate panorama performances, such as dual homography warp, smoothly varying local affine, and homography transformations methods. Some literature also disclosed the as-projective-as-possible method using high-precision local alignment for overlap areas. Others presented the shapepreserving half-projective method for non-overlap regions [18], in which the technique patches images with large parallax to produce natural panoramas without distortion. Accordingly, quantitative evaluations of image stitching performances generally adopt a combined metric of luminance, contrast, and structure (SSIM) [19], and the SAM index, which evaluates the effect of stitching of color images and the IMR value, which justifies the intensity gradient of stitched areas [20]. For other image acquisition and processing applications,  the literature review reports a survey of 50 research papers on  critical concrete crack detection using various image acquisition techniques, such as camera image, IR image, ultrasonic image, time of flight diffraction (TOFD) image, laser image, and other distinctive image types [21]. Among the reviewed reports, camera-based image processing detects up to 95% accuracy with a predefined error crack length limit, ultrasonic-based image processing detects up to 96% accuracy, and TOFD-based image processing detects up to as high as 90% accuracy. Also, applying artificial intelligence to classification or regression predictions for biomedical images is a major research trend, and image training and verification of the obtained model's accuracy are essential. The literature documents that medical-specific based models using a regression forest strategy quantitatively predict medical image registration errors. It easily achieves a classification accuracy rate of 95.4% [22], which an experienced medical expert needs to perform. For image registrations, the use of artificial intelligence deep learning strategies, such as applying statistical methods like principal component analysis, linear discrimination analysis, tree-forest regressions, support vector machine methods, and others are an important trend.
Image registration after image capture mainly includes feature-based, intensity-based, wavelet-based methods, elastic or non-rigid transformations, and others [23,24]. It is essential to select the transformation models. Researchers have developed advanced registration methods, such as supervised or unsupervised deep learning approaches, similarity analysis through correlation-based statistical computations, and converted frequency-domain spectrograms for subsequent image stitching processing.
Literature documents that some researchers apply the scale invariant feature transform to process blood cell mosaics and reconstruct panoramic blood cell seamless images [25,26]. Others employ binary descriptors such as binary robust independent elementary features (BRIEF), which are fast and robust local image feature detectors, to encode patch appearance based upon compact binary strings during the image stitching stage. Some studies have implemented the BRIEF technique in various real-time applications segmented mosaic images [27]. Researchers report that the oriented FAST and rotated BRIEF (ORB) method combines the oriented features from accelerated segment test (FAST) technique and rotated BRIEF descriptors, explaining its improved stitching performances is preferable [28][29][30].
In addition, researchers tend to implement high-speed hardware for biomedical applications, considering the requirement of massive computation for endomicroscopy image processing [31]. Literature reports that hardware implementation of computation facilitates parallel processing of massive data sets in real-time, and field programmable gate array (FPGA) architectures quickly realize developed artificial neural networks. Other researchers apply digital image enhancement strategies for different biomedical image processing, and the developed codes are executed on FPGA hardware for higher processing speed in real-time [32]. The approach is robust during scene movements and can automatically realize overlapping conditions for adjacent images.
This research aims to develop an embedded firmware to control an optical fiber-scanning mechanism, which simultaneously moves along prescribed trajectories and rapidly processes the fiber-acquired images of designated regions in realtime. The moving mechanism in minute motion carries the fiber needle, which is normal to and very close to the sample surface, aiming to capture sample images while keeping the fiber in the right-normal direction during the scanning and image acquisition process. The system then transmits the consecutively acquired images to the rear sensing device through the optical fiber. Hence, the research neglects the parallax issues, which usually occur for distanced object image acquisition during fast camera motion and variations of image capturing directions or position errors.
This research mainly focuses on processing the matching features among captured adjacent images and the fusion method of overlapping areas during the image stitching. The study realizes that the platform's gentle movement causes only minimal required translation and rotation conversions to generate panoramic sample images. It is prospective to perform quantitative parallax evaluations when this study modifies the prototype to acquire images for distanced objects with significant motions in practical applications. It is feasible to utilize the current prototype for applications to scan biomedical samples in Petri dishes with extended detailed images to assemble and scan delicate image patterns of artwork for verification in an acceptable time.
This study develops acquiring/processing firmware for moving the optical fiber beam and then performs data collections through image acquisitions. The developed system controls the scanning mechanism and performs image acquiring/processing through the embedded firmware within an FPGA embedded circuit board [33,34]. Then, scanned multiple mosaic images integrate into panoramic images with image correction and synthesizing techniques. The developed prototype effectively improves the capability to inspect larger objects and reconstruct the designated regions' panoramic views.

Design of optical fiber-scanning mechanism
This research employs a flexible optical fiber, a fiber-scanning mechanism, and image sensing and storage devices to develop the system. The prototyped scanning mechanism drives the optical fiber carrier to move in two directions, allowing the image-acquiring fiber to scan an inspected object and capture its images. The research utilizes a SolidWorks tool to design the optical fiber-scanning mechanism and fabricates the device using a 3D printer. Two servomotors convert their rotational power into linear movements through two gear-and-rack sets for the mechanism. With the 3D printer fabrication capacity, size limit, and movement accuracy, the research applies a gear-and-rack movement formula as l = z( θ/360 • )πm for the mechanism motions, where θ is the gear's rotation angle, l is the rack's displacement, z is the number of gear teeth, and m is the gear's modulus. The relationship between the number of gear teeth, z, and the pitch circle diameter, d, is m = d/z. The above two formulas imply that rotating every 1 • for the gear drives its corresponding rack to move 0.2 mm linearly. The system employs a controller board to drive the two servomotors using PWM signals for the two gear-rack pairs. In experiments, each servo motor rotates within a range of 180 • to drive the corresponding rack on moving 43.92 mm translationally. Thus, the servomotors own a driving resolution of 244 µm deg −1 for the mechanism. Furthermore, the controller issues four preset 1.5 ms width pulses for 1 • angular rotation of the servomotors. Hence, the mechanism assumes the linear resolution of the moving racks is 61 µm/pulse applying the PWM signals from the controller.
The study uses the FDM (fused deposition modeling) 3D printer technique to fabricate the components for the moving mechanism since it is affordable among all 3D printer techniques (e.g. SLA, DLP, and SLS) in most educational laboratories. The 3D printer's nozzle diameter and deposition process set the tolerance for all fabricated components to a minimum of 0.1 mm. The 3D printer employs tough PLA (polylactic acid) material, which owns a durable high-strength feature compared with regular PLA, to fabricate the components. In addition, the 3D printing implements a 100% solid fill rate with at least 5 mm thickness to accomplish the fabrications.
According to the 3D printer fabrication capability, the research set parameters for the matching gear and rack, as listed in table 1. Figure 1 shows the assembly of one pair 3D printed gearand-rack set and their tooth matching profiles. Using the theoretic gear clearance formula, j n = 2 sin φ · j r , where j r is the radial clearance of the matching tooth pair, is the pressure angle, the clearance in the normal direction for the tooth matching surfaces is j n = 2 sin 20 • · 0.1 mm = 0.068 mm for  a metal tooth pair with a circular pitch diameter of 28 mm. Based on the design conservation principle, this research has still assumed a backlash of 0.1 mm for the 3D printed gearrack pairs.
This study uses the parameter set to design the gear and rack assembly in a SolidWorks model. Figure 2 shows the solid model of the fiber-scanning mechanism, where the scanning mechanism drives an image-acquiring fiber carrier to perform scanning in vertical and horizontal directions. Also, figure 3 shows the perspective explosion view of the mechanism. Figure 4 shows another perspective view of that optical fiber-scanning mechanism, and figure 5 illustrates its explosion view. This study inserts one end of the optical fiber bundle throughout the needle housing to acquire images while moving the optical needle. The study also attaches the backend end  of the optical fiber bundle directly to a webcam's lens to store images captured from the fiber bundle's front end. Figure 6 shows the optical fiber-scanning mechanism prototype for acquiring scanned images of inspected regions.
It is feasible to prototype an alternative mechanism design for applications, as illustrated in figure 7. The pricey alternative scheme employs two high-precision linear piezo actuators to carry the fiber-scanning bundle. The piezo actuators could stroke up to 74.5 mm linearly with a resolution of 4.5 µm, and a linear velocity of 24 mm s −1 with a continuous force of 6.5 N. Since the fiber bundle is light for the linear piezo actuators to transport without the webcam on the platform, the alternative fiber-scanning mechanism could move and respond fast to accomplish the image scanning task using high-voltage voltage sources. Also, there would be no gearrack pairs built in the illustrated alternative to avoid transmission and assembly errors.

Fiber-acquired segmented Image processing
The image acquiring bundle has a diameter of 800 µm, filled with optical fibers having a diameter of 100 µm. Thus, about sixty-four optical fibers are encircled in an image acquiring bundle, with an estimated 75% filling rate for the 800 µm cable, and each optical fiber owns a NA (numerical aperture) of 0.37. Figure 8 illustrates the composition of the optical fiber bundle and the mechanism transmitting image signals to its backend from its scanning an object at the frontend.
The bundle consists of 100 µm diameter optical fibers, couples directly to a webcam, owns a 720 dpi CMOS image sensor, and performs proximity scanning, as shown in figure 9. The optical mechanism can resolve light intensity variations for more than 35.2 µm displacing of each optical fiber. It also implies one optical fiber acquired image maps to 2.64 pixels on the CMOS sensor chip. Note that the servomotors theoretically drive the racks at a 61 µm/pulse resolution, which is small than the optical fiber diameter of 100 µm.
With an optical fiber bundle installed on the scanning mechanism, the acquisition device captures images and retains necessary image portions after image cropping. Because a probing needle wrapping the optical fibers has a tilted-andsharpened terminal, which owns an angled incline of 20 • between its acquired input image and its processed output image, as shown in figure 10. Hence, image rotation processing executes immediately on the captured images to recover their corresponding corrected ones.
Upon obtaining the multiple corrected images and storing them into temporary memory divisions, the system executes image preprocessing and synthesizing processes through the embedded firmware, and FPGA hardware exports the panoramic images to complete the entire process.

Image registration.
The study maintains the system's optical background during the laboratory experiments, and the prototype system carries out the experiments on an optical table. The optical fiber captures test sample images for subsequent feature-based processing to perform image stitching. This research mainly adopts the feature-based method and uses translation, rotation, scaling and other basic linear affine transforms in the image registration processes. The study focuses on controlling the moving mechanism to acquire consecutive images for subsequent image stitching, expanding the inspected views in small regions for biomedical usages. The research realizes that once implementing the prototype in practical applications to generate panoramic images, it is necessary to consider advanced image registration approaches and intense analysis.

Image cropping, translation, rotation, and zooming.
Each optical fiber captured image includes the inspected object and its surrounding area. By setting a target window over the inspected area, the system cuts off irrelevant image portions first, with only image pixels inside the window included. Then, the system performs spatial image transformations, which convert original image pixel coordinates to their corresponding new coordinates with nearest-neighbor gray level. By embedding the firmware for image scaling, translation, and rotation operations in an FPGA high-speed hardware, as shown in figure 11, the system achieves acquiring/processing/synthesizing multiple images as the fiber-scanning mechanism moves on designated trajectories.

Image stitching.
The optical fiber-scanning motions cause the acquired images to blur to a certain degree and demand image sharpening during the optical fiber-scanning stage. However, only small portions of the acquired images need to perform subsequent image-stitching and smoothing processes during the scanning stage. Image stitching integrates two or more (including partially overlapping) images into a panoramic image, and the calculation process consists of image matching, image synthesis, and setting camera parameters.
Researchers usually acquire images with slight gaps by shooting the same target with different cameras or exposures [35]. Capturing the multiple images occurs from different cameras or exposure sources, and thus it demands adjusting the camera parameters and performing image averaging consistently. Hence, people opting for a fixed camera and exposure reduce processing difficulties for the multiple acquired images of the same target and appeal for image matching when the application conditions request.
Various feature point search and description methods and subsequent image matching include feature point calculation and matching. The ORB calculation approach combines the FAST technique to detect feature points and the BRIEF strategy to calculate descriptors. Its application significantly saves the calculation space and speeds up the calculation speed, suitable for the image acquisition needs of this study's micro-motion moving mechanism. Hence, this research employs the ORB discrimination method, which determines matching features in adjacent images for the subsequent stitching processes.
Before the image stitching process, sharpening the acquired images enhances the noises, since merely intensifying the    blurred images helps also emphasizes image noises significantly. Therefore, blurring the images first and followed by sharpening avoid noise enhancement problems. Human eyes tell no noticeable differences using the sharpening approach, but the strategy intensifies the image features and helps improve subsequent image synthesizing performance. This study performs image boundary fusion processes for the acquired segmented images during the optical mechanism motion, including feathering, smoothing, blurring the areas on both sides of the seam lines between adjacent segmented images, and softening and naturalizing the image portions aside the seam lines.

Resolution test for moving the optical fiber
The image resolution of an optical mechanism refers to the CMOS chip resolution or screen display resolution, and it is evident that the two definitions for the described objects are different and not exchangeable. Therefore, this study tests the resolution of the CMOS sensor for acquiring target images directly. The research team employs a 1951 USAF resolution test sample, as shown in figure 12, to evaluate the image-acquiring capability in resolution for the optical mechanism.
The 1951 USAF resolution standard was established in 1951 by the American Air Force, and it aims to testify the resolving power of optical systems. A 1951 USAF test sample owns several straight short lines and arranges the line groups from larger to smaller sizes in an array shape. By examining the short lines group by group through an optical mechanism, the first group with acquired images exhibiting distorted lines determines the imaging system's maximum resolving power. People calculate the resolution of an imaging system as follows: where R is the optical resolution (resolving power of the optical imaging system), and R owns its unit in line pairs per millimeter, i.e. lp mm −1 . G represents the group number, as illustrated by the red box in figure 13, and E is the element number denoted by the blue circle in figure 13.
According to equation (1), each frame in figure 13 represents a corresponding optical resolution. Experiments using the 1951 USAF resolution test sample result in their corresponding data are in table 2. The test's resolution range is 1 lp mm −1 Figure 11. Image processing procedures for fiber-acquired segmented images.  to 228 lp mm −1 . For example, the yellow circle in figure 13 represents the first unit of group zero, corresponding to a resolution of 1 lp mm −1 , i.e. the image-acquiring system has the power to distinguish a 0.5 mm broad line from a 0.5 mm gap within 1 mm.
From experimental results, figures 14 (a)-(d) show the optical fiber acquired images, respectively, with different groups and units utilized. All six pair units in the 3rd group demonstrate clear images, but each pair unit's images in the 4th group show blurred results. Then, this research employs the 3rd group of the resolution test sample to carry out subsequent image acquisition using the optical means. It implies that the employed 100 µm diameter optical fibers can transmit image signals with a resolution power of 14.30 lp mm −1 , and 34.5 µm is a differentiate scale for that setup. Thus, the experiment uses the 1951 USAF standard optical test piece to scan the scaled patterns and obtains a linearity scanning error of 69.9 µm. Linear scanning repeatability is 99.54% for the optical mechanism.
Note that the mechanical tolerances of the fabricated components and servomotor structures confine the optical resolution for the moving mechanism, and the optimal theoretic resolution is calculated as 61 µm. However, from experiments, the prototyped optical mechanism differentiates the 14.3 lp mm −1 pattern on the 1951 USAF optical resolution specimen. It implies that the experimental optical resolution is approximately 69.9 µm, close to the optimal theoretic resolution.

Image registration comparison and test for matching features
This study uses the central image and right-middle partial images of the 1951 USAF test sample in figure 12, as images A and B, respectively, with overlapping regions included, aiming to compare various registration methods for the subsequent stitching process. Figure 15 shows the corresponding two image portions.
The FAST registration for image A and image B results in 254 and 266 feature points, respectively, as shown in figure 16, and obtains a set of 90 FAST matching features to extract for panoramic image processing.
The ORB registration for segmented images A and B results in 880 and 514 feature points, respectively, and obtains a set of 127 ORB matching features, as shown in figure 17, to extract for panoramic image processing.
This research similarly tests other registration methods for the two segmented 1951 USAF test sample images. The maximally stable external regions (MSERs) registration for images A and B results in 595 and 784 feature points, respectively, and obtains a set of 107 MSER matching features. The binary robust invariant scalable keypoints (BRISK) registration for images A and B results in 424 and 390 feature points, respectively, and obtains a set of 60 BRISK matching features. The speeded up robust features (SURFs) registration for images A and B results in 213 and 221 feature points, respectively, and obtains a set of 73 SURF matching features.
Furthermore, the Harris-Stephens registration for images A and B results in 185 and 175 feature points, respectively, and obtains a set of 69 Harris-Stephens matching features. The KAZE registration for images A and B results in 582 and 661 feature points, respectively, and receives a collection of 244 KAZE matching features. This study observes that the ORB    registration achieves more matching features for the two overlapped test images except for the KAZE registration approach. It facilitates the subsequent stitching process for the two adjacent images.

Verification for stitching segmented images with overlapping boundaries included
During the evaluation stage for the image synthesizing process, a sample image obtained from the 1951 USAF resolution test is segmented into nine small partial images with overlapped adjacent regions, as shown in figure 18. All image segments own different outline boundaries. With the coded firmware embedded, an FPGA board imports adjacent partial images of the 1951 USAF sample each time and executes cropping, rotating, blurring, sharpening, matching, and stitching using the developed strategies. The 1st imported group consists of ID-01 ∼ ID-09 partial images, the 2nd group contains ID-01 ∼ ID-08 partial images, the 3rd group contains ID-01 ∼ ID-06 partial images, and the 4th group contains ID-01 ∼ ID-04 and ID-06 ∼ ID-09 partial images. Table 3 shows the obtained panoramic images after performing the developed strategy for image processing in  groups. The embedded FPGA board processes the 2nd group using eight partial images (images ID-01 ∼ ID-08), in which a rectangular gap exists at the lower right corner of the panoramic image boundary. It is evident that the processed 1st group (images ID-01 ∼ ID-09) exports a panoramic image holding the same complete rectangle as the original one, and the image synthesis results in an image that is the same as the original one without any distortion. The image synthesis result confirms the same effectiveness as the experiment result for the 1st group, and the panoramic image displays a black gap at the ID-09 position of the complete original one. The resulting panoramic image matches the given image group without distortion. The experiment's 3rd group (images ID-01 ∼ ID-06) owns no partial images below the boundary and leaves an entirely blank space. The image synthesis result also shows no distortion, and black portions  Hence, this study verifies that the developed system satisfies the matching feature point requirement for multiple images and owns acceptable synthesizing performance to restore segmented images to their original ones. The moving mechanism inevitably demands the developed image processing strategy during the optical fiber-scanned motion, when the optical fibers acquire multiple images to form a panoramic view for an examined object.

Integration of image processing embedded board and optical fiber-scanning mechanism
The system scans the third group of the 1951 USAF resolution test sample by controlling the optical fiber-scanning mechanism, starting from unit 1 to unit 6. The test process controls the motors' rotations for moving the optical fiber to scan. The embedded FPGA executes image acquisition at a frequency of one image per degree of rotation. The blue circled area in figure 19 denotes the 3rd group of the sample that the prototyped optical fiber moving mechanism scans.
By exercising the image acquisition during fiber-scanning and performing image cropping, rotation, blurring, and sharpening simultaneously, the system obtains the consecutively segmented images with a pixel size of 36 × 36, each shown in figure 20.
Performing direct image stitching only on the optical fiberacquired multiple images results in a panoramic image shown in figure 21(a). Alternatively, figure 21(b) shows a panoramic image from performing blurring and sharpening first followed by image stitching, and it demonstrates a better resolution than the corresponding directly stitched one.
The research confirms through the 1951 USAF optical resolution test sample, as shown in figure 21, the developed prototype effectively generates stitched panoramic images for small image regions using optical fiber scanning.

Conclusion and discussion
The developed system utilizes an image acquisition device to import fiber-acquired images during the fiber-scanning process. Image noises induced from fiber-scanning motions are reduced significantly through image cropping, rotation, blurring, and sharpening processes. The subsequent image stitching process upgrades the synthesis performance for multiple partial images and achieves smoothing effectiveness. Furthermore, identifying image feature points among multiple images improves subsequent processing considerably. The resolution tests verify that the prototype optical mechanism's best image resolution reaches 14.30 lp mm −1 . Thus, the achievable image resolution for an inspected object is 35 µm, close to most cells with a diameter of 20 µm ∼ 100 µm in organisms. Hence, the developed system successfully obtains panoramic images for inspected objects by moving the mechanism to acquire images through the fiber bundle.
For the 800 µm diameter fiber bundle to scan an area of 43.92 × 43.92 mm 2 with a PWM driving frequency of 50 Hz, which issues the 1.25 ms PWM signals, it takes 790 s to accomplish the task. Employing servomotors with improved resolutions to support PWM commands using faster frequencies would facilitate the scanning speed. The prototype can maintain the acquired image resolutions using the high-speed FPGA processing board.
The moving mechanism could have multiple error sources, such as that, conservatively estimated without manual polishment or adjustment, the control error of the servo motors is 61 µm, the manufacturing error of the 3D printing is 100 µm, and the installation error of the mechanism is 100 µm. The transmission error of the gear-rack pairs is 68 µm. The gear and rack's tooth bending deformation error is negligible since the fiber-scanning load is low and the 3D tough PLA material's tensile modulus is more significant than 50 MPa. The Gaussian calculation reaches a resultant error of roughly 92 µm, assuming the errors are random and uniformly distributed. The error analysis estimates the position accuracy of the optical fiber while scanning, and its deviation might occur from the target in the prescribed region. This study's experiments using the 1951 USAF resolution test sample show that the achievable image resolution verifies as 35 µm with a slow mechanism motion, and the moving mechanism is fixed on an optical table to isolate environmental isolations. The experiments show that the error analysis prompts a resultant error estimate for the prototyped moving mechanism.
This research realizes that cumulative tolerances generate during the gear-rack and assembly operations, which cause the image to distort during the scanning. By elaborating image processing and installing linear optical encoders on the mechanism, improves the optical fiber positioning accuracy and solves this progressive error problem. Thus, the optical encoders installed can avoid the gear-rack backlash errors and other assemble errors but significantly raise development expenditure. Furthermore, for the servomotor assembly options, using voice coil drivers can directly control the movements of the linear mechanism. Nevertheless, this research demonstrates a prototype using a moving mechanism to transport an endoscope device at a lower cost.

Data availability statement
All data that support the findings of this study are included within the article (and any supplementary files).