transformation

Trying to derive a 2D transformation matrix using only the images

南楼画角 提交于 2019-12-09 20:55:17
问题 I dunno if this should go in a Math forum or a Programming forums, but I'll post it in both and see where I get. I have two computer images... one of them is an "original" image (a large TIF file). The other one is a transformed version of the original image... it's been rotated, sheared and translated in a software program. I need to do some work on the transformed image, but I need the (x-y) coordinates of each pixel in the original image to finish my calculations. I know that the image was

Python: numpy/pandas change values on condition

旧时模样 提交于 2019-12-09 06:32:08
问题 I would like to know if there is a faster and more "pythonic" way of doing the following, e.g. using some built in methods. Given a pandas DataFrame or numpy array of floats, if the value is equal or smaller than 0.5 I need to calculate the reciprocal value and multiply with -1 and replace the old value with the newly calculated one. "Transform" is probably a bad choice of words, please tell me if you have a better/more accurate description. Thank you for your help and support!! Data: import

Inset axes anchored to specific points in data coordinates?

两盒软妹~` 提交于 2019-12-08 21:21:49
问题 I'd like to be able to overlay multiple inset axes on top of a set of parent axes, something like this: Ideally, I'd like the anchor point of each set of inset axes to be fixed in data coordinates, but for the x,y extent of the axes to scale with figure size rather than the scale of the data. For example, if I zoomed in on a region in the parent axes, I'd want the positions of the inset axes to move together with the data plotted in the parent axes, but for their areas and aspect ratios to

Three.js: how to apply rotation matrix to some base object's state?

微笑、不失礼 提交于 2019-12-08 19:23:27
In this question Three.js: chaotic mesh rotation after applyMatrix I asked about an issue. Now I'll try to look at the issue from another end: to describe the desired behaviour of the program. I have an array of rotation matrices for each time point of object's state. Each rotation matrix represents a difference between some initial object state (point zero) and the desired state. User should be able at any time select any desired rotation matrix from the array. How to implement the correct rotation for such data? Three.js r.58 Three.js expects the user to set the object's position , rotation

BitmapData - scale and select area in one matrix?

人盡茶涼 提交于 2019-12-08 13:29:48
问题 I'm using a transform matrix as part of a bitmap draw to select an area of my target rather than drawing from 0,0: var bmd:BitmapData = new BitmapData(target.width,target.height,true,0); var mat:Matrix = new Matrix(1,0,0,1,-target.x,-target.y); bmd.draw(this,mat); This works perfectly, drawing the contents of this using target as a boundary. I can also use a matrix to scale as I draw like this: var scale:Number = .32; var bmd:BitmapData = new BitmapData(target.width/scale,target.height/scale

A distance measure to find similarity between two images invariant of transformation(Rotation & scaling) Intensity difference

核能气质少年 提交于 2019-12-08 12:42:06
问题 I want a distance measure to find similarity between images. What i have tried till now: 1) I have used low level distance metrics such as Normalized cross correlation (This retrieves similar images based on some threshold values) , but it cant retrieve images which are rotated or shifted. But if brightness of a particular image is reduced, the images are not retrieved even if they were of the same type. 2)Bhattacharya coefficient: It retrieves Rotated or shifted images but doesnot Detect

D3.js v4 - how to add zoom button with the default wheelmouse zoom behavior

老子叫甜甜 提交于 2019-12-08 10:43:18
问题 This question covers exactly the same topic as this one already asked and answered: D3.js - how to add zoom button with the default wheelmouse zoom behavior I have also tried to implemented the code that it is in this link http://bl.ocks.org/linssen/7352810. The reason I am asking here is because the solutions are given using version 3 of D3.js and none of those solve my problem. This is my current implementation regarding the zooming. let translateVar = [0,0]; let scaleVar = 1; function

Are SpriteBatch drawcalls culled by XNA?

我是研究僧i 提交于 2019-12-08 10:42:34
问题 I have a very subtle problem with XNA, specifically the SpriteBatch. In my game I have a Camera class. It can Translate the view (obviously) and also zoom in and out. I apply the Camera to the scene when I call the "Begin" function of my spritebatch instance (the last parameter). The Problem: When the cameras Zoomfactor is bigger than 1.0f, the spritebatch stops drawing. I tried to debug my scene but I couldn't find the point where it goes wrong. I tried to just render with "Matrix

Write T4 generated code to separate output files

☆樱花仙子☆ 提交于 2019-12-08 10:08:30
问题 I am creating a .tt file that transforms text into model classes, to practice. A .cs file is generated that with all models , but I would like each model to be saved in its own .cs file in a different folder. What would be the best approach to achieve this? 回答1: Here is simple example how you can output multiple files from single T4 template. Using SaveOutput -method output files ( Content1.txt,Content2.txt ..) are created to same folder than .tt-file, with SaveOutputToSubFolder output files

XSLT Transformation to validate rules in XML document

好久不见. 提交于 2019-12-08 08:30:07
问题 Another Newbie question in XSLT transformation. (I have asked similar question before, but in this case the XML has different formats). I've a xml document that I need to do bunch of validations using xslt. This will be done using the xsltproc tool. <?xml version="1.0" ?> <Company id="1" ...> <Name>blah</Name> <Location> <Address>zzz</Address> <City>aaa</City> ..... </Location> .... <Manager id="m1" mincount="4" grade="10"...> <Employee id="e1"/> <Employee id="e2"/> ..... </Manager> ..... <