# Inspecting a PCB

With Easy3D, it is possible to use depth maps for PCB inspection. This section presents a simple detection of missing or misplaced components on a PCB. The processing is done entirely with 2D images but use depth maps as inputs.

The workflow is as follow:

1. Perform a 3D acquisition or create the depth map with software laser line extraction ([`ELaserLineExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1ELaserLineExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1ELaserLineExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1ELaserLineExtractor.html) class). Retrieve the grayscale image corresponding to the depth map ([`EDepthMap8::AsEImage`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EDepthMap8.html#a5919b443b7e559a98cbe6d59a5eead8d) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EDepthMap8.html#a644244c8308ad1692fd653e9ff98a392) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EDepthMap8.html#a1440fb06259fdfec6e5d5e6c21f235fc) method).
2. Align the image using fiducial markers ([`EMatcher`](../../doxygen_cpp/classeVision_1_1EMatcher.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EMatcher.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EMatcher.html) class).
3. Search for the PCB plane and subtract it from the aligned image, only the components and the connectors remain ([`EasyImage::Oper`](../../doxygen_cpp/classeVision_1_1EasyImage.html#adf314c42c92233ca337668250125375e) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EasyImage.html#afcbccbf75626021b9a80ae1f9978eac4) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EasyImage.html#ad2662856c57834c7b067d0b4a957d097) function with parameter [`EArithmeticLogicOperation_Subtract`](../../doxygen_cpp/namespaceeVision.html#aebf26b10397a83bd42f31e33b5d59d83) [<sub>.NET</sub>](../../doxygen_cs/namespaceeVision.html#a42668c67c44fbf0785f8d727ecf9963d) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EArithmeticLogicOperation.html)).
4. Compare the processed image to a golden sample to detect missing or misplaced components ([`EasyImage::Oper`](../../doxygen_cpp/classeVision_1_1EasyImage.html#adf314c42c92233ca337668250125375e) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EasyImage.html#afcbccbf75626021b9a80ae1f9978eac4) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EasyImage.html#ad2662856c57834c7b067d0b4a957d097) with parameter [`EArithmeticLogicOperation_Compare`](../../doxygen_cpp/namespaceeVision.html#aebf26b10397a83bd42f31e33b5d59d83) [<sub>.NET</sub>](../../doxygen_cs/namespaceeVision.html#a42668c67c44fbf0785f8d727ecf9963d) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EArithmeticLogicOperation.html) or [`EChecker`](../../doxygen_cpp/classeVision_1_1EChecker.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EChecker.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EChecker.html)).

![image](assets/images/easy3d/pcb_3d_inspection.webp)![image](assets/images/easy3d/pcb_3d_inspection_1.webp)![image](assets/images/easy3d/pcb_3d_inspection_2.webp)![image](assets/images/easy3d/pcb_3d_inspection_3.webp)![](assets/images/easy3d/pcb_3d_inspection_4.webp)![](assets/images/easy3d/pcb_3d_inspection_3.webp)![image](assets/images/easy3d/pcb_3d_inspection_5.webp)
