I've developed an application which is able to communicate directly with a CCD camera (unbranded and obscure) and I'm able to capture and store the image from this camera.
When the image is first captured, the byte order sequence for RGB data is sequential (RRRGGGBBB) so I correct this by simply interleaving the values. When this is done, the image colours are inverted. To fix this step I simply subtract the pixel values from 255.
At this stage, I have an image which closely resembles what is scanned, except for banding of RGB colours around the edges of what is being scanned. If you zoom in on the image I've attached, you will notice red/green/blue lines around the edges of the strips; most prominently around the 2D barcode.
I have two questions pertaining to this issue:
- Could anyone elaborate on the cause of this issue? Would it be a case of chromatic aberration? or something different that may often be observed in low quality CCD cameras?
- What techniques may exist to combat this issue (which should be executable in real-time on a kiosk type hardware.
Edit 1: Included full image
Edit 2: Included original CCD image prior to colour inversion.