Recent

Author Topic: Picture manipulation with Lazarus, like distortion correction  (Read 433 times)

stephanweber

  • New Member
  • *
  • Posts: 46
Picture manipulation with Lazarus, like distortion correction
« on: January 15, 2024, 02:40:04 pm »
Hi,

I want to read-in a jpg photo and manipulate it. E.g. A) I want that the straight lines of a house become perpendicular to each other, or B) I want to compensate the distortion of a lense (e.g. wide-angle lense often bend straight lines a bit).
For A) I would apply a linear distortion, like expanding the upper rows more than the lower ones, and for B) I may need to expand the outer columns a bit. 
To support the operation, I would like to see the original photo in a picture box, and the manipulated one in a 2nd box. If the user parameters to be entered are fine (like the amount of correction), I would export the result to a new jpg.
How can I access and manipulate the pixels?

Bye Stephan

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Picture manipulation with Lazarus, like distortion correction
« Reply #1 on: January 15, 2024, 04:23:10 pm »
Take a look at BGRABitmap, unit bgrafilters. Not exactly what you want, but you may get an idea how to implement it.

 

TinyPortal © 2005-2018