All good, Larry — I transposed the matrix and oiio.ImageBufAlgo.warp is working as expected.
Thanks! Jep > Sorry, I steered you wrong on this in my earlier email. > > > > On Feb 16, 2016, at 10:51 AM, Larry Gritz <lg at larrygritz.com> wrote: > > > > I think you have the matrix laid out wrong. Instead of > > > >> oiio.ImageBufAlgo.warp(xform, src, (1, 0, x_offset, 0, 1, y_offset, 0, > >> 0, 1)) > > > > you want > > > > oiio.ImageBufAlgo.warp(xform, src, (1, 0, 0, 0, 1, 0, x_offset, > > y_offset, 1)) > > > > > >> On Feb 16, 2016, at 8:25 AM, Jep Hill <jeptha at gmail.com <mailto:jeptha > >> at gmail.com>> wrote: > >> > >> Thanks Larry. > >> > >> The integer based transform worked like a charm. > >> > >> The warp, however, wasn’t working as expected. I tried it in both OIIO > >> 1.6.4dev and 1.6.10. Basically, when I enter any value other than “0” > >> (zero) as a transform value in the matrix, I get a very dark (if not > >> negative) image. I’ve included an example snippet: > >> > >> # oiio write func from docs > >> def write_image(image_buffer, filename, format=oiio.UNKNOWN): > >> if not image_buffer.has_error: > >> image_buffer.set_write_format(format) > >> image_buffer.write(filename) > >> if image_buffer.has_error: > >> print "Error writing %s : %s" % (filename, image_buffer.geterror()) > >> > >> # warp test > >> def warp_test(in_img, out_img, x_offset=0, y_offset=0): > >> ''' > >> Simple warp function to test x and y transforms. > >> ''' > >> src = oiio.ImageBuf(in_img) > >> xform = oiio.ImageBuf() > >> oiio.ImageBufAlgo.warp(xform, src, (1, 0, x_offset, 0, 1, y_offset, 0, > >> 0, 1)) > >> write_image(xform, out_img) > >> > >> > >> Is anyone able to get a simple sub-pixel x/y transform working using > >> oiio.ImageBufAlgo.warp? > >> > >> Cheers, > >> Jep > >> > >> > >> _______________________________________________ > >> Oiio-dev mailing list > >> Oiio-dev at lists.openimageio.org <mailto:Oiio-dev at > >> lists.openimageio.org> > >> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > > > > -- > > Larry Gritz > > lg at larrygritz.com <mailto:lg at larrygritz.com> > > > > > > -- > Larry Gritz > lg at larrygritz.com
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
