corner pin adjustement of plane/quad with videotexture?
Before I twist my brain yet another turn:
I am trying to achieve something which seems simple in environments like quartz composer/vdmx and vvvv: corner pin positioning of a quad/plane.
If you take a look at this link there is an example video and also the shader used to create the warp for qc/vdmx: http://www.memo.tv/projection_mapping_quad_warping_with_quartz_composer_vdmx
In vvvv there is the homography module which does the same thing.
I have looked at different keystone examples on the list (particularly jasch and robtherich), but they seem quite complex to achieve a simple corner pinning (and also I would want many instances in my setup).
I have figured out how to capture parts of or the whole gl scene to a texture, and then ideally I would want a shader based on the code from the link above:
uniform vec2 BL, BR, TL, TR;
uniform vec2 renderSize;
void main() {
// transform from QC object coords to 0...1
vec2 p = (vec2(gl_Vertex.x, gl_Vertex.y) + 1.) * 0.5;
// interpolate bottom edge x coordinate
vec2 x1 = mix(BL, BR, p.x);
// interpolate top edge x coordinate
vec2 x2 = mix(TL, TR, p.x);
// interpolate y position
p = mix(x1, x2, p.y);
// transform from 0...1 to QC screen coords
p = (p - 0.5) * renderSize;
gl_Position = gl_ModelViewProjectionMatrix * vec4(p, 0, 1);
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}
I have so far not been able to get this shader code to work in jitter, I haven
On Jan 19, 2009, at 8:36 AM, hc gilje wrote:
> I am trying to achieve something which seems simple in environments
> like quartz composer/vdmx and vvvv: corner pin positioning of a quad/
> plane.
Something like the following email coding should be all you need. You
might need to flip the texture coordinates to get the proper texture
orientation. Check out the redbook if the following doesn't make sense.
glbindtexture texname,
glbegin quads,
gltexcoord 0 0,
glvertex left top 0,
gltexcoord 1 0,
glvertex right top 0,
gltexcoord 1 1,
glvertex right bottom 0,
gltexcoord 0 1,
glvertex left bottom 0,
glend
-Joshua
here is a simple patch with a quad using a video texture, but the texture gets a pretty nasty distortion even with moderate tweaks of the quad, so I need to do something with the texture coordinates as well I assume?
hc
On Jan 19, 2009, at 1:18 PM, hc gilje wrote:
>
> here is a simple patch with a quad using a video texture, but the
> texture gets a pretty nasty distortion even with moderate tweaks of
> the quad, so I need to do something with the texture coordinates as
> well I assume?
Sorry about that. Yeah, you'll be better off using either a more dense
vertex mesh, since a simple quad breaks down into two triangles and
interpolates only within each triangle.
The basic idea would be to make a 4 cell matrix containing each of
your corner xyz values, and the standard texture coordinates, and then
send it to a 20x20 or whatever jit.matrix @interp 1. This will make a
mesh which can be sent on to jit.gl.mesh, jit.gl.sketch drawmatrix, or
jit.gl.render or whatever your preferred means of drawing vertex data
as a trigrid/quadgrid. The more vertices in your mesh the better it
should look.
-Joshua
I was sort of guessing that was the problem, but that still makes me wonder why such a simple shader as the one I linked to for quartz composer doesn
Here's what I'm suggesting. Took about 10 minutes to make from your
existing patch.
ok, I am not obsessed with shaders myself,
I just look at the output and see no unwanted distortion in the video texture in the qc example, and lots of distortion with my jitter test.
So obviously I am missing something?
hc
that was quick, thanks!
I would have spent a bit more than 10 minutes on that :-)
So if get rid of the aliasing I will be happy, and maybe I will force myself to make a shader out of it. Maybe that
On Jan 19, 2009, at 2:55 PM, hc gilje wrote:
> So if get rid of the aliasing I will be happy
Here you go with a natively sized jit.gl.texture object and @fsaa 1.
That's as good as you'll get without some alternate form of texture
filtering. Bilinear filtering (which is most likely the same as is
used in QC/vvvv), will have visible aliasing artifacts when
downsampling by large amounts. Performing gaussian/bicubic/mitchell/
etc filtering is more of an endeavor.
-Joshua
thanks,
yes it looks quite good here. I didn
On Jan 19, 2009, at 2:52 PM, hc gilje wrote:
> I just look at the output and see no unwanted distortion in the
> video texture in the qc example, and lots of distortion with my
> jitter test.
Texture size? Use jit.qt.movie @adapt 1-> jit.gl.texture to make sure
that's not the issue.
Dimensions of the plane's vertex mesh? Try 40x40 rather than 20x20.
I'm pretty sure it's only one of those two possibilities. In your
first example you were using a 320x240 -> 256x256 down sampling
without any antialiasing, which of course would have significant
artifacts.
-Joshua
your patch came while I was writing my post, so that is why my message about texture distortion appears after your example, sorry for the confusion.
it works beautifully with 20x20 here.
thanks again!
hc
On Jan 19, 2009, at 3:16 PM, hc gilje wrote:
> I am just wondering if this approach would work if I wanted to
> apply different warpings to different videoplanes. Since the matrix
> transform goes directly to the renderer in this example, I would
> need some way to connect individual matrix transforms to each
> separate plane.
> This is where I thought it would be handy to have a shader version,
> but would it work with your method if things are banged in the right
> order?
Sure. You can also use jit.gl.mesh if it makes your patch organization
simpler... So many different ways to do the same thing.
-Joshua
excellent, thanks for sharing!
I have had quite a few false starts trying to get this working, so glad you took the time to help me out. This should be useful for a few others than me as well.
hc
I am one of those few others, was going to be asking a similar
question in a few days if I couldn't get it right.
Thanks to you both!
~s
On Mon, Jan 19, 2009 at 6:50 PM, hc gilje wrote:
>
> excellent, thanks for sharing!
> I have had quite a few false starts trying to get this working, so glad you took the time to help me out. This should be useful for a few others than me as well.
>
> hc
Here is a modified version of the patch, now easy to use as a fullscreen keystone tool.
By clicking directly on the output screen, you can easily place/displace the image by corner pinning.
hc
hi,
just by curiosity.
how to just crop with your solution ?
and keep the possibility to choose between "crop" and "adapt".
thx.
f./
i had it by this way :
I haven
This makes the texture part a bit more efficient. You can send messages to
the slabs to change the dimensions of their texture units if you need to.
I am new with max/msp, and not where paste the key patcher, tell me please
hi, joshua! nice tip with 4 cell matrix!
but I try to add 5th control point in center without success (
matrix must be 3x3 now?
humbala ! ;-)
someone sent me another version of this patch, looking to make it flexible in terms of vertex points. i moved it to javascript.
and this is the keygen.js javascript:
// keygen.js
// joshua goldberg 2011
// defines control points for keystoning video
// initialization code
autowatch = 1; // why would you NOT use this
inlets = 1;
outlets = 1;
// X_WIDTH for 4:3= 1.33333. for 16:9= 1.777777
var X_WIDTH=1.333333;
var totalWidth = X_WIDTH * 2.0; // full GL width of image
var mySize=[3,3]; // size of ctlmatrix as global (dummy values)
// we put dummy values in ctlMatrix to make sure it's globally available
var ctlMatrix = new JitterMatrix(5, "float32", mySize[0], mySize[1]);
// and the name of the control matrix is also a global
var myName = ctlMatrix.name;
sizer(2,2); //preloads 2x2 values for placement
post("keygen.js reloaded!n"); // so i know it's been properly compiled
// functions
function sizer(x,y){
mySize=[x,y];
var sliceSize = totalWidth/(x-1) // size of each quantized Xslice
// this is the cell placement init code
// first redefine ctlMatrix with the proper size
ctlMatrix.dim = [x, y];
for (i=0; i
//defining columns
for (j=0; j
// defining rows
// plane 0 ranges from negative X_WIDTH to X_WIDTH
myX = (sliceSize*i)-X_WIDTH;
// y=3, y-slice size is 1/2.
// y=4, y-slice size is 1/3.
// GL height is always 1,
// range should go from -1 to 1.
myY = (((1/(y-1))*j)*2)-1.;
myZ = 0; // keeping it flat
//Utex should range from 0-1, using column pointer
myU = (1/(x-1))*i;
//Vtex should range from 0-1 using row pointer
myV = (1/(y-1))*j;
// now put it in the matrix
ctlMatrix.setcell2d(i,j,myX,myY,myZ,myU,myV);
}
}
// output resulting geometry
outlet(0, "jit_matrix "+myName);
}
function tweak(mouseX,mouseY){
// look at mouseloc and see how it fits into mySize
// depending upon where x,y are that affects the cell
myLocX=parseInt(mouseX*mySize[0]);
myLocY=parseInt(mouseY*mySize[1]);
// clamp values to acceptable limits
if (myLocX>=mySize[0]) { myLocX=mySize[0]-1; }
if (myLocX
if (myLocY>=mySize[1]) { myLocY=mySize[1]-1; }
if (myLocY
// now scale mouseX and mouseY to the proper amount
myX = (totalWidth * mouseX)-X_WIDTH;
myY = (mouseY*2.0)-1.0; // y-flip done in the patch
// so now we know we are writing revised values to
// cell(myLocX,myLocY)
// now we pull the U and V values from that matrix cell
myU = ctlMatrix.getcell(myLocX,myLocY)[3];
myV = ctlMatrix.getcell(myLocX,myLocY)[4];
// now rewrite contents of cell to reflect new value
ctlMatrix.setcell2d(myLocX,myLocY,myX,myY,0.0,myU,myV);
// and output the resulting geometry!
outlet(0, "jit_matrix "+myName);
}`
someone sent me another version of this patch, looking to make it flexible in terms of vertex points. i moved it to javascript.
and this is the keygen.js javascript:
// keygen.js
// joshua goldberg 2011
// defines control points for keystoning video
// initialization code
autowatch = 1; // why would you NOT use this
inlets = 1;
outlets = 1;
// X_WIDTH for 4:3= 1.33333. for 16:9= 1.777777
var X_WIDTH=1.333333;
var totalWidth = X_WIDTH * 2.0; // full GL width of image
var mySize=[3,3]; // size of ctlmatrix as global (dummy values)
// we put dummy values in ctlMatrix to make sure it's globally available
var ctlMatrix = new JitterMatrix(5, "float32", mySize[0], mySize[1]);
// and the name of the control matrix is also a global
var myName = ctlMatrix.name;
sizer(2,2); //preloads 2x2 values for placement
post("keygen.js reloaded!n"); // so i know it's been properly compiled
// functions
function sizer(x,y){
mySize=[x,y];
var sliceSize = totalWidth/(x-1) // size of each quantized Xslice
// this is the cell placement init code
// first redefine ctlMatrix with the proper size
ctlMatrix.dim = [x, y];
for (i=0; i=mySize[0]) { myLocX=mySize[0]-1; }
if (myLocX=mySize[1]) { myLocY=mySize[1]-1; }
if (myLocY
I have a problem with multiple planesmeshes at same time. How can i change order of each?
Hi,
All this creates distortion.
Try the patches above with the file I joined, and please read this :
https://cycling74.com/forums/cornerpins-and-keystone
Cheers,
Eric
@Eric
Yes you're absolutley right. I noticed this for a while but I supposed it was impossible (and actually it is) to get something better.
I really hope cycling will solve it asap.
It seems the last js solution is ok. no ?
haha sorry, the js solution is not ok at all... the distortion just different... not a curve but an angle like missing the 20x20 matrix with interp 1.
if somebody find an adequate solution, please post it.
thx.
I confirm, js solution is not the solution.
Well, I managed with nurbs, but this should be more easier to use :
https://cycling74.com/forums/cornerpins-and-keystone
Hello Eric,
I also tryed to work with nurbs, but i did not get rid of the curved deformation :-(
Pehaps you could help me.
Here is what i have:
Hi timtom,
to achieve a clean cornerpin adjustment, I think that you have to implement some maths in your patch (have a look at my attached .gif) :
If you're working with 9 control points with jit.gl.nurbs :
A, B, C, D are known points, you have to calculate 0, w, x, y and z.
Cheers,
Hello Eric,
Thank you very much for the explanation !
Do you have a maxpatch, for the
transformation of A, B, C, D to 0, w, x, y and z.
I think this would help many people, who are not
good math coder ;-)
Best,
t
I'm very bad with math too, but some friends will help me...
So, perhaps later...
Have a look at this, it seem to be very interesting too :
https://cycling74.com/forums/cornerpins-and-keystone
Cheers,
Eric
hi there,
i have a solution for you, BUT:
it is a bit difficult to share, since it has two major dependencies.
first, you need thomas grill´s python skripting objects from http://grrrr.org/research/software/ (that is easy)
second, you need a working opencv installation with python bindings: http://opencv.willowgarage.com/wiki/
i did this a year ago or so for an exhibition, and since then i was thinking about doing this whith a shareable external, never had the time to do so.
as eric pointed out, the problem is that what you guys do with the "mesh" or "nurbs" approach is a linear distortion of the movie, and what you want to do is a perspective transformation.
opencv has this wonderful function "findHomography" that does our math - finding the transformation matrix from a given set of points.
so the attached patch does exactly that: we know the "source points" (e.g a square), we can set the destination points (by draging the sliders), opencv (inside the python script) calculates the transformation matrix.
then i use this matrix to draw a transformed vidplane - with gl.sketch.
basically like this:
glmatrixmode perspective,
glmultmatrix TRANSFORM,
drawobject MOVIE #that´s the jit.gl.videoplane
so for all of you who have python and opencv running in your max environment (or are willing to set it up) please test this.
i am in the process of final mixdown and mastering of my upcoming album (yippieyeah !), so i am a bit short on time. still, i will try to come up with an external that has no dependencies for easier sharing.
yours truly,
hons
Ok, well that's more complicated than I thought it was to do the transformations. I have been working on a toolkit to assist with projection mapping from directly inside jitter rather than using syphon and having to play around with the output as more things need mapping.
My attempted solution was to see if a simple texture map with the right coords onto the mesh would fix the problem. I haven't managed to get this working properly yet, but thought I'd share anyway.
You need to go into the meshmap subpatch and enable the customTexMap to see the results. Does anyone know if this would be workable with the correct code or am I fighting a lost cause here?
DiGiTaLFX
ps interestingly I was experimenting in the Madmapper demo and noticed that you get exactly the same curved effect if you enable mesh mapping and use the mesh controls in there so I guess that it does have to be done with the homography stuff!
well, that was my sunday.
i have managed to make an external "h.homography", currently mac only, and absolutely fresh and untested (except by me).
it calculates the homography given a set of destination points (assuming the source is a square).
that gives you a perspective correct transformation of a plane - the thing you need for "keystoning".
open "PerspectiveMovie++", toggle on, read movie, drag the cornerpoints.
ah.
this is version 0.0, please test.
i will hopefully be able to post a better version (with sourcepoint input, and source-testing, and windows binary) and better help-file / description in the next days.
yours,
hungry hons (going to find something to eat now)
ah yes, too big (debug version..)
here: http://dl.dropbox.com/u/1488161/h.perspectivemovie2.zip
humbly, hons
Hello Hons,
Great work. Thanks for sharing :-)
you are my hero of the day !
After 2 years this problem is solved, yes !
best,
t
@jhdkfj39929: jep, that´s exactly what i am doing/going to do. non-square inputs will be provided in upcoming versions. (although in your example the source ("original points") is actually a square from -1 -1 to 1 1 ). sorry that you have to wait, but the windows version will take a few days.
@timtom: thanks for the roses, very much appreciated. glad that it works
good night,
hons
Works perfectly on Max 5 Mac OS 10.6
Great work, congratulations !
Many thanks for sharing.
Cheers,
Eric
thanks hons !!!
Works perfectly on Max 5 Mac OS 10.7
fxw
windows version available, tested only on xp.
i have set up a quick - kind of unofficial - sharing page at http://hons.at/software/
you will find the download there with both the windows and the mac external.
(my previous dropbox link will cease to exist as of now)
i have made minor changes to the code (checking the input matrix and stuff), so if you would be so nice test it, i hope i have not broken anything.
finding the homography for a given set of points can do much more as the external currently does, but for now this is a simple solution for "extreme keystoning". but first things first, i have to get an album out...
humbly.hons
oh. my bad. yes, the idea was to link opencv statically, but i obviously failed to do so. at least i should have provided the dll´s ..
i am also wondering why i linked to cv version 1.1, hmm.
did i think, or did i just hurry.
i think i just hurried.
problem is, i am not on windows right now so i cannot change anything.
you probably also need cxcore110.dll (?) - that´s what i found lying around on my mac
you need to copy the dll´s to your max application path in the hope that this is what you need.
sorry for that,
hons
Thanks. But even after putting both dlls into ..Cycling '74jitter-externals, together with the mxe, the message is the same. Seems the path is hard coded somehow.
Would be great to have this all wrapped into one file. Or has someone else had better luck?
u r right. works now. procmon will also be very useful. thank u.
greeeeeeeaaaaaaaaaat. thx a lot. :-)
Hello, thx again Hons for your external. one problem is solved. :-)
One question : did you notice that when you move one corner, the others move too ?
I can manage it step by step to stick my corners exactly where they have to be but it's not very convenient.
ok, sorry for the noise it's just because I scaled the movie in videoplane.
hons,
I''ve been using your patches as an example and porting to a dynamic render engine where I can have different viewpoints(cameras) on different render engines.
I do this in javascript making an array of sketch objects that I initita like so:
sketchArray[i].glviewport(0,0,windowSize[0],windowSize[1]);
sketchArray[i].glmatrixmode("perspective");
sketchArray[i].glscale(aspectRatio,1,1);
sketchArray[i].glmultmatrix(multMatrix[i]);
getting the I think I'm doing exactly the same as in the path you made but than in javascript.
the thing is that it seems to end up in a really strange deformation (everything seems to be just a line, could you guess why?
my multMatrix fynction is as follows:
function multiplyMatrix(){
var points =arrayfromargs(arguments);
var i=0;
var j=0;
//sketchArray[points[0]].glmultmatrix=multMatrix[points[0]];
for(i=0;i
for(j=0;j
multMatrix[points[0]].setcell2d(i,j,points[1+i+j]);
post("cell "+i+" "+j+"val "+points[1+(i*4)+j]+"n");
sketchArray[points[0]].glmultmatrix=multMatrix[points[0]];
//multpost(Matrix[points[0]].matrixcalc(multMatrix[points[0]],multMatrix[points[0]]);
outlet(0,"jit_matrix",multMatrix[points[0]]);
}
}
}
@llumen - from what you posted i cannot see what you are doing, or what you are doing wrong. i don´t even know what you supply as an argument to your multiplyMatrix() function.
my guess would be that maybe the matrix you fill within this function is either transposed or otherwise not set up properly (row/column order). but that is of course a wild guess.
you could also try to simply use a poly~ object to set up variable viewports (or even rendercontexts).
i am currently a bit short on time so i do not have the time to look into it more deeply.
good luck,
hons
something in the example patch at http://hons.at/software/ relating to jit.gl.sketch when using the drawobject command doesn't appear to work in max 6- tested on OSX 10.6.8. works in max 5
so bad, doesn't work anymore with max6... osx10.6.8 too.
just had a quick look with max 6:
h.homography itself seems to work fine, but jit.gl.sketch handles the gl-transformation-stack differently - and so the drawobject command does not behave exactly as in max 5. not sure if this was a max 5 bug or is a max 6 bug ..
quick solution (referring to the helpfile):
1) replace the "MOVIE" object (the jit.gl.videoplane) with only a texture:
jit.gl.texture HX @name TEX
2) and then replace the commandlist of the gl.sketch with:
reset, glscale 1 1 1 , glmultmatrix TRANSFORM, glbindtexture TEX, plane 1
3) set the gl.sketch color attribute to @color 1 1 1
i have tested this with max 6 and max 5 on OS X 10.6.8
i will update the helpfile accordingly,
yours, hons
Since Max 6 was released, I have been wondering whether it would be possible to implement this using jit.gl.camera instead of jit.gl.sketch now. Does anyone know if that would be possible or am I barking up the wrong tree?
DiGiTaLFX
I doubt jit.gl.camera has the means to accomplish transforming a homography matrix, but you could actually do it by passing the homography matrix into a shader. this might be a more ideal way of doing it... haven't seen it implemented in Max yet, though.
Ah, now that sounds like a tidy way of accomplishing the task! :)
Nice work, Hons! Good help file, too.
thx a lot Hons.
and how to add several textures. let say I would like to play 2 or more movie on the same plane, with the same keystone. thx.
@Brian.
" but you could actually do it by passing the homography matrix into a shader. this might be a more ideal way of doing it... haven't seen it implemented in Max yet, though."
I have been trying to figure out how to do this, but I am relatively a rookie when it comes to shaders. could you post an example? That would be very much appreciated.
Hans! Great work.
sorry Ricardo I don't have an example from Max/MSP, I've only done it in other environments. It's not the most trivial thing for me to write one real fast, but if someone else wants to try, you'd pass your matrix into your vertex shader (below as myQuadWarpMatrix), and do something like the following:
gl_Position = gl_ModelViewProjectionMatrix * myQuadWarpMatrix * gl_Vertex;
Thanks. I am reading "OpenGL Shading Language Third Edition" by Randi J. Rost Bill Licea-Kane. I am new to this programming, but I will, if I can get it to work, post the final result here.
Thanks :)
Ricardo
oh, thanks for all the feedback. i have been travelling for a while and was offline (not too bad sometimes), but now i am back again - and i will have a look at it.
not that i would call myself "master of shader programming", but i´ll give it a try, it´s only a multiplication (and a color passthrough) in the end..
you have to wait a few more days, i guess.
so long,
hons
ok - anyone cares to test (provided you have already downloaded the h.jit.homography external) ?
this is my attempt at a matrix transformation shader to be used with h.jit.homography - save as "h.mxform.jxs":
this is the testpatch:
best,
hons
hello hos,
thank you very much for your great work !!!
making a shader is a very cool :-)
i did some tests with it and one stange thing happend:
if i try to set the position of the gridshape with the position message, the
shape rotates ...
here is a patch, which demonstate the issue.
lee
thanks lee for testing.
the strange thing with the position is a feature, not a bug :)
h.jit.homography calculates the perspective transformation of a "standard plane" from (-1,-1) to (1,1) given the target projection points that you provide with your matrix.
then the same plane gets drawn with the appropriate perspective transformation applied (that´s what the shader does, simply ignoring the gl_projection_matrix and applying the homography matrix instead).
if you move the gridshape via position message, the plane that gets drawn and the plane that is used for calculating the homography do not match, resulting in this weird "rotation".
if you want to move the plane, simply change the input to h.jit.homography (with the sliders, or by adding some offset..)
i have already been asked to add source point input to h.jit.homography, which is possible, but has not happened yet due to time constraints on my side. mea culpa.
best, hons
hey guys, just wanted to give you a heads up.
for those interested in a simple object to perform a cornerpin projection, we will have something for this in the next update.
hey robert,
a bit late .... (this thread is 2 years old)
since years we told c74, that we need a solution for accurate cornerpin adjustment, which is a very basic thing.
now we helped ourself. you should give hons a free max licence !
he did the work for you. with this shader we have a solution for max5 and max6.
if you want to do somthing helpful for the jitter community,
there is another thing which need to be solved since years:
it would be great to play quicktime movies without hickups.
the forum is full with threads concerning this problem.
oh yes, a free max6 licence would be greatly appreciated :)
but to be honest: my homography solution is very basic (only calculating the transformation for a standard plane) and is missing a few important things. it would also be possible to find transformations for real 3d objects, which would then enable us to do real architectural projections; virtual lighting of buildings comes to my mind .. i have just not implemented it yet.
so i am very much looking forward to the solution of our fellow cyclists as robert announced (or will it only be max6, hm) - and if your solution is a basic as mine, i'm gonna pimp up h.jit.homography, just to show off :)
humbly, hons
the new object addresses only the problem of correctly projecting textured quads with adjustable corners, in a simple and user-friendly manner.
it does not replace hons' object, which will still be useful for users wanting a lower-level solution, to use a shader, or transform geometry other than quads.
pimp away hons!
how will the objekt be called, and when will the update come out? (just to know, when to look for...)
jit.gl.cornerpin.
it will be in the next update.
hey,
id like to apply prepective transform onto a jit.matrix (no opengl)
i think i need to translate the matrix to XY coordinateS, how to?
[EDIT]
ok, jit.mxform2d
whats wrong here?
*bump*
still having trouble figuring out how to convert transform matrix from h.jit.homography into a valid mxform message to jit.mxform2d
how about using jit.gl.corner
i need to stay in jit.matrix for further cv.jit processing
would been nice if jit.gl.cornerpin could output mxform+x/y_offset.
im trying to fiddle with the homography object and mxfrom
but seems it also needs control over the x/y_offset params because mxform will otherwise always "stick" to upper left corner otherwise.
Hi yair reshef,
did you find a way to convert transform matrix from h.jit.homography into a valid mxform message to jit.mxform2d ?
I'm in that problem too...
the same problem of my old post
https://cycling74.com/forums/irregular-region-of-interest-roi