Forums > Jitter

Problems with jit.submatrix and cropping

March 19, 2009 | 1:28 am

Hello , I am trying to cut from a movie into smaller pieces using jit.submatrix.

The original footage has a resolution of 720×576.

But I am interested in filling 8 rects that are in 2 different dimentions:

little piece dim 130×130
big piece dim 230×130

..and they are positioned like this..

little piece / big piece /big piece/ little piece
little piece / big piece /big piece/ little piece

And I am interested in the middle part of the image, so 158pixels from the upper part and 158pixels from the lower part will not be seen.

So the whole image that will result (the 8 images put together) will have a resolution of 720×260.

The only problem is jit.submatrix doesn’t seem to work as it should. The image is not recomposed as it should, even though I think I set the parameters (meaning the offsets) right!

PS: Also can you suggest any other ideas (objects) I can use for cropping?

Thank you very much.

This is the patch:

{
"patcher" : {
"fileversion" : 1,
"rect" : [ 0.0, 44.0, 1440.0, 826.0 ],
"bglocked" : 0,
"defrect" : [ 0.0, 44.0, 1440.0, 826.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "the movie must have a resolution of 720x576",
"linecount" : 2,
"patching_rect" : [ 192.0, 52.0, 150.0, 34.0 ],
"fontname" : "Arial",
"frgb" : [ 0.941176, 0.007843, 0.007843, 1.0 ],
"id" : "obj-1",
"textcolor" : [ 0.941176, 0.007843, 0.007843, 1.0 ],
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "jit.fpsgui",
"outlettype" : [ "", "" ],
"patching_rect" : [ 514.0, 223.0, 80.0, 36.0 ],
"fontname" : "Arial",
"mode" : 3,
"id" : "obj-628",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.fpsgui",
"outlettype" : [ "", "" ],
"patching_rect" : [ 112.0, 223.0, 80.0, 36.0 ],
"fontname" : "Arial",
"mode" : 3,
"id" : "obj-627",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 695.0, 584.0, 130.0, 130.0 ],
"id" : "obj-626",
"numinlets" : 1,
"presentation_rect" : [ 974.0, 2629.0, 130.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 462.0, 450.0, 230.0, 130.0 ],
"id" : "obj-625",
"numinlets" : 1,
"presentation_rect" : [ 60.0, 60.0, 230.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 229.0, 584.0, 230.0, 130.0 ],
"id" : "obj-624",
"numinlets" : 1,
"presentation_rect" : [ 45.0, 45.0, 230.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 462.0, 584.0, 230.0, 130.0 ],
"id" : "obj-623",
"numinlets" : 1,
"presentation_rect" : [ 450.0, 1230.0, 230.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 695.0, 450.0, 130.0, 130.0 ],
"id" : "obj-622",
"numinlets" : 1,
"presentation_rect" : [ 242.0, 1268.0, 130.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 97.0, 584.0, 130.0, 130.0 ],
"id" : "obj-621",
"numinlets" : 1,
"presentation_rect" : [ 152.0, 1217.0, 130.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.fpsgui",
"outlettype" : [ "", "" ],
"patching_rect" : [ 357.0, 223.0, 80.0, 36.0 ],
"fontname" : "Arial",
"mode" : 3,
"id" : "obj-619",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"outlettype" : [ "float", "bang" ],
"patching_rect" : [ 568.0, 34.0, 46.0, 20.0 ],
"fontname" : "Arial",
"triscale" : 0.9,
"id" : "obj-617",
"fontsize" : 11.595187,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "vol $1",
"outlettype" : [ "" ],
"patching_rect" : [ 568.0, 59.0, 39.0, 18.0 ],
"fontname" : "Arial",
"id" : "obj-618",
"fontsize" : 11.595187,
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 740.0, 120.0, 367.0, 313.0 ],
"id" : "obj-616",
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 229.0, 450.0, 230.0, 130.0 ],
"id" : "obj-612",
"numinlets" : 1,
"presentation_rect" : [ 15.0, 15.0, 230.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"outlettype" : [ "", "" ],
"patching_rect" : [ 97.0, 450.0, 130.0, 130.0 ],
"id" : "obj-107",
"numinlets" : 1,
"presentation_rect" : [ 15.0, 15.0, 130.0, 130.0 ],
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 230 130 @offset 360 288",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 511.0, 274.0, 98.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-153",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 230 130 @offset 360 158",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 512.0, 165.0, 102.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-152",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 230 130 @offset 130 288",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 204.0, 274.0, 97.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-151",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 230 130 @offset 130 158",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 200.0, 165.0, 102.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-147",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 130 130 @offset 590 288",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 621.0, 274.0, 101.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-146",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 130 130 @offset 590 158",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 622.0, 165.0, 98.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-145",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 130 130 @offset 0 288",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 93.0, 274.0, 103.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-144",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.submatrix @dim 130 130 @offset 0 158",
"linecount" : 3,
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 91.0, 165.0, 96.0, 48.0 ],
"fontname" : "Arial",
"id" : "obj-143",
"fontsize" : 12.0,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "read",
"outlettype" : [ "" ],
"patching_rect" : [ 506.0, 66.0, 35.0, 18.0 ],
"fontname" : "Arial",
"id" : "obj-118",
"fontsize" : 12.0,
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "stop",
"outlettype" : [ "" ],
"patching_rect" : [ 470.0, 66.0, 32.5, 18.0 ],
"fontname" : "Arial",
"id" : "obj-119",
"fontsize" : 11.595187,
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "start",
"outlettype" : [ "" ],
"patching_rect" : [ 435.0, 67.0, 31.0, 18.0 ],
"fontname" : "Arial",
"id" : "obj-122",
"fontsize" : 11.595187,
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "toggle",
"outlettype" : [ "int" ],
"patching_rect" : [ 367.0, 36.0, 20.0, 20.0 ],
"id" : "obj-125",
"numinlets" : 1,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "qmetro 20",
"outlettype" : [ "bang" ],
"patching_rect" : [ 367.0, 65.0, 63.0, 20.0 ],
"fontname" : "Arial",
"id" : "obj-126",
"fontsize" : 11.595187,
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.qt.movie @adapt 1",
"outlettype" : [ "jit_matrix", "" ],
"patching_rect" : [ 367.0, 94.0, 120.0, 20.0 ],
"fontname" : "Arial",
"id" : "obj-141",
"fontsize" : 11.595187,
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "panel",
"patching_rect" : [ 359.0, 30.0, 193.0, 101.0 ],
"id" : "obj-142",
"bgcolor" : [ 0.945098, 0.913725, 0.407843, 1.0 ],
"numinlets" : 1,
"numoutlets" : 0
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-125", 0 ],
"destination" : [ "obj-126", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-143", 0 ],
"destination" : [ "obj-107", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-147", 0 ],
"destination" : [ "obj-612", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-617", 0 ],
"destination" : [ "obj-618", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-144", 0 ],
"destination" : [ "obj-621", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-151", 0 ],
"destination" : [ "obj-624", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-153", 0 ],
"destination" : [ "obj-623", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-146", 0 ],
"destination" : [ "obj-626", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-145", 0 ],
"destination" : [ "obj-622", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-152", 0 ],
"destination" : [ "obj-625", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-118", 0 ],
"destination" : [ "obj-141", 0 ],
"hidden" : 0,
"midpoints" : [ 515.5, 91.0, 376.5, 91.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-119", 0 ],
"destination" : [ "obj-141", 0 ],
"hidden" : 0,
"midpoints" : [ 479.5, 90.0, 376.5, 90.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-122", 0 ],
"destination" : [ "obj-141", 0 ],
"hidden" : 0,
"midpoints" : [ 444.5, 91.0, 376.5, 91.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-126", 0 ],
"destination" : [ "obj-141", 0 ],
"hidden" : 0,
"midpoints" : [ 376.5, 92.0, 376.5, 92.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-618", 0 ],
"destination" : [ "obj-141", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-144", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-143", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-151", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-147", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-152", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-153", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-145", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-146", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-619", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-143", 0 ],
"destination" : [ "obj-627", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-152", 0 ],
"destination" : [ "obj-628", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-141", 0 ],
"destination" : [ "obj-616", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}

}


March 19, 2009 | 7:52 am

Hello Jagja,

You must tell your object what native dim you want it.
By default [jit.qt.movie] dims are 320×240.
So, here you need [jit.qt.movie @dim 720 576 ] for example.


Viewing 2 posts - 1 through 2 (of 2 total)