V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hematite
V2EX  ›  问与答

基于颜色代码,在图片中搜索像素

  •  
  •   hematite · Oct 17, 2018 · 1469 views
    This topic created in 2758 days ago, the information mentioned may be changed or developed.

    已知一幅图片中,某 N 个像素的颜色是#F8C322,然后我想知道这些像素的坐标

    也就是,根据代码搜索像素的位置,请问怎么办啊?有什么工具吗?请教大家

    仅临时用一下,Photoshop 那种大型工具就不必啦

    4 replies    2018-10-17 16:52:19 +08:00
    kslr
        1
    kslr  
       Oct 17, 2018
    这个之前我倒是简单研究过。直接对像素遍历,寻找周边色彩最相近最多的那一块。
    基本是按照识别验证码的方法来的。
    alvin666
        2
    alvin666  
       Oct 17, 2018 via Android
    这个遍历就行了,之前用 MATLAB 写了一个图片处理的小玩具,其他语言也有相应的库,十六进制转 rgb,然后 for 匹配就行了
    hematite
        3
    hematite  
    OP
       Oct 17, 2018
    @kslr #1 想看看有没现成工具,google 搜了下“ pixel coordinate based on color ”
    都是要自己折腾代码,颓了……只是业余临时用一下,搞这么麻烦 T_T
    kslr
        4
    kslr  
       Oct 17, 2018
    @hematite 就和楼上说的一样,转 rgb 三个 for 就 OK 了,这比工具可给力多了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   877 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:53 · PVG 04:53 · LAX 13:53 · JFK 16:53
    ♥ Do have faith in what you're doing.