Skip to content

请问ocr_image传入的image_data是什么样的数据结构? #5

Open

Description

@wy19910222

您好,我看到您提供的接口除了ocr_file还有ocr_image,请问ocr_image里的image_data参数,传入的应该是什么样的数据结构?是直接从文件里读取出来的bytes,还是以rgba或者别的什么顺序排列的逐像素颜色?
另外:
ocr_file接口的最后一个参数,应该是result_size吧?用file_size容易误解。
ocr_image接口的最后一个参数,好像没有用到。

Activity

  1. wy19910222 commented on Apr 11, 2024

    @wy19910222
    Author

    额,试出来了,貌似是rgb三个byte逐像素颜色。

  2. GengGode commented on Apr 12, 2024

    @GengGode
    Owner

    命名上可能有问题,我英语很差。image接口传图片的data本身即rgb序列,file接口传文件的路径或内容,我是这么创建的

  3. GengGode commented on Apr 12, 2024

    @GengGode
    Owner

    result_size是一个错误,它应该是引用的,我想让它返回识别出来的字符串的长度,会尽快修复

  4. GengGode commented on Apr 12, 2024

    @GengGode
    Owner

    似乎错误的地方有点多,我会一起修复掉,ocr_image 接口中的image_data_size似乎是不必要的,但可能需要一个row_pitch参数

    实现内部默认传入数据是三通道的,所以没有用上这个参数,可能会改成通过这个size计算通道数,或者改成直接传入通道数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions