Image scaling Macro

Need help, or want to share a macro? Post here!
renatorivo
Posts: 1856
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Postby renatorivo » Mon Jan 18, 2016 6:01 pm

here sandbox for Macro Image scaling

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

Re: Image scaling Macro

Postby JAndersM » Mon Jan 18, 2016 6:22 pm

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

Re: Image scaling Macro

Postby piffpoof » Mon Jan 18, 2016 6:45 pm

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: 46
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Postby JAndersM » Mon Jan 18, 2016 6:59 pm

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: 347
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: Image scaling Macro

Postby piffpoof » Mon Jan 18, 2016 7:35 pm

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
Posts: 1856
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Postby renatorivo » Mon Jan 18, 2016 8:44 pm

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: 46
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Postby JAndersM » Mon Jan 18, 2016 9:19 pm

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 836 times
You can reuse the image in the wiki if you want. (I drew it)
renatorivo
Posts: 1856
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Postby renatorivo » Mon Jan 18, 2016 9:53 pm

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

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

Re: Image scaling Macro

Postby JAndersM » Tue Jan 19, 2016 7:53 am

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

Re: Image scaling Macro

Postby piffpoof » Tue Jan 19, 2016 9:27 am

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 815 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.