distortion

Pinch/pucker an image in canvas

女生的网名这么多〃 提交于 2021-02-16 13:39:25
问题 How can I pinch/pucker some area of an image in canvas? I've made a solar system animation some time ago, and I started rewriting it. Now, I want to add gravity effect to masses. To make the effect visible, I turned the background into a grid and I'll be modifying it. Desired effect is something like this (made in PS) context.background("rgb(120,130,145)"); context.grid(25, "rgba(255,255,255,.1)"); var sun = { fill : "rgb(220,210,120)", radius : 30, boundingBox : 30*2 + 3*2, position : { x :

What could make undistortion code not work for several chessboard images having the same dimensions?

柔情痞子 提交于 2021-01-29 14:01:42
问题 I am beginner in OpenCV-Python. I would like to know what could make my undistortion code work for this chessboard picture and not work for this one knowing that the too chessboards have the same dimension. The code i am talking about is as below import cv2 import numpy as np criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) cbrow = 7 cbcol = 9 objp = np.zeros((cbrow * cbcol, 3), np.float32) objp[:, :2] = np.mgrid[0:cbcol, 0:cbrow].T.reshape(-1,2) objpoints = []

Camera lens distortion in OpenGL

孤者浪人 提交于 2020-06-26 05:52:23
问题 I'm trying to simulate lens distortion effect for my SLAM project. A scanned color 3D point cloud is already given and loaded in OpenGL. What I'm trying to do is render 2D scene at a given pose and do some visual odometry between the real image from a fisheye camera and the rendered image. As the camera has severe lens distortion, it should be considered in the rendering stage too. The problem is that I have no idea where to put the lens distortion. Shaders? I've found some open codes that

TensorFlow: How to apply the same image distortion to multiple images

只愿长相守 提交于 2020-05-11 05:40:36
问题 Starting from the Tensorflow CNN example, I'm trying to modify the model to have multiple images as an input (so that the input has not just 3 input channels, but multiples of 3 by stacking images). To augment the input, I try to use random image operations, such as flipping, contrast and brightness provided in TensorFlow. My current solution to apply the same random distortion to all input images is to use a fixed seed value for these operations: def distort_image(image): flipped_image = tf

Waving text on canvas

走远了吗. 提交于 2020-02-02 06:39:51
问题 How could I make waving text on a canvas element similar to what is found on this page? 回答1: EDIT : @Ben, forget about the downvotes for no reason on your question, and... BE MY GUEST! :) I never coded with <canvas> before, it was very fun. At this point, there is no bilinear interpolation. I might rework it and add more bells and whistles. If you want to achieve such an effect in javascript, you'll effectively have to use the <canvas> tag. The principle consists in precalculating a

OpenGL pixels drawn with each horizontal pair swapped

瘦欲@ 提交于 2020-01-24 11:51:21
问题 I'm somewhat new to OpenGL though I'm fairly sure my problem lies in the pixel format being used, or how my texture is being generated... I'm drawing a texture onto a flat 2D quad using a 16bit RGB5_A1 pixel format, though I don't make use of any alpha at this stage. The problem I'm having is that each pair of horizontal pixel values have been swapped . That is... if the pixels positions should be in this order (assume 8x2 image) 0 1 2 3 4 5 6 7 they are instead drawn as 1 0 3 2 5 4 7 6 Or,

How to plot using matplotlib (python) colah's deformed grid?

不羁岁月 提交于 2020-01-13 09:43:10
问题 I need to create a visualization in Python just like colah's did on his site. However, I could not find any distortion to grid on matplotlib to perform exactly like he did here. Pls, help me if you can. This is the plot I need to perform: 回答1: I would guess the image is produced by adding some gaussian function to the grid. import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection def plot_grid(x,y, ax=None, **kwargs): ax = ax or plt.gca() segs1 = np

creating image using polar coordinates (image transformations)

这一生的挚爱 提交于 2020-01-05 03:47:09
问题 I'm working on image warping. The transformed version of the real coordinates of an image are x and y, and, the polar coordinates of the transformed image are r and theta. (cylindrical anamorphosis). I have the transformation functions. But Im confused about a certain things. I'm getting the polar coordinates from transformation functions which can easily be converted to cartesian. But how to draw this transformed image? as the new size will be different than the old image size. EDIT : I have

Unwarp curved surface

纵饮孤独 提交于 2019-12-25 07:08:41
问题 I have a cylindrical object on which a circular label is pasted. I extract the contour of the image. I know the radius of the cylindrical object as well as the label. But not every time the ellipse obtained will be exactly symmetrical. How can I unwrap the ellipse into a circle? Here's an image which is not symmetrical EDITED I tried to extend @Haris's solution something like this Instead of just just 4 points, I want to use an array of points to get a more accurate circle. But

my iOS app using audio units with an 8000 hertz sample rate returns a distorted voice

大兔子大兔子 提交于 2019-12-24 23:13:54
问题 I really need help with this issue. I'm developing an iOS application with audio units, the recorded audio needs to at 8bit / 8000 hertz sample rate using alaw format. How ever I'm getting a distorted voice coming out the speaker. I came across this sample online: http://www.stefanpopp.de/2011/capture-iphone-microphone/comment-page-1/ while trying to debug my app I used my audioFormat in his application and I am getting the same distorted sound. I guessing I either have incorrect settings or