Git Product home page Git Product logo

rotate_3d's Introduction

Perspective Transformation along specific axes

Animation

Rotate along X axis and translate 5 pixel along X axis

Rotate along XZ axis

Prerequisites

  • Linux
  • Python 2.7 with numpy
  • OpenCV 2.4.9

Usage

Change main function with ideal arguments

python demo.py [path of the image] [degree to rotate] ([ideal width] [ideal height])

e.g., Example of rotating an image along yz-axis from 0 to 360 degree with a 5 pixel shift in +X direction

- rotated_img = it.rotate_along_axis(phi = ang, dx = 5)
+ #rotated_img = it.rotate_along_axis(phi = ang, dx = 5)

- #rotated_img = it.rotate_along_axis(phi = ang, gamma = ang)
+ rotated_img = it.rotate_along_axis(phi = ang, gamma = ang)

Then

python demo.py images/000001.jpg 360

Parameters:

it = ImageTransformer(img_path, img_shape)
it.rotate_along_axis(theta=0, phi=0, gamma=0, dx=0, dy=0, dz=0):
  • img_path : the path of image that you want rotated
  • shape : the ideal shape of input image, None for original size.
  • phi : the rotation around the y axis
  • gamma : the rotation around the z axis (basically a 2D rotation)
  • dx : translation along the x axis
  • dy : translation along the y axis
  • dz : translation along the z axis (distance to the image)

Acknowledgments

Code ported and modified from jepson and stackoverflow. Thanks for their excellent work!

Author

Hou-Ning Hu / @eborboihuc

rotate_3d's People

Contributors

eborboihuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rotate_3d's Issues

No picture show

Hi , i use this with typing ,
python demo.py images/000001.jpg 360
but no thing to show the image rotation, Do I need another package or environment?
Thanks!

No License

Would it be possible to add a license? Technically, no one can use your code.

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.

Your options:

Ask the maintainers nicely to add a license. Unless the software includes strong indications to the contrary, lack of a license is probably an oversight. If the software is hosted on a site like GitHub, open an issue requesting a license and include a link to this site, or if you’re bold and it’s fairly obvious what license is most appropriate, open a pull request to add a license.

Don’t use the software. Find or create an alternative that is under an open source license.

Negotiate a private license. Bring your lawyer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.