transform

Different between warpPerspective and perspectiveTransform

杀马特。学长 韩版系。学妹 提交于 2019-12-10 20:13:28
问题 I have used four sets of points to get a PerspectiveTransform matrix t.Then using warpPerspective to tranform Mat A to Mat B. Point a from Mat A .I want to get the new Point a position in Mat B.But warpPerspective() can not do that while perspectiveTransform can. Here i want to know if the position get from perspectiveTransform is same with position in Mat B by using warpPerspective. So , what's the different between warpPerspective and perspectiveTransform? Mat trans =

Obtaining year-on-year percentage change by group

匆匆过客 提交于 2019-12-10 19:32:45
问题 I'm working with a data set corresponding to the extract: set.seed(1) df <- data.frame(indicator=runif(n = 100),cohort=letters[1:4], year=rep(1976:2000, each=4)) I would like to generate a variable with percentage year-on-year change for each cohort represented in the data set. I have tried to use the code below (from this discussion): df$ind_per_chng <- transform(new.col=c(NA,indicator[-1]/indicator[-nrow(df)]-1)) but I'm interested in making it work within each subgroup and generating only

transform entire axes (or scatter plot) in matplotlib

半腔热情 提交于 2019-12-10 19:32:43
问题 I am plotting changes in mean and variance of some data with the following code import matplotlib.pyplot as pyplot import numpy vis_mv(data, ax = None): if ax is None: ax = pyplot.gca() cmap = pyplot.get_cmap() colors = cmap(numpy.linspace(0, 1, len(data))) xs = numpy.arange(len(data)) + 1 means = numpy.array([ numpy.mean(x) for x in data ]) varis = numpy.array([ numpy.var(x) for x in data ]) vlim = max(1, numpy.amax(varis)) # variance ax.imshow([[0.,1.],[0.,1.]], cmap = cmap, interpolation =

How can i get accurate center points?

我怕爱的太早我们不能终老 提交于 2019-12-10 17:47:57
问题 How can I get accurate center points with OpenCV Hough Circle Transformation? I need more decimal places of accurate in the x,y coordinates. ( on accurate i mean something like this) i got these center coordinates with matlab x107,775526315904 y112,963480232638 x469,550463441518 y208,309866770404 x217,386414755458 y490,882895036058 Here is my code: #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/core/core.hpp> #include <iostream> #include <stdio

css3 animation issue font rendering

这一生的挚爱 提交于 2019-12-10 16:23:40
问题 I have a question for you. I'm currently working on text animation and i have a little problem with it. When I use properties like -webkit-transform my font goes from normal to thinner during the animation and goes back to normal when the animation is over. Here is my code for the animation : @-webkit-keyframes flipOne { 0% { -webkit-transform: perspective(40000px) rotateY(0); -webkit-animation-timing-function: ease-out; } 100% { -webkit-transform: perspective(40000px) rotateY(720deg);

How to rotate, translate and scale a control object around an specific point in WPF

一笑奈何 提交于 2019-12-10 14:32:38
问题 I have a custom built control, which is a rectangle with a few details inside it, but it is a rectangle. I have a center point (X,Y), which I call "Center of Gravity", which "represents" the point. This means that when I set a new position to the object, I want this point to be in the set position. When I rotate the object, I need it to rotate around this point. And when I scale the object, the point must remain in the position set before. Only the size of the object must change. For example,

css3 scale transform / preserve image quality

主宰稳场 提交于 2019-12-10 14:30:03
问题 Let's say a 2000x2000px pixel image is initially displayed at a size that is 10 times lower, meaning 200x200px If transformed through a CSS3 scale(10) here method, it will sure works fine, bu it'll also look very blurry, even if the image is initially displayable at such a size Is there a way to get the initial image size back though this kind of transform ? Meaning displaying the "original" sizes image through a transform 回答1: Put the image in a container, and scale the container. No need

Combining size and translate transitions causes stutter in Safari

白昼怎懂夜的黑 提交于 2019-12-10 14:24:10
问题 When adding transitions to an element and altering the width and/or height and -webkit-transform:translate3d, the transition animation stutters. It appears to animate the width/height change first, as well translate it partially, then snaps to the final translated position. When returning to the original style, however, the animation is smooth. I'm only seeing this in Safari (version 8.0.6 tested). Here's some example css #foo{ width:100%; height:200px; border:1px solid black; position

Why “z-index” does not work for element having transform: translateY()

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:46:43
问题 Below is the snippet: .up { background-color: red; height: 100px; z-index: 100; } .down { background-color: yellow; height: 100px; width: 50%; margin: 0 auto; z-index: 1; transform: translateY(-50%); } <div class="up"></div> <div class="down"></div> As can be seen, the .up element has higher z-index than .down element. However, the .down element still locates in front of the .up element somehow.. Does anyone have ideas about this? How to fix this? 回答1: For z-index to work position must be

SVG Circle file stroke from top in anti clockwise direction on windows

China☆狼群 提交于 2019-12-10 12:22:30
问题 I created SVG Image with circles with filling stroke color. I am unable to fill color from top position in anti-clockwise direction. How to fill in anti-clockwise direction with inline CSS(need to do using inline css). i tried in fiddle it work with adding following css, transform= rotate(-90deg) it works for Linux browsers but not working with windows chrome. JsFiddle How to fill color from top position of SVG circle(from 12o'clk point) in Windows chrome browsers using inline css. Following