Get the coordinates of a drawn line

Share your programming ideas for various measurement and analysis tasks here
Post Reply
user-6193
Posts: 5
Joined: Thu Jan 01, 1970 1:00 am

Get the coordinates of a drawn line

Post by user-6193 »

Hi,
I'm new to OAD and i'm working on image registration.

To realize rigid image registration I need to draw a line on both images.

After tracing the line how can I obtain the coordinates of the two points that define the line ?

I tryed to use the MeasureToTable function:

Code: Select all

image1 = Zen.Application.Documents.GetByName("Copy-01")
Zen.Application.Documents.ActiveDocument = image1

Zen.Application.Pause('Draw the line !')

[B]table = Zen.Measurement.MeasureToTable(image1)[/B]
But I don't know how the "table" works, so if the points are stored in the table I don't know how to access it...

Kind regards,
Thomas A.
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Dear Thomas,

If you run your macro or step through via F10 and pass line

table = Zen.Measurement.MeasureToTable(image1)

you will find that IntelliSense is active.

You can explore your table e.g.

print table.ColumnCount
print table.RowCount

print table.Rows[0][0]
print table.Rows[0][1]


ZenTable is also found in the Menu under Help - Macro Object Model.
user-5788
Posts: 6
Joined: Thu Jan 01, 1970 1:00 am

Post by user-5788 »

In addition it might be better not to use a line (has no parameter coordinates) but to use Events(Markers) instead and draw start and endpoint. This way cou can obtain the X and Y coordinates.

Code: Select all

image1 = Zen.Application.Documents.GetByName("Copy-01")
Zen.Application.Documents.ActiveDocument = image1

Zen.Application.Pause('Draw start and endpoint !')

table = Zen.Measurement.MeasureToTable(image1)
print table.ColumnCount
print table.RowCount


print table.Rows[0][0]
print table.Rows[0][1] # X-coordinate startpoint
print table.Rows[0][2] # Y-coordinate startpoint

print table.Rows[1][1] # X-coordinate endpoint
print table.Rows[1][2] # Y-coordinate endpoint

Rose J Lever
Posts: 23
Joined: Tue Jun 20, 2023 10:20 pm

Re: Get the coordinates of a drawn line

Post by Rose J Lever »

To obtain the coordinates of a drawn line, I assume you are referring to a scenario where a line is drawn on a two-dimensional plane. If that's the case, please provide me with more information about the context in which the line is being drawn. Are you using a specific software or programming language to draw the line? Alternatively, if you have a specific line in mind, you can provide me with the starting and ending points of the line, and I can help you with the coordinates based on that information. If anyone want to know about Garage door opener repair Carrollton visit here
Rose J Lever
Posts: 23
Joined: Tue Jun 20, 2023 10:20 pm

Re: Get the coordinates of a drawn line

Post by Rose J Lever »

Measurement and analysis in CMMI (Capability Maturity Model Integration) refers to the systematic process of collecting, analyzing, and interpreting data to gain insights into the performance and effectiveness of an organization's processes. It involves defining measurement objectives, identifying relevant data to be collected, establishing measurement techniques and tools, and using statistical analysis to derive meaningful metrics and indicators. If anyone want to know about affordable locksmith tampa visit here
Post Reply