My applications needs to send a gRPC request from the WPF program to the
Python service, request data is an opencv mat The contents of my proto file
are as follows:
Service gRPCRecognition {
Rpc Compare (CompareRequest) returns (CompareReply) {}
}
Message CompareRequest {
Bytes CurrImage = 1;
Bytes ToolImage = 2;
}
Message CompareReply {
Bool IsMatched = 1;
}
In the wpf program I use opencvsharp to get the CurrImage from the camera,
and the ToolImage is read from the image file using opencvsharp. In the
python server, opencv is used to process the business. How do I convert
data on the client and server?
C# client code:
Private void sendRequest(Mat curr, Mat tool)
{
Var reply = client.Compare(new CompareRequest
{
CurrImage = // how to convert?
ToolImage = // how to convert?
});
}
python server code:
Class gRPCRecognition(Recognition_pb2_grpc.gRPCRecognitionServicer):
Def Compare(self, request, context):
Cv2.imshow('curr', /* how to convert */)
Cv2.imshow('user', /* how to convert */)
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/5dd52cef-c703-4cc9-8e75-59a2c03bb150%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.