相关疑难解决方法(0)

使用opencv(Java)的阈值图像

我正在为我的项目使用Opencv.我需要将下面的图像转换为阈值图像

原始图像

我试过这个功能:

Imgproc.threshold(imgGray, imgThreshold, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU); 
Run Code Online (Sandbox Code Playgroud)

但结果并不那么好,如下所示

阈

所以我尝试了adaptiveThreshold function:

Imgproc.adaptiveThreshold(imgGray, imgThreshold, 255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, Imgproc.THRESH_BINARY, 11, 2); 
Run Code Online (Sandbox Code Playgroud)

结果如下:

adaptiveThreshold

我只是期望二进制图像只有白色背景和黑色文本,没有黑色区域或噪音(我不喜欢使用,Photo.fastNlMeansDenoising因为它需要很多时间).请帮我解决这个问题.

此外,我正在使用Tesseract日语识别,但准确率不高.您对日本的更好的OCR或任何提高Tesseract质量的方法有什么建议吗?

java android opencv tesseract image-processing

10
推荐指数
1
解决办法
2万
查看次数

使用 opencv 通过反卷积去模糊图像

我有两个图像o1& o2,并且我使用相同的高斯模糊内核模糊了这两个图像。然后我找到了内核k1 = DFT(b1) / DFT (o1),b1模糊得到的图像在哪里o1。

我已使用此内核 ( k1) 对通过模糊获得的b2位置执行反卷积。b2o2

但是去模糊输出不正确(输出图像与原始图像没有任何关系)我的代码有什么问题?

int main(int argc, char** argv) 
{
  Mat orig1 = imread(argv[1], 0);
  Mat orig2 = imread(argv[2], 0);

  Mat blur1, blur2;
  GaussianBlur(orig1, blur1, Size(11, 11), 0, 0 );
  GaussianBlur(orig2, blur2, Size(11, 11), 0, 0 );

  imshow("or1", orig1);
  imshow("bl1", blur1);
  imshow("or2", orig2);
  imshow("bl2", blur2);
  waitKey(0);



  deconvolution(orig1, blur1, orig2, blur2);

  return 0;
}
void deconvolution(Mat & o1, Mat …
Run Code Online (Sandbox Code Playgroud)

c++ opencv image-processing deconvolution

5
推荐指数
1
解决办法
7644
查看次数