curve

Ear Image Processing - Finding the point of intersection of line and curve in MATLAB

孤者浪人 提交于 2019-12-02 04:26:32
! 1 I have the Canny edge output of a ear... i have connected the farthest two boundaries with a line(green). Now I want to draw a normal from the midpoint of this line to the outer boundary(left side). The code i have written helps me to plot a normal but i want the red line to exactly meet the white boundary. Also I want the point of intersection at the point where it meets. I have also thought about another method for the same.By changing 50 to 60 pixels (in the code) the red line crosses the white boundary. If I get the point of intersection of the same then I can easily plot the line of

Using “curve” to plot a function: a tricky expression?

别说谁变了你拦得住时间么 提交于 2019-12-02 03:41:25
问题 My question concerns something that should be fairly simple, but I can't make it work. What I mean is you can calculate x and y and then plot them with the plot function. But can this be done using the curve function? I want to plot the following R function f2 : n <- 1 m <- 2 f2 <- function(x) min(x^n, x^(-m)) But this code fails: curve(f2, 0, 10) Any suggestions? 回答1: As has been hinted at, the main reason why the call to curve fails is because curve requires a vectorized function (in this

catmull-rom splines for Android

给你一囗甜甜゛ 提交于 2019-12-02 03:32:33
问题 I'm trying to find a way to implement catmull-rom splines on the android platform for the purpose of smoothly drawing a line through n points. Ideally I would be able to adapt cubic beziers via the Path and its cubicTo method as alluded to in this thread: How do I draw a curve through tree points in Android? Unfortunately, I wasnt able to follow the implementation there so I'm hoping somebody out there has already done this and can share a few lines of sample code. Thanks! 回答1: This game

Plotting a function curve in R with 2 or more variables

对着背影说爱祢 提交于 2019-12-02 03:02:54
How can I draw a curve for a function like vpd = function(k,D){exp(-k*D)} in R? I want a plot of D vs vpd (0:1) assuming k is constant. The only question I could find was How to plot a function curve in R . I've tried both of: plot.function(vpd, from=0, to=1, n=101) curve(vpd, from=0, to=1, n=101, add=FALSE, type = "l") but only get Error in -k * D : 'D' is missing UPDATE: solved it! vpd <- function(D,k=0.05){exp(-k*D)} # D is the x axis plot(vpd, from=1, to=100, ylim=0:1) While Mamoun Benghezal's answer works for functions you define yourself, there may be cases where you want to plot a

Area between line and curve (no function)

淺唱寂寞╮ 提交于 2019-12-02 01:14:21
问题 I want to calculate the area beween the orange and the blue line. I managed to shade the area. But I do not know how to apply the trapz function in order to get the area. In this post: Area under surface between two curves I got some solutions but I do not have a specific equation for the curves just the plots per se. The code for the orange line is: x_1 = [0,M1_1]; y_1 = [c1,c1]; v = plot(x_1,y_1,'LineWidth',2) The blue curve is a plot of arrays with the length of (10000x1)-abscissa and

Nearest point on cubic bezier curve to a given point

牧云@^-^@ 提交于 2019-12-02 01:11:42
问题 I have a cubic-Bezier curve defined as A, B, C, D. Where A is the start, B and C are control points, and D is the end. I understand how to find the position at any value t, where 0 <= t <= 1, and that concept in general since it just uses a handful of calls to a linear interpolation function that result in the curve. (Can be visualized easily here on wikipedia just below the heading Higher-order curves) I am now looking to find a point on the curve that is closest to some point in space, P.

Calculate curvature for 3 Points (x,y)

≡放荡痞女 提交于 2019-12-01 13:15:31
I have a two dimensional euclidean space. Three points are given. For example (p2 is the middle point): Point2D p1 = new Point2D.Double(177, 289); Point2D p2 = new Point2D.Double(178, 290); Point2D p3 = new Point2D.Double(178, 291); Now i want to calculate the curvature for these three points. double curvature = calculateCurvature(p1, p2, p3); How to do this? Ist there a existing method (no java external libraries)? Curvature: https://en.wikipedia.org/wiki/Curvature Menger Curvature: https://en.wikipedia.org/wiki/Menger_curvature For the Menger Curvature, the formula is right there in the

Thick Bezier Curves in OpenGL

情到浓时终转凉″ 提交于 2019-12-01 12:53:07
I am writing a program in java using the jogl opengl bindings. I need to create a bezier curve that varies in thickness along the curve. So far I've only managed a thin bezier curve of single points. I'm pretty sure that this isnt going to be an easy thing to do, but i I have no idea where to even begin looking for the solution. If anyone could point me in the right direction as to how to solve this, it'd be greatly appreciated! James Sample the curve and for each sample point compute two points, one on each side of the curve, along the normal line at the sample point and at a distance equal

How to find FWHM in a dataset with multiple peaks?

风格不统一 提交于 2019-12-01 12:16:03
问题 I'm using a Python script which finds the indexes of the peaks (or valleys in my case) along a 1D profile, in a specific range of values. My aim is to measure the FWHM for each valley of interest. This is an example of 1D profile This is the script: def detect_peaks (x, mnph=None, mxph=None, mpd=1, threshold=0, edge='rising', kpsh=False, valley=False, show=False, ax=None): #from __future__ import division, print_function import numpy as np x = np.atleast_1d(x).astype('float64') if x.size < 3:

Thick Bezier Curves in OpenGL

核能气质少年 提交于 2019-12-01 10:30:06
问题 I am writing a program in java using the jogl opengl bindings. I need to create a bezier curve that varies in thickness along the curve. So far I've only managed a thin bezier curve of single points. I'm pretty sure that this isnt going to be an easy thing to do, but i I have no idea where to even begin looking for the solution. If anyone could point me in the right direction as to how to solve this, it'd be greatly appreciated! James 回答1: Sample the curve and for each sample point compute