Note that there are some explanatory texts on larger screens.

plurals
  1. POHSV color removal/dropout of form fields
    primarykey
    data
    text
    <p>I'm writing a system to dropout certain field borders from a form image. The fields may have writing in them which I need to correctly keep even if the handwriting crosses the field border.</p> <p>I have 2 images: 1 color image (converted to HSV colorspace) and 1 black/white image that line up pixel per pixel (these are produced by a scanner)</p> <p>I would like to remove (pluck) the field border pixels from the black and white image, given the colors in the color image.</p> <p>I have an advantage in that I know apriori the exact location of the field, and the widths/heights of the field border lines.</p> <p>My current implementation consists of (for each field), scanning the field border on the color image and calculating an average HSV value for that field border (since I know exactly where the field border is, I only visit "field border" pixels, but I may also visit a few handwriting pixels if they cross the field border, the idea is that they won't skew the average very much). Once I have an "average" HSV value for the field border, I scan the field border again, and for each pixel compute the following delta function:</p> <p><img src="https://i.stack.imgur.com/ViuLW.jpg" alt="enter image description here"></p> <p>If the Delta value between the "current" pixel and the average HSV is less than 0.07 (found empirically) then I set the pixel to white (colors are close together), otherwise I keep the pixel as black.</p> <p>Here are some examples of a field:</p> <p>Color Image: <img src="https://i.stack.imgur.com/5i9Gn.jpg" alt="enter image description here"> Black&amp;White Image Non-Dropped Out: <img src="https://i.stack.imgur.com/CLymC.jpg" alt="enter image description here"> Dropped out Black&amp;White Image where Saturation is not used in Equation: <img src="https://i.stack.imgur.com/eAKpL.jpg" alt="enter image description here"> Actual Dropped out Black &amp; White Image with formula used in full (using all 3 components H,S &amp; V) <img src="https://i.stack.imgur.com/YJlWe.jpg" alt="enter image description here"></p> <p>The formula I'm using to get the 3rd dropped out image is the above formula but where I left the Saturation out of the equation (I was just playing around with things).<br> This this obviously not delicate enough to color variations but the formula is very sensitive to saturation changes (this is mainly caused by JPEG compression artifacts that exist within the image (example artifacts):</p> <p><img src="https://i.stack.imgur.com/cZFC2.jpg" alt="enter image description here"></p> <p>I think the 4th example is the best because it's really sensitive to color variations so you're less likely to remove handwriting, but the problem is you're more prone to pick up border because of slight color differences caused by simple scanning or compression artifacts.</p> <p>What are your thoughts to alleviate some of the color (saturation) variations that occur within the field border, is it to use histograms? with some quantization involved there to reduce number of bins?</p> <p>I'd like to hear any ideas people have.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload