xugaoxiang | 迷途小书童

Linux common commands-86: fsck

fsck command is used to check and repair file systems. After a sudden breakpoint of the system, when the system starts again, the file system check is also generally performed. Syntax format: fsck [parameter] file system Common parameters: Example # 检查分区/dev/sda5 fsck /dev/sda5 This article is reprinted from https://xugaoxiang.com/2022/07/19/linux-cmds-86-fsck/ This site is for inclusion only, […]

Linux common commands-86: fsck Read More »

Python utility module (32) pyserial

surroundings python 3.8 pyserial 3.5 foreword Serial port usage is an essential skill for embedded system development, and tools such as securecrt and putty are generally used to send and receive data. This article will introduce how to use the third-party library pyserial to perform serial data operations in the python environment. Install Install using

Python utility module (32) pyserial Read More »

Projective transformation in OpenCV

The affine transformations (translation, scaling, rotation, etc.) described above are all object transformations in two-dimensional space. If rotation occurs in three-dimensional space, then this transformation is a projection transformation. Projection transformation needs to first calculate the projection transformation matrix cv2.getPerspectiveTransform(src, dst) Among them, src and dst are both 4×2 two-dimensional matrices ( ndarray ), each

Projective transformation in OpenCV Read More »

ROI in OpenCV

ROI is the abbreviation of Region Of Interest , which refers to the region of interest in the image. Many times, we only operate on part of the area in the image. Example cv2.imshow(“original image”, image) h, w = image.shape[:2] # 获取ROI,/表示浮点数除法,返回值是float,而//表示整数除法cy = h // 2 cx = w // 2 # ROI区域提取roi = image[cy-200:cy+200,

ROI in OpenCV Read More »

Image Binarization in OpenCV

A binary image refers to an image with only two colors, black and white, where 0 represents black and 1 represents white (ie, 255). The general process of image binarization is to first convert the input image into a grayscale image, and then convert it into a binary image through the binarization method. This process

Image Binarization in OpenCV Read More »

Image Interpolation in OpenCV

In affine transformations, such as resize , interpolation has actually been used. When a picture is enlarged from 100 × 100 to 200 × 200, new pixels (red dots in the figure below) will be generated, and what is the new pixel value, this is what interpolation does. There are many interpolation algorithms supported by

Image Interpolation in OpenCV Read More »

Pixel normalization in OpenCV

Normalization is to limit the data to a certain range after processing. The purpose of normalization is to make incomparable data comparable while maintaining the relative relationship between them. The normalize method is used in opencv to achieve normalization, and its function prototype is as follows cv2.normalize(src, dst, alpha=None, beta=None, norm_type=None, dtype=None, mask=None) in: src:

Pixel normalization in OpenCV Read More »

Image rotation in OpenCV

The rotation of the image is very similar to the translation of the image, and is also implemented using cv2.warpAffine . The transformation matrix needs to be obtained through the cv2.getRotationMatrix2D function first, and its function prototype is cv2.getRotationMatrix2D(center, angle, scale) in center rotation center point coordinates angle The angle of rotation, the unit is

Image rotation in OpenCV Read More »

Image translation in OpenCV

Translation is the movement of the matrix. Usually, we need to define a transformation matrix , which is a matrix with 2 rows and 3 columns The tx and ty in the matrix represent the translation distance in the x and y directions, respectively The translation is implemented using the radial transformation function cv2.warpAffine ,

Image translation in OpenCV Read More »

Linux common commands-85: startx

startx command is used to start the X Windows system. X Windows is also known as X or X11 , and its main job is to display it graphically. Today’s popular GNOME and KDE desktop environments are based on the X Windows system. Syntax format: startx [parameter] Common parameters: Example # 启动X startx This article

Linux common commands-85: startx Read More »

Linux common commands-84: curl

curl is a file transfer tool that can be uploaded or downloaded, and supports common protocols such as HTTP , HTTPS , and FTP . Backend developers often use it to test web interfaces. Syntax format: chroot [parameter] Common parameters: Example # 获取网站源码curl https://xugaoxiang.com # 下载文件curl -O https://xugaoxiang.com/download/test.jpg # post上传文件curl -F ‘data=@path/to/local/file’ UPLOAD_ADDRESS # 以特定key参数上传文件curl

Linux common commands-84: curl Read More »

Linux common commands-83: chroot

The chroot command is used to change the root directory. The default root directory of the system is / . After a running process is chroot , its root directory will be explicitly mapped to a specified directory, and it will not be able to access files outside the specified directory. Executing chroot requires root

Linux common commands-83: chroot Read More »