W
W
weranda2020-08-31 11:17:01
Design
weranda, 2020-08-31 11:17:01

Are there services/scripts/approaches for optical alignment of objects?

Greetings.
There are several images. I would like to have at my disposal some tool that automatically selects the right sizes to balance images in optical size or whatever it is right. Are there any or is it all just a matter of eyeballing?

Example
From this:
5f4cb1d48683f525522440.png
Do this:
5f4cb1e69e9d0047190400.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2020-08-31
@xmoonlight

It seems to me that you need to look for a correspondence between the perimeter of the maximum rectangle inscribed in the image, containing the maximum contour pixels, and the perimeter of the rectangle described around the image (this is the border of the image, also containing the maximum contour pixels of the image, i.e. inset).
The greater the difference in the percentage of these two perimeters, the greater the factor you need to multiply the difference in the length and width of these two rectangles to calculate the new image dimensions - the visual borders.
This needs to be tested!

R
Roman Mirilaczvili, 2020-08-31
@2ord

Based on the equal area occupied by the pixels of both objects, then you need:

  1. get object coordinates
  2. calculate their areas
  3. calculate their ratio k = Sa/Sb
  4. to obtain equal areas, multiply (k<1) or divide (k>1) by the coefficient of their ratio for a smaller object

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question