T O P I C R E V I E W |
Nick Brett |
Posted - Feb 05 2025 : 05:25:08 I have a TIEBitmap image with ie24RGB PixelFormat, pixel dimensions 152 width x 666 height. I want to resample the image to 152 width x 1998 height (stretch in the Y direction). I've checked and can see that the rfNearest and rfLanczos3 sample filters work exactly as I'd expect with no apparent errors, but the rfFastLinear sample filter shifts the image slightly. For instance the pixel (130, 642) in the original image should move to (130, 1928) in the stretched image, but the rfFastLinear sample filter instead moves the pixel to (130, 1926). These are real-world pictures being used for curation of objects, so it does matter. I haven't checked to see if a similar error occurs in the X direction, or to see if the other filters have similar errors.
I've attached a zip file with images that make the difference between the rfNearest and rfFastLinear sample filters obvious, with a black cross at the above pixel coordinates.
attach/Nick Brett/20252552219_TIEBitmap rfFastLinear Resample Error.zip 3.2 KB |
5 L A T E S T R E P L I E S (Newest First) |
xequte |
Posted - Mar 24 2025 : 23:57:11 Hi
You can email me to test the new algorithm if you like.
Nigel Xequte Software www.imageen.com
|
xequte |
Posted - Mar 24 2025 : 21:40:30 Hi Nick
Yes, we haven't made any decisions on this yet as we didn't want to make any major changes to the algorithm prior to v14, but in our testing a calculated offset gives a fairly agreeable result, but more testing is needed.
Nigel Xequte Software www.imageen.com
|
Nick Brett |
Posted - Mar 24 2025 : 04:03:19 It sounds like you're saying that on average the image will appear always stretched. Wouldn't it be better to apply an offset to your algorithm so that on average the image is correct? Anyway your algorithm, and as you say you don't think it should be improved. Thanks for looking anyway. |
xequte |
Posted - Feb 06 2025 : 17:01:17 The fast linear resampling algorithm creates a new pixels from a linear interpolation of pixel x+0 and pixel x+1 (or y+0 and y+1), so the right border or bottom borders have to interpolate with themselves when enlarging (as there are no further pixels). This results in simple duplication and causes the image content to be offset. For this reason, rfFastLinear should not be used when accurate measurement/positioning is required.
We will add a warning to the documentation.
Nigel Xequte Software www.imageen.com
|
foxdingding |
Posted - Feb 05 2025 : 19:42:45 I also noticed this issue, there are similar errors in the X direction. I am not using rfFastLinear now.
|