How to automate pdf rotation with google-cloud-vision API? - google-cloud-vision

Here is my case. I’ve got a pdf with several pages. Some are in the right reading direction (left to right), some are not (90, 180 or 270 degrees). I’d like to automatically rotate the pages that are in the wrong reading direction. Is it possible to do that and how?
Thank you for your time.

Related

How to rotate a raster image in Meshlab?

I'm testing a scanning process where I want to reproject the texture of the scanned object through raster layers, as shown through these great tutorials : https://www.youtube.com/watch?v=7yeSqH1ftT4.
However, I am encountering a bit of a problem : as you can see in the picture, the image I'm using is rotated 90 degrees. I've tried rotating it through Windows Photo viewer but it is not taken into account in Meshlab.
Is there a simple way to just rotate the raster image so that I don't have to break my neck when trying to align the mesh ^^ ?
I've tried searching in the camera parameters but can't seem to find the solution. Thank you and sorry if it's obvious!

Ue4 TiledMap Generation in 3d

How i can generate a Island shaped 2d Map with tiled cubes? Does someone can give me tipps or links or some other help please?
I already tried it with Noise but it ends in weird results cause i dont get how i use it in a 2d way.
Also i tried to give each tiles numbers so i knew what was the last placed tile.
But that ended in a big Chaos.
What i dont understand right now is how to "move" in that grid or how to know what was last and what could be the next and ye.
I really guess there is a simple way to handle that all which i dont realize at the moment?
I work for right now only with BP.
Thanks

Get angle for ear clipping

I am trying to implement a ear clipping algorithm into a program of mine but I am having issues. While that I can get it to work in a lot of situations, I haven't found a good way to check for reflex angles.
I've been looking up ways - every method I've tried to date seems to have angle it won't work for. When I try to find more information, most people's tutorials/work just tell me to "find the reflex angle and test for ear" then describe how to test for ear but not how to get the reflex angle.
Can anyone tell me how to get the proper angle inside the triangle for a concave polygon, or point me in the right direction? Could be an understanding issue with me. Thanks.
Figured out my problem was one of how I was conceiving the issue. I was saying that if the point was outside the polygon it could still be in the polygon without adding in my head the fact I removed the last vertex. Been busting my brains trying to implement ear clipping for a few days and got it wrong at this point - the solution was the basic "check if the center point of the triangle was outside the polygon and mark it as reflex".

2D collision for games without AABB

What exactly is the best way to detect 2d game collision? I use aabb's (axis-aligned-bounding-boxes) but if you have a big circle or something, you will be hitting it when your like 200 pixels away. Would the best way be to just see if the pixels in the 2 images are touching? please let me know a good method.
EDIT:
Ok so now I realize how simple circle collision is. but say I have an oval or something that isn't really a shape. Or even a square that is rotated 45 degrees.
If you have circles you can use Circle-To-Circle collision. Just take the distance of the midpoints and compare it with the length of the radii.
Beside that it really depends on what you need. There's a plethora of collision detection algorithms (mostly to speed things up, e.g. by using coherence between frames) but that's out of the range for a short general note and you'd need to specify your problem a bit more.

XNA Track rotated pixel positions

Im making a game in xna where a tank has to move over a landscape.
I need to be able find the bottom of the tank when it is rotated so I can make it move up and down as the player goes over the landscape.
for example if i have a sprite at with its top left corner at 400,300 and i rotate it around its center by 45 degrees around its center, how do i find the new locations of the bottom track.
Thanks
Thanks for the reply Langaurd.
I have looked at the article link before but didnt understand how it works.
Im making a 2d side scrolling game. As the player moves left and right, the tank has to also tilt to follow the contour of the terrain.
I have two vectors that store the back bottom of the track and one that stores the front bottom of the track.
I have tried
Vector2 backBottom = new Vector2(5, 25);
Vector2 frontBottom = new Vector2(5, 32);
backBottom = Vector2.Transform(backBottom+position, Matrix.CreateRotationZ(angle));
frontBottom = Vector2.Transform(frontBottom+position, Matrix.CreateRotationZ(angle));
but that gave me some strange values
Not 100% clear on exactly what it is you are trying to do. You mention a sprite, which is 2D, but your description is in 3D terms. If you are doing a 2D side view, then you can't tell the tank is rotated 45 degrees. If you are doing a 2D top-down view, then you shouldn't really care where the bottom of the tred is.
In any case, two suggestions. If you are die-hard on tracking rotated pixels, then read this article: 2D collision with Transformed Pixels from the creators.xna.com site. However I would recommend tracking vectors. Use two vectors to represent the track locations, and then use Vector2.Transform to rotate them with the tank. You could then use the vectors to check to see if the tracks have hit something, what angle they are at, ect.
You need to define a clearer orientation for you sprite. I would use a Front and Up Vector for the tank. Now you rotate both of them together with the angle your tank drives depending on the terrain. Lets say these vectors are at the center of your sprite. and your sprite is rotated, exactly like your up and front vectors. Now just multiply your Halfheight with -Up vector and you should have your local bottom center, add your tank position and you have your world bottom track position.
Important: Don't mix up a point, which can be expressed by a vector, or a real vector which has no position and only shows the direction. For directions its important to normalize the vector.
Sorry for the vague answer but you question is a little bit vague too.

Resources