首页 \ 问答 \ 变形点在一架飞机上(Deform points in a plane)

变形点在一架飞机上(Deform points in a plane)

Point ::(xy)是已知的。

我在三角形区域内有点。
我知道初始位置和最终位置的顶点坐标。 我知道三角形区域内所有点的初始坐标。

现在我想找出三角区域内所有点的最终坐标。

下面的图片显示了初始和最终位置中的点。

在这里输入图像描述在这里输入图像描述

任何人都可以告诉我如何在OpenCV和C ++平台上做到这一点?

我也可以为任意形状的轮廓做这个吗?


Point :: (x y) is known.

I have points inside a triangular region.
I know the coordinates of the vertices in initial and final positions. I know the initial coordinates of all the points inside the triangular region.

Now I want to find out the final coordinates of all the points inside the triangular region.

The picture below shows the points in initial and final positions.

enter image description here enter image description here

Can anyone tell me how to do this in OpenCV and C++ platform??

Can I do this for arbitary shaped contour also?


原文:https://stackoverflow.com/questions/15109182
更新时间:2024-01-31 15:01

最满意答案

在创建时, TTreeItem (和您的TVppTreeItem )的TextObject字段nil ,访问它会导致AV错误。 您应该将修改TextObject代码移动到ApplyStyle方法,其中TextObject将从Style初始化。 由于无法保证TextObject即使在应用样式后仍然有效,因此在尝试对其执行任何操作之前,应将其检查为nil

  TVppTreeViewItem = class(TTreeViewItem)
  protected
    procedure ApplyStyle; override;
  public
    constructor Create(AOwner: TComponent); override;
  end;

constructor TVppTreeViewItem.Create(AOwner: TComponent);
begin
  inherited;
  self.Text := 'test';
end;

procedure TVppTreeViewItem.ApplyStyle;
begin
  inherited;
  if Assigned(TextObject) then
    begin
      TextObject.Align := TAlignLayout.Left;
      TextObject.Margins.Left := 50;
    end;
end;

At creation time TextObject field of TTreeItem (and your TVppTreeItem) is nil and accessing it results in AV error. You should move code that modifies TextObject to ApplyStyle method where TextObject will be initialized from Style. Since it is not guaranteed that TextObject will be valid even after applying style, you should check it for nil before you attempt to do anything with it.

  TVppTreeViewItem = class(TTreeViewItem)
  protected
    procedure ApplyStyle; override;
  public
    constructor Create(AOwner: TComponent); override;
  end;

constructor TVppTreeViewItem.Create(AOwner: TComponent);
begin
  inherited;
  self.Text := 'test';
end;

procedure TVppTreeViewItem.ApplyStyle;
begin
  inherited;
  if Assigned(TextObject) then
    begin
      TextObject.Align := TAlignLayout.Left;
      TextObject.Margins.Left := 50;
    end;
end;

相关问答

更多
  • 桌面编译器 当应用程序对象销毁其组件时,主表单将被销毁。 这发生在DoneApplication过程中的DoneApplication 。 procedure DoneApplication; begin if Screen <> nil then Screen.ActiveForm := nil; Application.DestroyComponents; <-- this is destroying your main form end; DoneApplication在关闭过程中 ...
  • 我认为第一个问题是,当你运行程序时,它将尝试使用FMX文件的副本加载对象的设计状态。 这个问题是它期望TTestGroupButton有一个标准的Create构造函数,实际上你没有,所以它使用TRadioButton.Create代替,这意味着在运行时你的InternalCreate永远不会被调用。 还有第二个问题,即动态创建按钮,实际上这可能会导致您的第一个问题。 尝试解决此问题的一种方法可能是定义一个额外的创建。 喜欢这个: TTestGroupButton = class(TRadioButton) ...
  • 在项目文件夹中创建FMX.InAppPurchase.Android自定义版本,并将其添加到项目Project - > Add to Project 。 当您这样做时,Delphi将编译并使用您的自定义版本而不是原始版本。 Create customized version of FMX.InAppPurchase.Android in your project folder and add it to your project Project -> Add to Project. When you do ...
  • 在创建时, TTreeItem (和您的TVppTreeItem )的TextObject字段nil ,访问它会导致AV错误。 您应该将修改TextObject代码移动到ApplyStyle方法,其中TextObject将从Style初始化。 由于无法保证TextObject即使在应用样式后仍然有效,因此在尝试对其执行任何操作之前,应将其检查为nil 。 TVppTreeViewItem = class(TTreeViewItem) protected procedure ApplyStyl ...
  • TResourceStream构造函数的第一个参数是搜索资源的模块实例。 因此,如果您确实正确地链接了资源,使用正确的类型和名称,那么可以假设您传递的是错误的模块实例。 因此,实现拼写错误的TPmFmxTitelbar的模块可能不是资源链接到的模块。 如果您确实传递了正确的模块实例,那么剩下的结论是您无法使用指定的类型和名称链接资源。 使用资源查看器/编辑器进行检查。 ok, I solved this problem. I added the 'FmxComponents.dres' to my comp ...
  • 你可以在Android设备上运行USSD代码,但是你不能在你的应用程序中解析结果(这与Delphi没有关系,同样的问题也在Java上)。 此功能可能会在未来添加到Android SDK中,但现在,您将不得不寻找替代方案。 在Android中运行USSD代码而不使用“Intent.ACTION_CALL” You can run USSD codes in Android devices but you would be unable to parse the result in your applicati ...
  • 您也可以在您的TEdit中粘贴TLabel并将其与内容或客户端对齐。 将它的HitTest属性设置为false。 在onChange事件中,根据Text属性是否为空来显示或隐藏它。 TextPrompt在以前的版本中也有问题,所以我使用了这种解决方法。 You can also just stick a TLabel inside of your TEdit and align it to Content or Client. Set it's HitTest property to false. In t ...
  • VCL / FMX事件处理程序在运行时与特定对象绑定。 分配事件处理程序时,需要用对象指针替换类的类型名称。 当事件稍后触发时,该对象将成为事件处理程序的Self指针: New_Button.OnClick := Self.GoodbyeClick ; 或者干脆: New_Button.OnClick := GoodbyeClick ; // Self implicitly used 在附注中 - 创建Button时,该代码位于TForm1实例方法内部,因此您应该使用Self对象指针而不是全局Form1 ...
  • 首先,这甚至不会在调试器中显示,所以甚至不用费心去尝试。 有这个确切的问题,它正在驱使我努力! 这就是我要解决的问题。 不要声明编辑。 这是我的READ代码: var Prefs : JSharedPreferences; s: string; begin prefs := SharedActivity.getSharedPreferences(StringToJString('NCVPPP'), 0); s := (JStringToString(prefs.getString( S ...
  • 在FireMonkey应用程序中,自动创建的表单(已创建)和MainForm属性在Application.Run方法中指定。 因此导致访问冲突是因为MainForm属性和form1变量为nil。 要访问此类属性,必须首先执行RealCreateForms方法 begin Application.Initialize; Application.CreateForm(TForm2, Form1); Application.RealCreateForms; //Application.MainFo ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)