java,c++,opencv,javacv,affinetransform

I believe here is the answer: https://groups.google.com/d/msg/javacv/dbWTNCHFyeg/Q6k59GPavgsJ: Point2f is a Pointer, which works like a native array: http://bytedeco.org/javacpp-presets/opencv/apidocs/org/bytedeco/javacpp/opencv_core.Point2f.html And we can do things like that with a Pointer to access the elements of a native array: http://bytedeco.org/javacpp/apidocs/org/bytedeco/javacpp/Pointer.html#position-int- Check the README file for an example with CvPoint: https://github.com/bytedeco/javacv#sample-usage Now do the...

java,swing,gradient,paintcomponent,affinetransform

Transformation's are compounding, so, once you apply a transformation, you need to reverse it when you're done. Now, you can do this manually, or you could just create a copy of the Graphics context before hand and dispose of it when you done. This prevents any changes you make to...

java,memory,bufferedimage,affinetransform

Your biggest problem is simple- you're duplicating every image you're every time you rotate. You can try to draw the rotated image back onto itself, removing the need to churn through a massive amount of objects for the garbage collector. Also, if you are dead-set on making new objects, make...

c#,.net,matrix,system.drawing,affinetransform

Yes the correct answer is this: var x1 = m11*pointB.X + m21*pointB.Y + dx; var y1 = m12*pointB.X + m22*pointB.Y + dy; But there's no error. The description of the matrix gives us this, 3 rows, 2 columns (3x2): [m11 m12] [m21 m22] [dx dy ] When multiplied by the...

bufferedimage,flip,affinetransform

When the bufferedimage is transformed with the scaling factor the points are flipped around the origin, so (1,5) would for example become (1,-5), the translation is necessary to move the image data back to the original rectangle it would have occupied. So for example lets say that the image runs...

opengl,matrix,glsl,shadow,affinetransform

Helpful community members of ##OpenGL on Freenode pointed out my error. As the projection matrix MATRIX does not produce an affine transformation, I needed to divide the distance calculation by point.w. This yields the correct distance between LIGHT.xyz and point.xyz. In short, if you're working with a projection matrix like...

android,opencv,image-processing,affinetransform

The touch coordinate refer to a point that belongs to your Android's screen resolution (Samsung Galaxy S3 is 720x1280). On the other hand, the OpenCV image could be larger or smaller than that, meaning that a touch coordinate can't be mapped directly into an image coordinate. What needs to be...

java,game-engine,affinetransform

This solution is based on the prior answer. Instead of mapping an input point to an output point, it maps an output point to a location in the input matrix space. In this version, it simply uses the value for the closest integer index point. It might get better results...

ios,avfoundation,transformation,cgaffinetransform,affinetransform

It turns out that in most cases you can make a decent description about an affine transform since it's quite constrained. Doing the same for 3D transforms is much harder :( Note that I still won't be able to tell you the different transforms matrices that were concatenated, only the...

I now start the other way around: get the 2d points to sample and then transform those to the 3d volume and then use interp3 to calculate the values. Its pretty quick and works well. This code only works for getting a single slice, but i think you can easily...

java,matrix,awt,affinetransform

As you wrote, the notion of the x scaling factor is quite meaningless in the general case. It is only relevant for the special case of scaling matrixes. i.E. those for which getType returns TYPE_GENERAL_SCALE or TYPE_UNIFORM_SCALE. (A translation could be added, too) In other cases, getScaleX is "correct" in...

.net,pdf,rotation,itextsharp,affinetransform

Here's the solutions I've come upon, basically perform the rotation without translation, then translates by the addition of two vectors, one which gets from the rotation origin to the required centre of rotation and one which gets from (the place that the required centre of rotation will have been rotated...

c++,ios,affinetransform,accelerate-framework,vimage

I doubt you were able to get any of the answers posted here to work; there are just not enough specifics in them to help someone who had a question like this to begin with. Here's your working answer: - (CVPixelBufferRef)copyRenderedPixelBuffer:(CVPixelBufferRef)pixelBuffer { CVPixelBufferLockBaseAddress( pixelBuffer, 0 ); unsigned char *base =...

The AffineTransform associated with the graphics context passed to paintComponent() is not always the identity transform. For reasons that aren't clear, the m12 entry has the value 38.0 initially and after resizing the enclosing frame. Trivially, one can modify the copy supplied by g.create(). Graphics2D g2d = (Graphics2D) g.create(); AffineTransform...

java,bufferedimage,image-resizing,affinetransform,imgscalr

You're doing int division which always returns an int, here 0 since your screen dimensions will likely be greater than your image dimensions: aspectRatioWidth = bufwidth/scrwidth; aspectRatioHeight = bufheight/scrheight; Solution: convert the numbers to double and then do double division. aspectRatioWidth = (double) bufwidth/scrwidth; aspectRatioHeight = (double) bufheight/scrheight; Edit Not...