transformation

Transform rectangular image into trapezoid

孤街浪徒 提交于 2019-12-11 07:39:28
问题 In .NET how can I transform an image into a trapezoid. The Matrix class supports rotation, shear, etc, but I can't see a trapezoidal transformation. I'm using the usual System.Drawing.* API, but I'm flexible to other .NET solutions. 回答1: I just found this: http://www.vcskicks.com/image-distortion.html It works great 回答2: You need a projective transformation which can be represented by a 3x3 matrix. I've explained how to obtain this transformation matrix in great detail in this SO solution. 来源

XSLT Transformation: Search nodes, and return hierarchical parents

笑着哭i 提交于 2019-12-11 06:15:55
问题 hoping this hasn't been asked before, but I have the following XML: <Company id="1000" name="Company1000"> <Company id="1020" name="Company1020" /> <Company id="1004" name="Company1004"> <Company id="1005" name="Company1005" /> </Company> <Company id="1022" name="Company1022" /> </Company> I have the following XPath to search for nodes: //*[contains(translate(@name, "ABCDEFGHJIKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"), "005")] I would like this to return: <Company id="1000" name=

Flatten curved surface

痴心易碎 提交于 2019-12-11 05:17:43
问题 I am trying to compute a panoramic projection for dental imaging purpose. I have a rectangle surface "curved" in one direction by a piecewise function. If we look at it from the top, it looks like a regular piecewise function. The "piecewise linear function" is just defined by a set of 3D points. All the points are in the same plane. The plane where all the 3D points sit is orthogonal to the curved surface (see the green line in the top-left window) I am looking for the proper way to "flatten

Viewing pipeline and 3D Transformations

烈酒焚心 提交于 2019-12-11 04:27:46
问题 My question is quite basic in computer graphics field, but somehow I couldn't find an answer. Prolog: I want to write a program which prints polygons on a canvas, and I'd like to allow users to play with the polygons - scale, translate and rotate (around x/y/z axis). I ought to use java AWT only; not JOGL (java's library for openGL). I recieve the polygons as 3d world coordinates as via input file to the program, as well as "camera" properties such as coordinates of camera, look at point, up

Image with accordion effect

对着背影说爱祢 提交于 2019-12-11 02:15:18
问题 I have read in an image file to MATLAB and I am trying to stretch it in one direction, but a variable amount (sinusoidal). This would create an accordion affect on the image. I have toyed around with imresize, however that only resizes the image linearly. I would like the amount of "stretch" to vary for each image line. I tried to convey this with the following code: periods = 10; % Number of "stretch" cycles sz = size(original_image,2)/periods; s = 0; x = 0; for index = 1:periods B =

How to make UIViewAnimationTransitionCurlUp in reversed direction?

断了今生、忘了曾经 提交于 2019-12-11 02:11:57
问题 I'm working on the app which allows flipping of the interface under some circumstances. Both landscape orientation should be supported (landscape left and right). Device flipping and orientation changes works fine, however, when in landscape mode, application allows to go to another screen using UIViewAnimationTransitionCurlUp effect and then back with UIViewAnimationTransitionCurlDown. This works fine when orientation is landscape left (curl page up from the left bottom corner and then back)

Change origin point of QPainter

走远了吗. 提交于 2019-12-11 02:07:17
问题 By default QPainter has its origin point in top-left corner. I want to draw shapes but all coordinates that I have are in cartesian system. So my question - how can I change the origin point to bottom-left corner? Sure, I can scale(1,-1) but then drawText() also scaled and prints inverted text. All I nee it just move origin point. 回答1: QPainter painter(this); painter.translate(this.rect().bottomLeft()); painter.scale(1.0, -1.0); 回答2: You can use void QPainter::translate ( const QPointF &

xml, xsl transformation with CDATA

妖精的绣舞 提交于 2019-12-11 01:38:41
问题 I am new to xsl xml transformation. For now, I have an xml file that contains the following information: <bio> <published>Tue, 7 Oct 2008 14:47:26 +0000</published> <summary><![CDATA[ Dream Theater is an American <a href="http://www.last.fm/tag/progressive%20metal" class="bbcode_tag" rel="tag">progressive metal</a> band formed in 1985 under the name "<a href="http://www.last.fm/music/Majesty" class="bbcode_artist">Majesty</a>" by <a href="http://www.last.fm/music/John+Myung" class="bbcode

Homographic image transformation issue for sattelite images

半世苍凉 提交于 2019-12-11 01:33:21
问题 I want to apply homography to the satellite images. I found this post quite helpful. So I decided to use the same Matlab code. im = imread('cameraman.tif'); n = [0;0;-1]; d = Inf theta = 60*pi/180; R = [ 1 0 0 ; 0 cos(theta) -sin(theta); 0 sin(theta) cos(theta)]; t = [0;0;0]; K=[300 0 0; 0 300 0; 0 0 1]; H=K*R/K-1/d*K*t*n'*K; img=imagehomog(im,H','c'); figure;imshow(img) but the output is just the small box. I am using MATLAB 2015b EDIT Homography using imtransform and maketform n = [0;0;-1];

Transforming repeating group into several text lines

ε祈祈猫儿з 提交于 2019-12-11 01:15:59
问题 I wanted to transform repeating group from the sample XML into two delimited text lines. Here is my current code version: string orderXml = @"<?xml version='1.0' encoding='utf-8'?> <Order id='79223510'> <Status>new</Status> <ShipMethod>Standard International</ShipMethod> <ToCity>Tokyo</ToCity> <Items> <Item> <SKU>SKU-1234567890</SKU> <Quantity>1</Quantity> <Price>99.95</Price> </Item> <Item> <SKU>SKU-1234567899</SKU> <Quantity>1</Quantity> <Price>199.95</Price> </Item> </Items> </Order>";