HackerURLs

一次又一次被重新发现的经典。

同一个链接,相隔一年以上,一次又一次被人重新发现、再次冲上 Hacker News 首页。能经受住这种时间检验的,大多是值得一读再读的文章。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从名人堂开始
  • 4,700+篇经过时间检验的经典

Hall of fame

名人堂

在经典库里看全部精选

上首页次数最多、而且有中文导读的 30 篇。时间轴上每个黑点是一次上首页,空心点是一次没冲上去的投稿。

  1. 正在载入经典…

Archive

经典库

按第一次上首页的年份分布,点柱子筛选。

排序

    About

    这些经典是怎么挑出来的

    1. 01

      合并同一个链接

      读取 Hacker News 自 2006 年以来的全部链接投稿,把 http/https、www、跟踪参数等写法不同的同一篇文章合并成一条。

    2. 02

      只留经得起时间的

      同一链接至少两次拿到 50 分以上(约等于上首页),而且两次相隔一年以上;再由 AI 剔除状态页、产品首页和新闻事件。

    3. 03

      写导读、译评论

      上首页次数最多的 2,000 篇配上中文导读、"为什么经久不衰",并精选翻译 HN 高赞评论。导读由 AI 生成,可能有误。

    算法与计算机科学mzucker.github.io

    页面去扭曲:把弯曲书页扫描成平整图像

    Page Dewarping

    2次上首页
    8年跨度
    948累计得分
    97条评论

    2016 — 2024,它一次次回到首页

    黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。

    导读

    作者 Matt Zucker 展示了一个开源的页面去弯曲(dewarping)项目:把拍摄的书页照片中因纸张弯曲和透视造成的文字变形自动拉直。文章配有大量图解,介绍了如何用网格拟合和轮廓检测来建模弯曲页面并恢复平整图像,最终输出适合 OCR 或阅读的清晰扫描效果。

    为什么经久不衰:它用清晰的图文把一个看似困难的计算机视觉问题讲得直观易懂,且代码开源、思路经久实用,八年后仍被顶上首页。

    关键词 计算机视觉图像处理OCR开源项目

    HN 评论精选

    用 GIMP 手动流程几分钟也能达到类似效果,并详细分享了操作步骤

    这话题让我很有共鸣,我用 GIMP 的交互式滤镜手工做过很多次,效果很好:把桌上弯曲书页的透视照片几乎完美地拉直,再二值化成干净黑白。我给文中同一个例子做了个快速粗糙的手工版(附链接),前后不到五分钟。步骤是:裁剪、复制图层、对上层高斯模糊(半径 50)、切换为 Divide 模式合并,这样能很好地均衡光照、几乎消除右侧阴影;然后用横向透视变换把弯曲大致变成水平(透视变换不仅能加透视,也能反透视!);最后用 Curve Bend 做补偿性弯曲。

    kazinator查看英文原文

    This strikes close to home for me, because I've done this "by hand" quite a number of times, using some interactive Gimp filters, with very good results. I've been able to take a perspective photo of a curved page lying on a desk, get it almost perfectly straight, and threshold it to clean black and white or sharp gray scale. Here is my very quick and dirty manual job of the same example page: http://www.kylheku.com/~kaz/dewarp.png Literally less than five minutes. First I cropped the image. Then duplicated the layer. Blurred the top layer (Gaussian, 50 radius). Then flipped to Divide mode and merged the visible layers. This leveled the lightness quite well, almost completely eliminating the shadow over he right side of the page and all other lighting differences. There is a hint of the edge of the shadow still present because it is such a sharp contrast; but that can be eliminated in an adjustment of the intensity curves. In such cases it may be helpful to experiment with smaller blur radii, too. I then did a perspective transform in the lateral direction, squeezing the left side top-bottom and expanding the right, resulting in the warp now being approximately horizontal. (The perspective transform is not just for adding a perspective effect; it is also useful reversing perspective!) Finally, I used the Curve Bend (with its horrible interactive interface and awful preview) to warp in a compensating way. Basically, the idea is to draw an upper and lower curve which is the opposite of the curve on the page. I made two attempts, keeping the results of the second. If the preview of this tool wasn't a ridiculous, inscrutable thumbnail, it would be possible to do an excellent job in one attempt, probably close to perfect. Because the page is evenly light thanks to the divide-by-blurred layer trick, it will nicely threshold to black and white, or a narrow grayscale range.

    赞赏图文并茂的讲解方式,并好奇去弯曲后的图像处理细节

    我喜欢这种配图充分的写作,即使不懂数学和编程的读者也能看懂作者的步骤。他的模型似乎比圆柱体更能真实地表示弯曲的纸面。希望他能多讲讲去弯曲之后的处理步骤——调 levels 能获得好对比度,但结果里居然没有欠曝光的阴影或过曝光的细节损失。不知道他之后有没有跑 OCR;说到 OCR,Leptonica 是 Tesseract 的依赖之一,应该也做了类似的预处理。(后记:细读后发现他提到用了 OpenCV 的自适应阈值。)

    cooper12查看英文原文

    I love well-illustrated writeups. Even a reader without mathematics or programming knowledge can understand what steps the author took. His model actually seems to better represent the warped paper than a cylinder would. (though I don't know the actual specifics of the CTM model) I wish he went into more details on the steps taken after dewarping. You can tweak the image levels to get good contrast, but surprisingly there aren't any shadows from underleveling or loss of detail from overleveling. I wonder if the author ran OCR on the scans after, and speaking of OCR, IIRC Leptonica is one of the dependencies of Tesseract so it must do some similar pre-processing. Edit: reading more carefully, he mentions that he used adaptive thresholding from OpenCV.

    指出 Dropbox 此前也介绍过同类技术,而本项目开源

    最近 Dropbox 写过一篇关于 OCR 前去弯曲的文章(附 HN 链接)。这份代码想法相同,而且是开源的!

    niftich查看英文原文

    Recently, Dropbox wrote about dewarping prior to OCR in their app: https://news.ycombinator.com/item?id=12297944 This code had the same idea, and is open-source!

    日常工具 Office Lens 尚不支持去弯曲,期待此类功能普及

    我在安卓手机上一直在用微软的 Office Lens,它像个智能相机,能自动把每张书页照片摆正并做白平衡(通常拍的是邮件或手填表格)。但它处理不了弯曲的页面,希望他们能加上类似这样的功能!

    troymc查看英文原文

    I use Microsoft's "Office Lens" app on my Android phone all the time, like a "smart camera" which automatically squares off and white-balances each photo of a page (usually mail or forms filled in by hand). It can't handle warped pages though, so I hope they add something like this!

    历次讨论

    同类还值得读

    1. 位运算技巧集

      Bit Twiddling Hacks

      斯坦福页面上的经典位运算技巧合集,收录了 popcount、前导/尾随零、位反转、交换、舍入等大量技巧,并附有解释和性能讨论。

      算法与计算机科学上首页 8 次 · 2011–2024graphics.stanford.edu编辑精选
    2. 如何不按平均评分排序

      How Not To Sort By Average Rating

      经典文章解释了为什么按平均评分排序不可靠:只有少量评价的条目(比如仅一条五星)会轻易排到最前,而评价数量的差异被忽略。

      算法与计算机科学上首页 7 次 · 2009–2024evanmiller.org编辑精选
    3. 数据结构可视化

      Data Structure Visualizations

      旧金山大学 David Galles 教授制作的数据结构与算法交互式可视化网站,涵盖 B 树、红黑树、排序、图算法等,可逐步操作观察其运行过程。

      算法与计算机科学上首页 6 次 · 2011–2021cs.usfca.edu编辑精选
    4. 1996 年以来的计算机科学最佳论文奖

      Best Paper Awards in Computer Science since 1996

      Jeff Huang 维护的一个汇总页面,收录了自 1996 年以来计算机科学各主要会议的“最佳论文奖”获奖名单,并按年份和会议整理,方便读者一站式浏览历届获奖论文。

      算法与计算机科学上首页 6 次 · 2010–2018jeffhuang.com编辑精选
    5. 算法(Jeff Erickson)

      Algorithms, by Jeff Erickson

      伊利诺伊大学 Jeff Erickson 教授的算法课教材,免费在线开放。

      算法与计算机科学上首页 5 次 · 2018–2022jeffe.cs.illinois.edu编辑精选

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。