Blog

Notes on robotics, vision, and systems.

【Learning OpenCV 4】Methods for Drawing Geometric Shapes

This article introduces methods for drawing rectangles, circles, lines, and ellipses with C++ and OpenCV 4. It focuses on the definitions of OpenCV built-in functions (such as rectangle(), circle(), line(), and ellipse()) and the role of each parameter, and provides example programs for reference. It also summarizes methods for drawing polygons, including the polygon-border drawing function polylines(), the polygon-filling function fillPoly(), the function for drawing multiple polygons drawContours(), and more.

[Learning OpenCV4] Image Channel Splitting, Merging, and Mixing Methods (C++)

After splitting image channels, the output multi-channel sequence is typically stored using std::vector mv;, where mv[0], mv[1], and mv[2] correspond to the three BGR channels respectively. However, what is displayed now is essentially three single-channel images—in other words, three grayscale images. To restore intuitive color to the three images, you need to use the channel merging method described below.