YOUR ACCOUNT

Login or Register to post new topics or replies
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I translated some parts of a graphics library I'm co-developer on, so now we have a true four point projective transformation, and it supports both ways (i.e. you can transform "back" by using opposite setting for Inverse parameter).

I added some additional parameters, Percentage, Clip X and Clip Y. Percentage works similar to Percentage in the other transformations.

I will publish it eventually, but I post it here first to get some feedback on the design. Also I'm unsure about license compatibility when submitting to the online library.

Projective Transform (1).ffxml
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Here is a moderate example with clipped x and y:

  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
And here is a more extreme unclipped example:

  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Sphinx,

This is awesome to say the least! It will open a whole world of possibilities in mapping images onto 3D surfaces.

As to the interface, it is workable as it is. The 'inverse' checkbox should work the other way though, IMO. Right now it is checked when you do the original transform, and unchecked for inverse transform.

For a possible improvement, it would be helpful to be able to show just a tranformed grid overlayed on the input image. This would be particularly useful for alignment when removing perspective with inverse transformation.

TD
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Oh, and could the clip function have some sort of invert choice as well? With some settings, the transformed image splits and goes through the opposeite edges of the image. (Or is this the way it is supposed to go?)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
The 'inverse' checkbox should work the other way though, IMO. Right now it is checked when you do the original transform, and unchecked for inverse transform.


I guess that makes sense from how you see it visually. Theoretically or codewise it is the other way around though (i.e. it uses the inverse matrix when Inverse is checked). Maybe there is a better term for that input.

Quote
could the clip function have some sort of invert choice as well? With some settings, the transformed image splits and goes through the opposeite edges of the image. (Or is this the way it is supposed to go?)


Well, the thing is that for correct output the transform only support convex quadrilateral polygons. I was not sure how to handle this and decided to leave it as is - any ideas on what to with concave settings?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Hmm, I could constrain the points so that you can't make a concave polygon.. the sliders would then stop having any effect if you make a concave polygon..
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Quote
Sphinx. wrote:
I guess that makes sense from how you see it visually. Theoretically or codewise it is the other way around though (i.e. it uses the inverse matrix when Inverse is checked). Maybe there is a better term for that input.


You could call it 'Inverse Transform' and switch the checkbox polarity.

Quote
Sphinx. wrote:
Well, the thing is that for correct output the transform only support convex quadrilateral polygons. I was not sure how to handle this and decided to leave it as is - any ideas on what to with concave settings?
Hmm, I could constrain the points so that you can't make a concave polygon.. the sliders would then stop having any effect if you make a concave polygon..


I see. Then contraining the points might be a good idea. It is not all that important, more of a cosmetic handling. Now that we've gone there: should there be some way of indicating when the points are clipped? Such as a red exclamation point at the corner (which you can turn off)? That's just a thought. In the big picture, it's irrelevant for the basic function of the filter, which is a fantastic piece of work.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
ThreeDee

This is awesome to say the least! It will open a whole world of possibilities in mapping images onto 3D surfaces.


I am sorry to ask, but do not know how this would help mapping images onto 3D surfaces unless you mean doing this inside FF in some way, although FF does not have 3D surfaces.
Sorry if I am telling perhaps silly things here.

As Sphinx has put already, this is related to this other thread Quadrilateral Challenge by uberzev
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Quote
SpaceRay wrote: I am sorry to ask, but do not know how this would help mapping images onto 3D surfaces unless you mean doing this inside FF in some way, although FF does not have 3D surfaces.


Yes, I mean internally in FF. For instance, if you were to make a script that calculated the corner points of the three visible faces of a 3D rotating cube, you could use this script to render the input image on each face.

You could pretty much make any rectanglarly faceted filled 3D shape with the input image on each face with it.

Which reminds me that it would really be a good idea to write a script that calculates the transformation of any point in 3D space.

In fact, 3D transformation may already be included in one of the more advanced scripts from Sphinx. Or in Raytracing by Egret. Haven't dug into them that deep.

(By 3D transformation I mean rotation around X, Y and Z-axis.)
  Details E-Mail
CFandM
ForgeSmith

Posts: 4761
Filters: 266
Great Work Sphinx.. smile:pimp: smile:beer:
Stupid things happen to computers for stupid reasons at stupid times!
  Details E-Mail
AndrewA1988
AndrewA1988
Posts: 27
Filters: 16
Does anyone still have this snippet? Attachment goes to a "not found" page.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I'm not sure why the older forum attachments are not working anymore (GMM? Vlad?).

Here it is

Projective Transform.ffxml
  Details E-Mail
AndrewA1988
AndrewA1988
Posts: 27
Filters: 16
Thanks Sphinx!
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Quote
Sphinx. wrote:
not sure why the older forum attachments are not working anymore


We restored this particular attachment. If you any other older attachment doesn't show up, let me know.
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,533 Posts
+38 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

17 unregistered users.