affinetransform

findHomography, getPerspectiveTransform, & getAffineTransform

断了今生、忘了曾经 提交于 2019-11-29 20:58:09
This question is on the OpenCV functions findHomography , getPerspectiveTransform & getAffineTransform What is the difference between findHomography and getPerspectiveTransform ?. My understanding from the documentation is that getPerspectiveTransform computes the transform using 4 correspondences (which is the minimum required to compute a homography/perspective transform) where as findHomography computes the transform even if you provide more than 4 correspondencies (presumably using something like a least squares method?). Is this correct? (In which case the only reason OpenCV still

can't get my coordinates graphics2D mouseclick java

自作多情 提交于 2019-11-29 17:27:21
I got an extended JLabel class where I draw my Map using the code below : the new AffineTransform() is the identity to left my image as it is (0,0,w,h) mygraphics2D = (Graphics2D) getGraphics(); graphics2D.scale(2.0,2.0) ; graphics2D.rotate(.... graphics2D.drawImage(myImageIcon.getImage(),new AffineTransform(), this); now when I click on my JLabel using this event : public void mouseClicked(MouseEvent e) { x =e.getX() ; y = e.getY(); NewX = ???? NewY = ???? } I want to retrieve my new coordinates "the scaled,rotated ... coords" I tried Point2D ptSrc = new Point2D.Double(x, y); Point2D ptDst =

Interpolating or resampling algorithm in matlab for transformed 3D image, preferably sinc interpolation

耗尽温柔 提交于 2019-11-29 16:11:05
I have one 3D dataset and one 2D dataset which is a slice through the first volume. They are at different scales, resolutions and in a different coordinate system, but of both I know the affine transformation to world coordinates. I then think I know how to apply those, but how do I get an image back from those transformed coordinates again using sinc interpolation? I would like to learn how to perform this/how this works. The first comments below already pointed me at existing functions inside matlab that perform linear interpolation, but I would also like to know how to do this myself so I

How to change the homography with the scale of the image?

点点圈 提交于 2019-11-29 14:13:04
I have two planar images A and B I have calculated the homography between these two images using feature points, my question is, if both A and B scale up to double size, let's say A' and B'. How will homography' be? Thank you. The homography doesn't change. It will be the same as long as both images have undergone the same linear scaling. The homography is a mapping between two 2D planes in 3D space. It combines at rotation and translation with the camera matrix. If the position of the camera relative to the object has not changed, then a homography calculated from a mapping of points in the

Rotating BufferedImage changes its colors

拜拜、爱过 提交于 2019-11-29 12:37:21
I'm trying to code a class to seam carve images in x and y direction. The x direction is working, and to reduce the y direction I thought about simply rotating the image 90° and run the same code over the already rescaled image (in x direction only) and after that, rotate it back to its initial state. I found something with AffineTransform and tried it. It actually produced a rotated image, but messed up the colors and I don't know why. This is all the code: import java.awt.image.BufferedImage; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; import java.io.File;

Transform a triangle to another triangle

青春壹個敷衍的年華 提交于 2019-11-29 02:37:02
问题 Hi i am trying to create the affine transform that will allow me to transform a triangle into another one. What i have are the coordinates for the 2 triangles. Can you help me? Following the answer by Adam Rosenfield i came up with this code in case anyone is bored to solve the equation himself : public static AffineTransform createTransform(ThreePointSystem source, ThreePointSystem dest) { double x11 = source.point1.getX(); double x12 = source.point1.getY(); double x21 = source.point2.getX()

DICOM affine matrix transformation from image space to patient space in Matlab

房东的猫 提交于 2019-11-29 01:15:30
问题 From the nifti header its easy to get the affine matrix. However in the DICOM header there are lots of entries, but its unclear to me which entries describe the transformation of which parameter to which new space. I have found a tutorial which is quite detailed, but I cant find the entries they refer to. Also, that tutorial is written for Python, not Matlab. It lists these header entries: Entries needed: Image Position (0020,0032) Image Orientation (0020,0037) Pixel Spacing (0028,0030) I

Drawing transform independent layout bounds in JavaFX

女生的网名这么多〃 提交于 2019-11-28 12:48:52
For a simple vector drawing app I am looking to implement a "Selection Box", that is a graphic representation of the layoutBounds of a Node. Example: example http://i61.tinypic.com/ou4p3t.png Thanks to jewelsea and his BoundsExample , I have a good understanding now on how to get the data for the box. The part I am struggling with is actually drawing the box on the scene, in a way that correctly respects the transformations on the nodes. Correctly in this case means the bounds logical size get scaled with a node, but the stroke of the selection box stays constant. Meaning a selection box

Interpolating or resampling algorithm in matlab for transformed 3D image, preferably sinc interpolation

别说谁变了你拦得住时间么 提交于 2019-11-28 09:22:28
问题 I have one 3D dataset and one 2D dataset which is a slice through the first volume. They are at different scales, resolutions and in a different coordinate system, but of both I know the affine transformation to world coordinates. I then think I know how to apply those, but how do I get an image back from those transformed coordinates again using sinc interpolation? I would like to learn how to perform this/how this works. The first comments below already pointed me at existing functions

How to change the homography with the scale of the image?

蹲街弑〆低调 提交于 2019-11-28 07:52:32
问题 I have two planar images A and B I have calculated the homography between these two images using feature points, my question is, if both A and B scale up to double size, let's say A' and B'. How will homography' be? Thank you. 回答1: The homography doesn't change. It will be the same as long as both images have undergone the same linear scaling. The homography is a mapping between two 2D planes in 3D space. It combines at rotation and translation with the camera matrix. If the position of the