博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sap中泰国有预扣税设置吗_泰国的绘图标志| Python中的图像处理
阅读量:2529 次
发布时间:2019-05-11

本文共 2913 字,大约阅读时间需要 9 分钟。

sap中泰国有预扣税设置吗

A colored image can be represented as a 3 order matrix. The first order is for the rows, the second order is for the columns and the third order is for specifying the color of the corresponding pixel. Here we use the BGR color format(because OpenCV python library works on BGR format, not on RGB), so the third order will take 3 values of Blue, Green, and Red respectively. The values of the rows and columns depending on the size of the image.

彩色图像可以表示为3阶矩阵。 第一个顺序用于行,第二个顺序用于列,第三个顺序用于指定相应像素的颜色。 在这里,我们使用BGR颜色格式(因为OpenCV python库适用于BGR格式,而不适用于RGB),因此三阶分别采用蓝色,绿色和红色这3个值。 行和列的值取决于图像的大小。

In , we can use an OpenCV library named cv2. Python does not come with cv2, so we need to install it separately.

在 ,我们可以使用名为cv2的OpenCV库。 Python不随cv2一起提供,因此我们需要单独安装。

For Windows:

对于Windows:

pip install opencv-python

For Linux:

对于Linux:

sudo apt-get install python-opencv

Colour planes of BGR image:

BGR图像的彩色平面:

Consider a BGR image array I then,

考虑一个BGR图像阵列我然后,

  • I[:, :, 0] represents the Blue colour plane of the BGR image

    I [:,:,0]表示BGR图像的蓝色平面

  • I[:, :, 1] represents the Green colour plane of the BGR image

    I [:,:,1]表示BGR图像的绿色平面

  • I[:, :, 2] represents the Red colour plane of the BGR image

    I [:,:,2]表示BGR图像的红色平面

The flag of Thailand shows five horizontal stripes in the colors red, white, blue, white and red, with the central blue stripe being twice as wide as each of the other four.

泰国国旗显示五个水平条纹,分别为红色,白色,蓝色,白色和红色,中间的蓝色条纹的宽度是其他四个条纹的两倍。

Steps:

脚步:

  • First, we make a matrix of dimensions 600 X 800 X 3. Where the number of pixels of rows is 600, the number of pixels of columns is 800 and 3 is the color coding in BGR format.

    首先,我们制作一个尺寸为600 X 800 X 3的矩阵。当行的像素数为600时,列的像素数为800,而3为BGR格式的颜色编码。

  • Paint the first and the last strip with red. BGR is (49, 25, 165).

    用红色绘制第一条和最后一条。 BGR为(49,25,165)。

  • Paint the middle strip with blue. BGR is (72, 44, 45).

    用蓝色涂中间条。 BGR为(72,44,45)。

  • Paint the remaining two strips with white. BGR is (248, 245, 244).

    用白色油漆剩余的两个条。 BGR为(248、245、244)。

Python代码绘制泰国国旗 (Python code to draw flag of Thailand )

# Python3 code to draw Thailand flag # import numpy library as npimport numpy as np# import open-cv libraryimport cv2# here image is of class 'uint8', the range of values  # that each colour component can have is [0 - 255]# create a zero matrix of order 600x800 of 3-dimensionimage = np.zeros((600, 800, 3),np.uint8)# Painting the Red Strip image[:100,:,0] = 49;image[:100,:,1] = 25;image[:100,:,2] = 165;# Painting the White Strip image[100:200,:,0] = 248;image[100:200,:,1] = 245;image[100:200,:,2] = 244;# Painting the Blue Strip image[200:400,:,0] = 72;image[200:400,:,1] = 44;image[200:400,:,2] = 45;# Painting the white Strip image[400:500,:,0] = 248;image[400:500,:,1] = 245;image[400:500,:,2] = 244;# Painting the Red Strip image[500:600,:,0] = 49;image[500:600,:,1] = 25;image[500:600,:,2] = 165;# Show the image formedcv2.imshow("Thailand Flag",image);

Output

输出量

Drawing flag of Thailand | Image processing in Python

翻译自:

sap中泰国有预扣税设置吗

转载地址:http://fyxzd.baihongyu.com/

你可能感兴趣的文章
excel第一次打开报错 向程序发送命令时出错 多种解决办法含终极解决方法
查看>>
响应式web设计之CSS3 Media Queries
查看>>
实验三
查看>>
机器码和字节码
查看>>
环形菜单的实现
查看>>
Python 函数参数 传引用还是传值
查看>>
【解决Chrome浏览器和IE浏览器上传附件兼容的问题 -- Chrome关闭flash后,uploadify插件不可用的解决办法】...
查看>>
34 帧动画
查看>>
二次剩余及欧拉准则
查看>>
Centos 7 Mysql 最大连接数超了问题解决
查看>>
thymeleaf 自定义标签
查看>>
关于WordCount的作业
查看>>
C6748和音频ADC连接时候的TDM以及I2S格式问题
查看>>
UIView的layoutSubviews,initWithFrame,initWithCoder方法
查看>>
STM32+IAP方案 实现网络升级应用固件
查看>>
用74HC165读8个按键状态
查看>>
jpg转bmp(使用libjpeg)
查看>>
linear-gradient常用实现效果
查看>>
sql语言的一大类 DML 数据的操纵语言
查看>>
VMware黑屏解决方法
查看>>