变形点在一架飞机上(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.
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
最满意答案
在创建时,
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 ofTTreeItem
(and yourTVppTreeItem
) isnil
and accessing it results in AV error. You should move code that modifiesTextObject
toApplyStyle
method whereTextObject
will be initialized from Style. Since it is not guaranteed thatTextObject
will be valid even after applying style, you should check it fornil
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;
相关问答
更多-
德尔福XE8。(Delphi XE8. FMX. Why is different release order of CLASS VAR on Android platform?)[2022-11-05]
桌面编译器 当应用程序对象销毁其组件时,主表单将被销毁。 这发生在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) ...
-
在delphi xe7中自定义FMX.InAppPurchase.Android单元(customize FMX.InAppPurchase.Android unit in delphi xe7)[2023-06-11]
在项目文件夹中创建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 ...
-
文本提示Delphi XE7(Text Prompt Delphi XE7)[2022-02-27]
您也可以在您的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 ...
-
FMX SharedPreferences(FMX SharedPreferences)[2022-08-05]
首先,这甚至不会在调试器中显示,所以甚至不用费心去尝试。 有这个确切的问题,它正在驱使我努力! 这就是我要解决的问题。 不要声明编辑。 这是我的READ代码: var Prefs : JSharedPreferences; s: string; begin prefs := SharedActivity.getSharedPreferences(StringToJString('NCVPPP'), 0); s := (JStringToString(prefs.getString( S ... -
Delphi xe3 Mainform隐藏(Delphi xe3 Mainform hide)[2022-04-02]
在FireMonkey应用程序中,自动创建的表单(已创建)和MainForm属性在Application.Run方法中指定。 因此导致访问冲突是因为MainForm属性和form1变量为nil。 要访问此类属性,必须首先执行RealCreateForms方法 begin Application.Initialize; Application.CreateForm(TForm2, Form1); Application.RealCreateForms; //Application.MainFo ...