xingchizhang / document_image_correction

文档图像矫正
5 stars 1 forks source link

怎么运行起来呢 #2

Open gwokwong opened 3 months ago

xingchizhang commented 3 months ago

运行应该没啥问题呀,整个程序就一个代码文件,最简单的方式直接下个pycharm也能跑起来。或者你再具体描述一下遇到的困难,你尝试了什么方式但是没有运行起来?

kidassx commented 3 months ago

运行 main函数 报错,结果如下: Testing started at 11:06 ... D:\software\anaconda\python.exe "D:\software\pycharm\PyCharm Community Edition 2018.2.2\helpers\pycharm_jb_pytest_runner.py" --path D:/python_project/document_image_correction-main/document_image_correction.py Launching pytest with arguments D:/python_project/document_image_correction-main/document_image_correction.py in D:\python_project\document_image_correction-main

============================= test session starts ============================= platform win32 -- Python 3.8.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 rootdir: D:\python_project\document_image_correction-main plugins: anyio-2.2.0collected 1 item

document_image_correction.py E test setup failed file D:\python_project\document_image_correction-main\document_image_correction.py, line 491 def test(i, calc_ratio, size = 800): E fixture 'i' not found

  available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

麻烦作者看看啥问题,感谢

xingchizhang commented 3 months ago

尝试一下不用pytest方式运行呢,看能否解决?

xingchizhang commented 3 months ago

确实会出现这个问题,因为这个东西只是本科阶段的某个课程作业,主要起到计算机视觉方面的锻炼作用,因此在实际生活中使用效果肯定不会太好。我目前不太清楚你想使用该程序的目的,如果是想在生活中用该程序纠正文档,那确实很难达到效果,对你造成的不便,先道一声抱歉,建议你可以用市场中更完善的软件,如扫描全能王等来实现;如果也是想利用该程序作为练手的话,我可以帮你分析一下原因,原因如下:纠正情况不佳可能是因为你的背景是这种木纹桌子,可以看到,桌子上有很多横向的木纹线。在我印象中,这个程序是需要首先识别出边框线的,而这些木纹线又非常容易导致程序识别错误,因此出现这种纠正失败的情况。建议你可以在更整洁(这里的整洁指背景没有或有较少噪声影响)的场景使用,效果应该会好一些。

kidassx commented 3 months ago

情况我已经了解,感谢你的热心回复!