Image scaling Macro

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Post by renatorivo »

here sandbox for Macro Image scaling

http://www.freecadweb.org/wiki/index.ph ... ge_Scaling
JAndersM
Posts: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

Looks good!
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: Image scaling Macro

Post by piffpoof »

renatorivo wrote:here sandbox for Macro Image scaling

http://www.freecadweb.org/wiki/index.ph ... ge_Scaling
Probably a line should be added to the Description section, something like:

"This Macro does not deal with parallax, so distortion will increase from the center towards the edges which will affect the measured distances."

And if adding reference to "parallax" then a link to Wikipedia (https://en.wikipedia.org/wiki/Parallax) is probably advisable as most people will probably recognise what parallax is but not necessarily recognise the word itself.

As parallax is the major problem with this method, perhaps the first sentence should not use the word "easy"? Dealing with parallax where there is any depth of field is certainly not easy. In fact I would suppose that overcoming it would require stereoscopic viewpoints with sufficient distance between them - something that is not easy when the user only has one photographic image.
JAndersM
Posts: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

piffpoof wrote:As parallax is the major problem with this method, perhaps the first sentence should not use the word "easy"? Dealing with parallax where there is any depth of field is certainly not easy. In fact I would suppose that overcoming it would require stereoscopic viewpoints with sufficient distance between them - something that is not easy when the user only has one photographic image.
Maybe focus on the intended use drawings and similar 2D images
For photos of objects etc you probably want to turn to GIMP or similar for straighten them out first.

Maybe:
Macro for easy scaling of drawings etc. imported with Image workbench.
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: Image scaling Macro

Post by piffpoof »

JAndersM wrote:Maybe:
Macro for easy scaling of drawings etc. imported with Image workbench.
Yes, that sounds great.

The reason I mention this is that I suspect that most people reading the word "image" will think of a photographic image (certainly I don't remember anybody referring to a diagram or blueprint as an "image"). But if the description uses words like "diagram" or "2D drawings" (for example) then I think it is very clear.

And maybe there should be a reference to the nefarious role of parallax _IF_ the user decides to use photographic images.
JAndersM wrote: For photos of objects etc you probably want to turn to GIMP or similar for straighten them out first.
But that's the whole point, once a photograph has significant parallax, neither Gimp nor PhotoShop nor anybody else can disentangle it. It's the same as trying to extract stereo from a recording that has been recorded in monaural. Gimp et al can deal with barrel distortion and lots of other flaws in the photographs but not parallax.
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Post by renatorivo »

piffpoof wrote: JAndersM wrote:
Maybe:
Macro for easy scaling of drawings etc. imported with Image workbench.



Yes, that sounds great.

The reason I mention this is that I suspect that most people reading the word "image" will think of a photographic image (certainly I don't remember anybody referring to a diagram or blueprint as an "image"). But if the description uses words like "diagram" or "2D drawings" (for example) then I think it is very clear.

And maybe there should be a reference to the nefarious role of parallax _IF_ the user decides to use photographic images.
Edited
http://www.freecadweb.org/wiki/index.ph ... ge_Scaling

Renato
JAndersM
Posts: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

Fine! To be exact I think piffpoof means the parallax effect viewing objects at different distances if not close (at) the line of sight rather than the parallax due to different lines of sight. This makes scaling hard to do:
parallax.png
parallax.png (14.39 KiB) Viewed 1750 times
You can reuse the image in the wiki if you want. (I drew it)
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Post by renatorivo »

Hi,
thanks for the picture, I will use it
conic or conical perspective?, exact?

Edit
added picture
JAndersM
Posts: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

renatorivo wrote:conic or conical perspective?, exact?
That might be a better description. What do you say piffpoof?
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: Image scaling Macro

Post by piffpoof »

JAndersM wrote:
renatorivo wrote:conic or conical perspective?, exact?
That might be a better description. What do you say piffpoof?
I've amended the diagram as follows:
parallax.jpg
parallax.jpg (44.17 KiB) Viewed 1729 times
The problem which I'm trying to warn of is that with the 2 objects I've added. They are at different depths from the user viewpoint and at different angles but their precise placement can not be determined from a photograph without additional information (e.g. stereoscopic viewpoint).

The macro write up looks great.
Post Reply