## 3 Methodology
### Dynamic Region Depth Estimation
#### 3.1.1 Identification of Dynamic Regions  
The first step in depth estimation for dynamic regions is identifying the regions of the scene where motion is occurring. These regions typically correspond to moving objects, such as vehicles, humans, or animals. The dynamic depth estimation network operates on the masked input \(M_{\rm dyn}\odot I_{r}\) where \(M_{\rm dyn}\) is the motion mask and \(I_{r}\) is the reference frame. The network is designed as a convolutional encoder-decoder architecture, optimized for depth prediction within dynamic regions. Object motion cues from the optical flow field are incorporated into the network input, allowing for improved depth estimation by leveraging motion patterns. The loss functions used for training include photometricreconstruction loss, edge-aware depth smoothness loss, and a scale-alignment loss specific to dynamic regions. To isolate these dynamic regions, we rely on a combination of motion masks and optical flow-based object detection. The motion mask \(M_{dyn}\) is generated by detecting pixel-wise changes in object position between consecutive frames of the monocular video sequence. The mask highlights regions where significant motion is detected, allowing us to isolate dynamic objects from the static background. This is performed by computing the optical flow between the reference frame \(I_{r}\) and the source frame \(I_{s}\), identifying pixels where the motion is large enough to indicate a moving object. To generate the motion mask, we compute the optical flow \(F\) between consecutive frames using a pre-trained optical flow model. The flow field \(F\) provides a vector for each pixel in the reference image, indicating the direction and magnitude of motion:  
\[F(x,y)=(u(x,y),\;u(x,y)) \tag{1}\]  
where \(u\) (_x,y_) and \(v\) (_x,y_) represent the horizontal and vertical components of motion, respectively, at pixel (_x,y_). We apply a threshold \(T_{motion}\) to the magnitude of the optical flow vectors to determine which regions of the image correspond to moving objects:  
\[M_{dyn}(x,y)= \begin{cases}1&if\sqrt{u(x,y)^{2}+u(x,y)^{2}>T_{motion}},\\ 0&otherwise\end{cases}  \tag{2}\]  
The resulting binary mask \(M_{dyn}\) marks the dynamic regions where significant motion occurs, and these regions are passed to the dynamic depth estimation network for further processing. Once the dynamic regions have been identified, the next step is to estimate the depth for these moving objects independently from the static background. Depth estimation for dynamic objects presents two major challenges: object motion and scale ambiguity. In our framework, we address these challenges by treating the depth estimation of dynamic objects as a separate task from the depth estimation of static regions. For each dynamic object identified by the motion mask \(M_{dyn}\), we predict its depth using a dedicated dynamic depth estimation network \(\Theta_{dyn}\). This network operates only on the regions where motion is detected, using the masked input \(M_{dyn}\odot I_{r}\), where \(\odot\) represents element-wise multiplication, and \(I_{r}\) is the reference frame. The dynamic depth estimation network outputs a depth map \(D_{dyn}\) for the moving objects:  
\[D_{dyn}=\Theta_{dyn}\Big{(}M_{dyn}\odot I_{r}\Big{)} \tag{3}\]  
This network is designed to handle depth predictions for objects that move independently of the camera, such as cars or people in a driving scene. Instead of relying on camera motion alone, this network also incorporates object motion cues derived from the motion mask. In dynamic scenes, the relative motion of objects and the camera creates major challenges for monocular depth estimation. It becomes especially difficult to maintain consistency between consecutive frames. To address this, our framework leverages the object motion cues provided by the optical flow field. These cues are used to inform the depth estimation network about the motion patterns of individual objects, allowing for more accurate depth predictions.