我有这个包含字母的框的图像,如下所示:

我已经能够裁掉每个盒子了,像这样:
现在问我的问题.我怎样才能从每个盒子中裁剪掉字母?期望的结果如下所示

我想使用findContours,但我不确定如何实现这一点,因为它将检测噪音和周围的一切.
我有这张图片,我已经进行了阈值处理,将其转换为二进制图像和黑白图像.见下图:

我想用一个字母提取每个框,这是通过以下代码完成的:
List<MatOfPoint> contours = new ArrayList<MatOfPoint>();
Imgproc.findContours(destination3, contours, new Mat(), Imgproc.RETR_LIST,Imgproc.CHAIN_APPROX_SIMPLE);
MatOfPoint2f approxCurve = new MatOfPoint2f();
int x = 1;
//For each contour found
for (int i=0; i<contours.size(); i++)
{
//Convert contours(i) from MatOfPoint to MatOfPoint2f
MatOfPoint2f contour2f = new MatOfPoint2f( contours.get(i).toArray() );
//Processing on mMOP2f1 which is in type MatOfPoint2f
double approxDistance = Imgproc.arcLength(contour2f, true)*0.02;
Imgproc.approxPolyDP(contour2f, approxCurve, approxDistance, true);
//Convert back to MatOfPoint
MatOfPoint points = new MatOfPoint( approxCurve.toArray() );
// Get bounding rect of contour
Rect rect …Run Code Online (Sandbox Code Playgroud)