i have code to detect stamops on the envelop. but i cant send x y codinate to the arduino via serial communication. this is my code. com port open normally by the softwer. but not transmite the x y cordinates. this is my code
cv::RotatedRect boundingBox = cv::minAreaRect(contours[biggestContourIdx]);
cv::Point2f corners[4];
boundingBox.points(corners);
cv::line(drawing, corners[0], corners[1], cv::Scalar(255,255,255));
cv::line(drawing, corners[1], corners[2], cv::Scalar(255,255,255));
cv::line(drawing, corners[2], corners[3], cv::Scalar(255,255,255));
cv::line(drawing, corners[3], corners[0], cv::Scalar(255,255,255));
int w=0;
int h=0;
int area;
w=(corners[0].x-corners[1].x);
h=(corners[0].y-corners[1].y);
area=h*w;
cout<<w;
cout<<"\t";
cout<<h;
cout<<"\t";
cout<<area;
cout<<"\t";
cout<<boundingBox.size;
cout<<"\n";
char test[32];
sprintf(test,"%dx\n%dy\n", (int)w, (int)h);
imshow("MyVideo1", drawing);
cv::namedWindow("Canny");
cv::imshow("Canny",canny_output);
cv::namedWindow("Fill");
cv::imshow("Fill",drawing);