Following this question in which the general answer presents this code
// Read img
cv::Mat img = cv::imread("imgFileName");
cv::Mat croppedImg;
// This line picks out the rectangle from the image
// and copies to a new Mat
img(cv::Rect(xMin,yMin,xMax-xMin,yMax-yMin)).copyTo(croppedImg);
what happens if the original img is empty? Does it thow an error? or just generate another empty image?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…