Hello. I have to scan and detect medical forms. The drop out color "red" must be removed before OCR execution. I testet RemoveChromaKey and CastColorRange, but still not get a reliable result. Does anyone have tips? What is best practice? Thanks, Harald
I inspected your image with high zoom and looked at the color values of the "red pixels". What I found was is that the red colors compose at least 4-5 shades of red. In my opinion, all of the colors are not pure red (clRed), so when you try to eliminate the red it is quite difficult to do with ImageEn by any means. This becomes even more problematic with scanners that produce even more red pixel values.
You can not use CastColorRange(clRed, clRed) to achieve this because you have to set all the shades red color from min to max and you are not including all the possible shades of red in the min and max value. If you can figure out the minimum red and maximum red pixel values CastColorRange will indeed function as you expect. The hard part is finding out the minimum and maximum values for all the red colors in your image so that CastColorRange produces the desired result.
The alternative is to edit the forms lines so that all the lines contain only one value... clRed... then CastColorRange(clRed, clRed) will function to remove all the red from the image.