01-11-2024 07:18 PM
Hello, I have a printer system that creates a distorted image. I would like to pre-distort the image so that after I print it, it looks normal.
I can characterize the distortion at some number of points (say 100 or 200). But the image will have over 1 million pixels, so I'll have to interpolate in between the measured points. The actual image is binary (0 or 1), I'm just printing in black. I have the full Vision Development Module, so if there are some useful functions in there that I'm missing, please let me know. But I'm certainly open to other approaches as well.
I do some other image manipulation by using IMAQ ReadFile and Image2Array. I don't really know where to start on this one but I figure people do the reverse pretty often. That is, they take a distorted image and make it look normal, while I want to take a normal image and make it look distorted (or pre-distorted).
Below is a visual description of what I want to do. Instead of starting with image 1, I'd like to convert to image 2 and then run it through my printer system.
Solved! Go to Solution.
01-12-2024 01:43 AM
take a lens distortion model like the polynomial / tangential and calculate the undistorted position for each pixxel or vice versa. Google for image rectification.
01-12-2024 08:15 AM
I wrote code to add a certain type of distortion to photographic images.
Where it needs to fill in a pixel, it just picks an adjacent one.
Where it needs to blend pixels, it just picks one.
I do it this way for 3 reasons.
01-12-2024 12:21 PM
Hi Paul, my images are also pretty high contrast. I want to make sure I understand the idea correctly.
Below, the color of the cell (black or white) indicates the pixel value. The image is distorted by by moving each pixel a certain amount determined by my distortion measurement. In the example below, some are moved up, some left, and some up and left. Then I find the holes in the image and pick some method to fill them in. Is this along the lines of what you mentioned?
01-13-2024 11:43 AM
What is actually a printer that distorts the image?
01-13-2024 01:21 PM - edited 01-13-2024 01:22 PM
@Gregory wrote:
Hi Paul, my images are also pretty high contrast. I want to make sure I understand the idea correctly.
Below, the color of the cell (black or white) indicates the pixel value. The image is distorted by by moving each pixel a certain amount determined by my distortion measurement. In the example below, some are moved up, some left, and some up and left. Then I find the holes in the image and pick some method to fill them in. Is this along the lines of what you mentioned?
That's pretty much how I did it. But with high contrast content, you may see some clumping and/or gaps.
01-15-2024 09:33 AM
@Quiztus2 wrote:
What is actually a printer that distorts the image?
Hi Quiztus, our system uses a laser that is scanned using galvo mirrors and an f-theta lens. Often, the distortion correction is done with the galvo mirrors, but our system is a little more complex so that doesn't work.
01-15-2024 09:57 AM
@paul_cardinale wrote:
That's pretty much how I did it. But with high contrast content, you may see some clumping and/or gaps.
Thanks Paul. The holes that are left after the first step have an interesting pattern (white lines in the image below). It ends up being <3% of the pixels which need to be filled. So far the results are looking promising.