How to determine the background color of document when there are 3 options, using c# or imagemagick

后端 未结 3 1191
Happy的楠姐
Happy的楠姐 2020-12-09 23:37

i am currently developing an application that has to process scanned forms. One of the tasks of my application is to determine which kind of form is scanned. There are 3 pos

3条回答
  •  春和景丽
    2020-12-10 00:25

    Workflow outline:

    • Convert Image into HSL/HSV colorspace
    • Build histogram of the H channel
    • The histogram should show a clear peak (for your samples at least) in the blue/green channel

    If that's not distinctive enough, you can weight the histogram votes by something to reduce the effect of the white areas (e.g. in the HSV colorspace, weight by S).

提交回复
热议问题