# \#Python

**URL:** https://www.robotexchange.io/tag/python/6.md

[Latest](https://www.robotexchange.io/latest.md) · [Categories](https://www.robotexchange.io/categories.md) · [Tags](https://www.robotexchange.io/tags.md)

---

## [How to plan a basic vision-based quality control system](https://www.robotexchange.io/t/how-to-plan-a-basic-vision-based-quality-control-system/4748)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 1\
**Last updated:** [November 12, 2026, 9:48pm UTC](https://www.robotexchange.io/t/how-to-plan-a-basic-vision-based-quality-control-system/4748 "2026-11-12T21:48:26Z")

</div>

Based on contributions by anarueda. Before writing any detection code, it helps to plan a vision-based quality control (QC) system as a sequence of well-defined stages. This how-to is a workflow overview, not a specific…

---

## [Webcam calibration for robot coordinate mapping](https://www.robotexchange.io/t/webcam-calibration-for-robot-coordinate-mapping/4997)

<div class="topic-metadata">

**Author:** [@ThijsKeijzer](https://www.robotexchange.io/u/ThijsKeijzer)\
**Replies:** 1\
**Last updated:** [November 12, 2026, 8:55pm UTC](https://www.robotexchange.io/t/webcam-calibration-for-robot-coordinate-mapping/4997 "2026-11-12T20:55:48Z")

</div>

How-to: Webcam calibration for robot coordinate mapping This manual describes the complete procedure for calibrating a webcam and establishing a coordinate transformation between the camera coordinate system and the robo…

---

## [How to get an image from a GenICam-compatible camera (e.g. a Genie Nano) using Harvester](https://www.robotexchange.io/t/how-to-get-an-image-from-a-genicam-compatible-camera-e-g-a-genie-nano-using-harvester/4752)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:19am UTC](https://www.robotexchange.io/t/how-to-get-an-image-from-a-genicam-compatible-camera-e-g-a-genie-nano-using-harvester/4752 "2026-09-02T00:19:06Z")

</div>

Based on contributions by Jesse. Harvester is a vendor-neutral Python library for GenICam-compatible cameras, such as a Genie Nano. This how-to sets up a conda environment, installs a GenTL producer, and gets you to a f…

---

## [How to connect to a Daheng Imaging camera through Python](https://www.robotexchange.io/t/how-to-connect-to-a-daheng-imaging-camera-through-python/4751)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:19am UTC](https://www.robotexchange.io/t/how-to-connect-to-a-daheng-imaging-camera-through-python/4751 "2026-09-02T00:19:04Z")

</div>

Based on contributions by Joel. Daheng Imaging cameras can be accessed from Python either through Daheng’s own gxipy SDK, or through the vendor-neutral Harvester/GenICam library. This how-to covers both, so you have a f…

---

## [How to grab, save and filter depth images with Intel RealSense in Python](https://www.robotexchange.io/t/how-to-grab-save-and-filter-depth-images-with-intel-realsense-in-python/4750)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:19am UTC](https://www.robotexchange.io/t/how-to-grab-save-and-filter-depth-images-with-intel-realsense-in-python/4750 "2026-09-02T00:19:02Z")

</div>

Based on contributions by Mathijs. Once pyrealsense2 is installed (see How to install Intel RealSense librealsense and pyrealsense2 on a Raspberry Pi 5 (Ubuntu) if you’re on a Raspberry Pi), this how-to shows how to gra…

---

## [How to install Intel RealSense librealsense and pyrealsense2 on a Raspberry Pi 5 (Ubuntu)](https://www.robotexchange.io/t/how-to-install-intel-realsense-librealsense-and-pyrealsense2-on-a-raspberry-pi-5-ubuntu/4749)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-install-intel-realsense-librealsense-and-pyrealsense2-on-a-raspberry-pi-5-ubuntu/4749 "2026-09-02T00:18:59Z")

</div>

Based on contributions by ThomasPSluijs. The prebuilt pyrealsense2 wheels on PyPI don’t support the Raspberry Pi’s ARM architecture, so on a Raspberry Pi 5 running Ubuntu you need to build librealsense (Intel’s RealSens…

---

## [How to segment objects with SAM 3 using text prompts in Python](https://www.robotexchange.io/t/how-to-segment-objects-with-sam-3-using-text-prompts-in-python/4747)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-segment-objects-with-sam-3-using-text-prompts-in-python/4747 "2026-09-02T00:18:55Z")

</div>

Based on contributions by Tim. SAM 3 is Meta’s open-vocabulary segmentation model. Instead of clicking on an object or drawing a bounding box, you describe what you’re looking for in plain text, "red cylinder", "gripper…

---

## [How to detect transparent glass using a reference object and OpenCV](https://www.robotexchange.io/t/how-to-detect-transparent-glass-using-a-reference-object-and-opencv/4746)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-detect-transparent-glass-using-a-reference-object-and-opencv/4746 "2026-09-02T00:18:52Z")

</div>

Based on contributions by YoussefO. Transparent glass is very hard to detect directly with a camera: it has almost no visible contour of its own. The workaround is to not detect the glass directly. Instead, detect a ref…

---

## [How to split a contour into separate regions with OpenCV](https://www.robotexchange.io/t/how-to-split-a-contour-into-separate-regions-with-opencv/4745)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-split-a-contour-into-separate-regions-with-opencv/4745 "2026-09-02T00:18:50Z")

</div>

Based on contributions by gamalalfauza. OpenCV’s contour finder treats a single connected shape as one contour. If you need to treat two touching or overlapping parts of that shape as separate regions (for example, to m…

---

## [How to detect objects by colour using HSV filtering in OpenCV](https://www.robotexchange.io/t/how-to-detect-objects-by-colour-using-hsv-filtering-in-opencv/4744)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-detect-objects-by-colour-using-hsv-filtering-in-opencv/4744 "2026-09-02T00:18:48Z")

</div>

Based on contributions by Glenn. If the objects you need to detect are a distinct, consistent color, filtering by HSV (hue, saturation, value) is a fast and simple alternative to a full object-detection model. This how-…

---

## [How to detect multiple data matrix codes fast using threading in Python](https://www.robotexchange.io/t/how-to-detect-multiple-data-matrix-codes-fast-using-threading-in-python/4743)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-detect-multiple-data-matrix-codes-fast-using-threading-in-python/4743 "2026-09-02T00:18:45Z")

</div>

Based on contributions by Jasmijn. Decoding a single data matrix code is slow enough that decoding many of them (for example 50 pre-defined regions on one 4K image) one after another can take a noticeable amount of time…

---

## [How to zoom into an image or video frame with OpenCV using array slicing](https://www.robotexchange.io/t/how-to-zoom-into-an-image-or-video-frame-with-opencv-using-array-slicing/4742)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-zoom-into-an-image-or-video-frame-with-opencv-using-array-slicing/4742 "2026-09-02T00:18:43Z")

</div>

Based on contributions by Jasmijn. “Zooming in” on part of an image in OpenCV doesn’t need any special function, it’s just cropping a rectangle out of the image array. This how-to explains why that works and gives copy-…

---

## [How to detect and generate fiducial markers, barcodes, QR codes and data matrix codes with OpenCV](https://www.robotexchange.io/t/how-to-detect-and-generate-fiducial-markers-barcodes-qr-codes-and-data-matrix-codes-with-opencv/4741)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-detect-and-generate-fiducial-markers-barcodes-qr-codes-and-data-matrix-codes-with-opencv/4741 "2026-09-02T00:18:41Z")

</div>

Based on contributions by Personnel. There are several types of machine-readable codes and markers you can use in a vision project: 1D barcodes and QR codes for storing information, data matrix codes for very dense smal…

---

## [How to calibrate a camera and convert a pixel distance to a real-world distance](https://www.robotexchange.io/t/how-to-calibrate-a-camera-and-convert-a-pixel-distance-to-a-real-world-distance/4740)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-calibrate-a-camera-and-convert-a-pixel-distance-to-a-real-world-distance/4740 "2026-09-02T00:18:39Z")

</div>

Based on contributions by LoukasLeftheriotis. Standard OpenCV chessboard calibration removes lens distortion and gives you a camera matrix. Combined with a known chessboard square size, you can then turn a measured pixe…

---

## [How to convert a RealSense camera pixel to a 3D point and robot coordinates](https://www.robotexchange.io/t/how-to-convert-a-realsense-camera-pixel-to-a-3d-point-and-robot-coordinates/4738)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-convert-a-realsense-camera-pixel-to-a-3d-point-and-robot-coordinates/4738 "2026-09-02T00:18:34Z")

</div>

Based on contributions by salvacmp. For pick-and-place at varying heights, a flat-plane homography isn’t enough — you need real depth. An Intel RealSense depth camera gives you per-pixel depth, so you can deproject any …

---

## [How to do high-precision robot-camera calibration with ArUco markers](https://www.robotexchange.io/t/how-to-do-high-precision-robot-camera-calibration-with-aruco-markers/4737)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-do-high-precision-robot-camera-calibration-with-aruco-markers/4737 "2026-09-02T00:18:32Z")

</div>

Based on contributions by BramHeerschap. When you’re handling small parts, small camera-to-robot misalignment causes real positioning errors. This method splits the calibration into two independent stages — camera→board…

---

## [How to calibrate a fixed camera to a robot with a single ArUco marker](https://www.robotexchange.io/t/how-to-calibrate-a-fixed-camera-to-a-robot-with-a-single-aruco-marker/4736)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-calibrate-a-fixed-camera-to-a-robot-with-a-single-aruco-marker/4736 "2026-09-02T00:18:29Z")

</div>

Based on contributions by sarahstam. The fastest way to get a fixed, top-down camera talking to a robot in the same units: print one ArUco marker, use its known physical size as a ruler, and record a single offset betwe…

---

## [How to map camera coordinates to robot coordinates with a least-squares fit](https://www.robotexchange.io/t/how-to-map-camera-coordinates-to-robot-coordinates-with-a-least-squares-fit/4735)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-map-camera-coordinates-to-robot-coordinates-with-a-least-squares-fit/4735 "2026-09-02T00:18:27Z")

</div>

Based on contributions by Jawara. If you don’t want to run a full lens/camera calibration, you can fit a 2D transform (rotation, scale and translation combined) directly from a handful of camera-coordinate ↔ robot-coord…

---

## [How to calibrate a camera and map pixels to world coordinates with a ChArUco board](https://www.robotexchange.io/t/how-to-calibrate-a-camera-and-map-pixels-to-world-coordinates-with-a-charuco-board/4734)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-calibrate-a-camera-and-map-pixels-to-world-coordinates-with-a-charuco-board/4734 "2026-09-02T00:18:25Z")

</div>

Based on contributions by MathijsCok. This is the full pipeline: print a ChArUco board, use it to calibrate your camera’s lens (intrinsics + distortion), then collect pixel↔world point pairs to build a homography that c…

---

## [How to install and control a Robotiq gripper on a UR robot](https://www.robotexchange.io/t/how-to-install-and-control-a-robotiq-gripper-on-a-ur-robot/4732)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:18am UTC](https://www.robotexchange.io/t/how-to-install-and-control-a-robotiq-gripper-on-a-ur-robot/4732 "2026-09-02T00:18:20Z")

</div>

Based on contributions by Ilmar. This guide covers mounting a Robotiq 2-finger gripper (tested with Hand-E) on a UR robot arm, wiring it to a PLC, and controlling it both from the teach pendant (via URCap) and from an e…

---

## [How to control a UR robot from Python with RTDE (ur\_rtde library)](https://www.robotexchange.io/t/how-to-control-a-ur-robot-from-python-with-rtde-ur-rtde-library/4723)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-control-a-ur-robot-from-python-with-rtde-ur-rtde-library/4723 "2026-09-02T00:17:59Z")

</div>

Based on contributions by Mark.jensen. Use RTDE (Real-Time Data Exchange) when you want to control a UR robot from Python directly — for example driving it from a web interface or from calculations that happen outside P…

---

## [How to send and receive data between Python and a UR robot over a TCP/IP socket](https://www.robotexchange.io/t/how-to-send-and-receive-data-between-python-and-a-ur-robot-over-a-tcp-ip-socket/4722)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-send-and-receive-data-between-python-and-a-ur-robot-over-a-tcp-ip-socket/4722 "2026-09-02T00:17:56Z")

</div>

Based on contributions by Ihsan, pauladelahoz, Thanusan\_Thurairajah, Dave\_Vermeulen, How-to. Use this method when you want to exchange data between a Python program on your PC and a UR robot — for example sending coordi…

---

## [How to install ROS2 Humble and program a Doosan cobot in Python](https://www.robotexchange.io/t/how-to-install-ros2-humble-and-program-a-doosan-cobot-in-python/4720)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-install-ros2-humble-and-program-a-doosan-cobot-in-python/4720 "2026-09-02T00:17:52Z")

</div>

Based on contributions by Roos. Programming a Doosan cobot directly is awkward. Controlling it through ROS2 instead lets you simulate your program without needing access to the physical robot, and use regular Python lib…

---

## [How to install ROS2 Jazzy and MoveIt2 to control a Universal Robots cobot](https://www.robotexchange.io/t/how-to-install-ros2-jazzy-and-moveit2-to-control-a-universal-robots-cobot/4719)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-install-ros2-jazzy-and-moveit2-to-control-a-universal-robots-cobot/4719 "2026-09-02T00:17:49Z")

</div>

Based on contributions by aron. Controlling a Universal Robots cobot through ROS2 and MoveIt2 has a reputation for being difficult, mostly because the official documentation is spread across several sites. This guide co…

---

## [How to install and use Codeium and Pylance in VS Code](https://www.robotexchange.io/t/how-to-install-and-use-codeium-and-pylance-in-vs-code/4715)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-install-and-use-codeium-and-pylance-in-vs-code/4715 "2026-09-02T00:17:39Z")

</div>

Based on contributions by Tijmenfeitz. Codeium and Pylance are two Visual Studio Code extensions that speed up Python development: Codeium suggests and generates code as you type, and Pylance highlights errors in your c…

---

## [How to style a Tkinter interface, and how to switch to CustomTkinter](https://www.robotexchange.io/t/how-to-style-a-tkinter-interface-and-how-to-switch-to-customtkinter/4714)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-style-a-tkinter-interface-and-how-to-switch-to-customtkinter/4714 "2026-09-02T00:17:37Z")

</div>

Based on contributions by Erik\_Endlich, Daan1. A default Tkinter interface looks dated out of the box. This guide shows how to style plain Tkinter widgets with colors, fonts, and the ttk module, and how to get a modern …

---

## [How to create a graphical interface in Python with Tkinter](https://www.robotexchange.io/t/how-to-create-a-graphical-interface-in-python-with-tkinter/4713)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-create-a-graphical-interface-in-python-with-tkinter/4713 "2026-09-02T00:17:34Z")

</div>

Based on contributions by LuisdeSantiago. Tkinter is Python’s built-in GUI toolkit. Use it to build a simple desktop control panel (buttons, labels, dropdowns) without installing anything extra. This guide covers the ba…

---

## [How to create a simple web interface for a system using Python and Flask](https://www.robotexchange.io/t/how-to-create-a-simple-web-interface-for-a-system-using-python-and-flask/4712)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-create-a-simple-web-interface-for-a-system-using-python-and-flask/4712 "2026-09-02T00:17:32Z")

</div>

Based on contributions by Naman. Use a web interface when you need to control a system remotely from a browser instead of (or in addition to) physical buttons and switches. This guide shows the smallest possible example…

---

## [How to build an industrial dashboard with Vue and Flask](https://www.robotexchange.io/t/how-to-build-an-industrial-dashboard-with-vue-and-flask/4711)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-build-an-industrial-dashboard-with-vue-and-flask/4711 "2026-09-02T00:17:30Z")

</div>

Based on contributions by Boaz. Build a browser-based dashboard for a robot cell or automated system when a terminal is no longer good enough — for example to show camera feeds, joint angles, and start/stop controls to …

---

## [How to build a multi-client TCP server in Python](https://www.robotexchange.io/t/how-to-build-a-multi-client-tcp-server-in-python/4710)

<div class="topic-metadata">

**Author:** [@thijs](https://www.robotexchange.io/u/thijs)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 12:17am UTC](https://www.robotexchange.io/t/how-to-build-a-multi-client-tcp-server-in-python/4710 "2026-09-02T00:17:27Z")

</div>

Based on contributions by Luthfiandra. Use this when several clients — for example a laptop and a robot controller — need to talk to the same Python server over the network at the same time, and messages from one client…

[Next page](https://www.robotexchange.io/tag/python/6.md?match_all_tags=true&page=1&tags%5B%5D=Python)
