smoothing

Font smoothing in Delphi

拥有回忆 提交于 2019-12-03 18:26:01
问题 I had cause to need a label with a large font on a Delphi form and noticed that its curves were still slightly jagged. I compared this with the same size and font in MSWord which was much smoother. After research I found code that allowed me to smooth my fonts but it's messy and I was wondering if there was a better way? Looking in the VCL source, TFont seems wedded to NONANTIALIASED_QUALITY which is rather frustrating... Thanks Bri procedure TForm1.SetFontSmoothing(AFont: TFont); var

THREE.js OBJLoader - load to Geometry, manipulate, then save to BufferGeometry

会有一股神秘感。 提交于 2019-12-03 17:04:41
I'm trying establish why I can't smooth shade geometry loaded with OBJLoader. var loader = new THREE.OBJLoader(manager); loader.load('/manmodel/js/man.obj', function (object, materials) { console.log(object); console.log(materials); man = object; man.traverse(function (child) { if (child instanceof THREE.Mesh) { child.geometry.computeFaceNormals(); child.geometry.computeVertexNormals( true ); child.material = new THREE.MeshPhongMaterial({ color: 'white', shading: THREE.SmoothShading // <----------- THIS IS THE PROBLEM }); } }); man.position.y = -10; scene.add(man); }); This is the result: If I

Is there a Python equivalent to the smooth.spline function in R

孤者浪人 提交于 2019-12-03 16:46:18
问题 The smooth.spline function in R allows a tradeoff between roughness (as defined by the integrated square of the second derivative) and fitting the points (as defined by summing the squares of the residuals). This tradeoff is accomplished by the spar or df parameter. At one extreme you get the least squares line, and the other you get a very wiggly curve which intersects all of the data points (or the mean if you have duplicated x values with different y values) I have looked at scipy

B Spline confusion

女生的网名这么多〃 提交于 2019-12-03 14:35:21
I realise that there are posts on the topic of B-Splines on this board but those have actually made me more confused so I thought someone might be able to help me. I have simulated data for x-values ranging from 0 to 1. I'd like to fit to my data a cubic spline ( degree = 3 ) with knots at 0, 0.1, 0.2, ... , 0.9, 1. I'd also like to use the B-Spline basis and OLS for parameter estimation (I'm not looking for penalised splines). I think I need the bs function from the spline package but I'm not quite sure and I also don't know what exactly to feed it. I'd also like to plot the resulting

Edge Smoothing and filling inner contours in opencv with iOS

吃可爱长大的小学妹 提交于 2019-12-03 14:12:46
问题 I am trying to tan human skin with different intensity with help of opencv. I have already identified human skin and changing color tone of those pixels. But it is not smooth. Top left - original image Top right - saturation channel of original image Bottom left - Gray scale mask identifying locations of skin on original image Bottom right - result image with color tone changed of pixels located in mask. Now my problem is that, in mask image some gap is left because of variation on color tone

how do I select the smoothing parameter for smooth.spline()?

只谈情不闲聊 提交于 2019-12-03 13:45:30
I know that the smoothing parameter(lambda) is quite important for fitting a smoothing spline, but I did not see any post here regarding how to select a reasonable lambda (spar=?), I was told that spar normally ranges from 0 to 1. Could anyone share your experience when use smooth.spline()? Thanks. smooth.spline(x, y = NULL, w = NULL, df, spar = NULL, cv = FALSE, all.knots = FALSE, nknots = NULL, keep.data = TRUE, df.offset = 0, penalty = 1, control.spar = list(), tol = 1e-6 * IQR(x)) agstudy provides a visual way to choose spar . I remember what I learned from linear model class (but not

loess predict with new x values

戏子无情 提交于 2019-12-03 12:12:36
问题 I am attempting to understand how the predict.loess function is able to compute new predicted values ( y_hat ) at points x that do not exist in the original data. For example (this is a simple example and I realize loess is obviously not needed for an example of this sort but it illustrates the point): x <- 1:10 y <- x^2 mdl <- loess(y ~ x) predict(mdl, 1.5) [1] 2.25 loess regression works by using polynomials at each x and thus it creates a predicted y_hat at each y . However, because there

Python smoothing data

这一生的挚爱 提交于 2019-12-03 08:03:57
I have a dataset that I want smoothed. I have two variables y and x that are not evenly spaced. y is the dependant variable. However, I do no know what formula relates x to y. I read all about interpolation, but interpolation requires me to know the formula that relates x to y. I also looked at other smoothing functions, but these cause problems in the start and endpoints. Does anyone know how to either: -Obtain a formula that relates x to y -Smooth the datapoints without messing up the endpoints My data looks as followed: import matplotlib.pyplot as plt x = [0.0, 2.4343476531707129, 3

Python smoothing data

北城以北 提交于 2019-12-03 07:54:47
问题 I have a dataset that I want smoothed. I have two variables y and x that are not evenly spaced. y is the dependant variable. However, I do no know what formula relates x to y. I read all about interpolation, but interpolation requires me to know the formula that relates x to y. I also looked at other smoothing functions, but these cause problems in the start and endpoints. Does anyone know how to either: -Obtain a formula that relates x to y -Smooth the datapoints without messing up the

Smoothing Edges of a Binary Image

孤街醉人 提交于 2019-12-03 05:11:31
问题 How to smooth the edges of this binary image of blood vessels obtained after thresholding. I tried a method somewhat similar to this method but did not quite get the result I expected. Here's the code: import cv2 import numpy as np INPUT = cv2.imread('so-br-in.png',0) MASK = np.array(INPUT/255.0, dtype='float32') MASK = cv2.GaussianBlur(MASK, (5,5), 11) BG = np.ones([INPUT.shape[0], INPUT.shape[1], 1], dtype='uint8')*255 OUT_F = np.ones([INPUT.shape[0], INPUT.shape[1], 1],dtype='uint8') for r