我是 gRPC 框架的新手,我在我的 PC 上创建了一个示例客户端服务器(参考this)。
在我的客户端-服务器应用程序中,我实现了一个简单的 RPC
service NameStudent {
rpc GetRoll(RollNo) returns (Details) {}
}
Run Code Online (Sandbox Code Playgroud)
客户发送RollNo并接收他/她的详细信息,其中包括姓名、年龄、性别、父母姓名和 Roll No。
message RollNo{
int32 roll = 1;
}
message Details {
string name = 1;
string gender = 2;
int32 age = 3;
string parent = 4;
RollNo rollid = 5;
}
Run Code Online (Sandbox Code Playgroud)
实际的服务器和客户端代码是根据此处解释的示例代码改编的
现在我的服务器能够监听“0.0.0.0:50051(地址:端口)”,客户端能够在“localhost:50051”上发送卷号并接收详细信息。
我想查看客户端和服务器之间传输的实际二进制数据。我尝试过使用 Wireshark,但我不明白我在这里看到的是什么。
需要帮助理解此处的wireshark,或任何其他可用于查看二进制数据的方式。
我最近开始使用 openCV 和 python。我有一个项目,我使用findContours. 我得到大约 6-8 个轮廓,我在上面循环以获得适合轮廓的边界框。
为此,我使用了minAreaRect(contours)它给我应该适合轮廓的旋转矩形。现在这个命令的输出是一个元组列表。
每个元组看起来像这样((81.0, 288.0), (22.0, 10.0), -0.0)我无法得到关于每个数字的含义的任何描述?
我认为它可能是((x-coordinate, y-coordinate),(width, height), rotation)。
我是Python + OpenCV的新手,所以对于大多数人来说,这可能是一个基本问题,因为我在网上找不到很好/令人满意的解决方案。
所以我试图通过分别创建RGB层
R-0s
G-255s
B-255 * Identity矩阵来创建图像
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
Red = np.zeros([6, 6], dtype = np.uint8)
plt.imshow(Red) # it is just the red layer which is actually all black
plt.show()
Green = np.ones([6, 6], dtype = np.uint8) * 255
plt.imshow(Green) # it is just the Green layer which is actually all white
plt.show()
Blue = np.eye(6, dtype = int) * 255
plt.imshow(Blue) # it is just the Blue …Run Code Online (Sandbox Code Playgroud)