|T O P I C R E V I E W
||Posted - Oct 13 2020 : 13:16:53
I want to select a polygon ROI and enlarge the ROI by codes.
1. How to get the position (x,y) for each dots of the polygon?
2. How to select a polygon by codes?
3. Is it possible to enlarge the ROI using th codes like: Select( SelX1 - 10, SelY1 - 10, SelX2 - 10, SelY2 - 10 , Selx3 -10, Sely3-10,....,Slex100+10, Sley100+10,....)
Thank you very much.
|5 L A T E S T R E P L I E S (Newest First)
||Posted - Oct 14 2020 : 23:11:27
There is no built in method in ImageEn to do this. You can try using our internal method (but we can't provide technical support for it).
In hyieutils there are scale methods:
procedure IEScalePoints(var rpt: array of TPoint; PointCount: Integer; MinX, MinY, MaxX, MaxY: Integer; MaintainAR: Boolean = False);
procedure IEScaleDPoints(var rpt: array of TDPoint; PointCount: Integer; MinX, MinY, MaxX, MaxY: Double; MaintainAR: Boolean = False);
Which take an array of TDPoint or TPoint and scale all points to be within a rect bounded by (MinX, MinY) and (MaxX, MaxY).
||Posted - Oct 14 2020 : 05:12:45
I tried to use selx1, sely1, but failed for polygon ROI.
// Enlarge the selection by ten pixels on all sides
With ImageEnView1 do
SelectionBase := iesbBitmap;
Select( SelX1 - 10, SelY1 - 10, SelX2 - 10, SelY2 - 10 );
||Posted - Oct 14 2020 : 05:05:54
Thank you very much for your help.
By learning the example, I could get the points array for the polygon ROI selection, and make the same polygon ROI selection by code. But I don't know how to enlarge the polygon ROI on all sides, for example, Enlarge the polygon ROI selection by ten pixels on all sides. There is one example to show how to "Enlarge the selection by ten pixels on all sides" for a rectangle ROI selection, while I din't find one example for a polygon selection.
The following is the codes to get the points array for the polygon ROI selection, and make the same polygon ROI selection by code.
Could you please teach me how to enlarge the polygon selection on all sides?
Thanks a lot.
procedure TForm1.Button4Click(Sender: TObject);
MyPolySelArray: array of TPoint;
// Create an array of TPoints of the polygon selection in a TImageEnView
SetLength( MyPolySelArray, ImageEnView1.PolySelCount );
for I := 0 to ImageEnView1.PolySelCount - 1 do
MyPolySelArray[ I ] := ImageEnView1.PolySel[ I ];
//how to modify the points to enlarge the ROI on all sides.
// Create a polygon selection from an array of TPoints
for I := Low( MyPolySelArray ) to High( MyPolySelArray ) do
ImageEnView1.AddSelPoint( MyPolySelArray[I].x, MyPolySelArray[ I ].y );
||Posted - Oct 13 2020 : 21:32:04
Thank you very much.
||Posted - Oct 13 2020 : 18:45:41
Please the example at:
To convert control coordinates to bitmap ones use: