How to extract raw x and y coordinates from the outline of counted objects?
Hi, I'm new to using Image-Pro Premier so there's probably an easy solution to this, although I can't seem to see it..
After counting objects, I am able to right-click and then create a mean centroid point of an object, which has x,y coordinates displayed in the measurement table. However, is there an easy way to extract corresponding x,y coordinates for all of the points that bound the outline of the object?
Thanks,
Chris
After counting objects, I am able to right-click and then create a mean centroid point of an object, which has x,y coordinates displayed in the measurement table. However, is there an easy way to extract corresponding x,y coordinates for all of the points that bound the outline of the object?
Thanks,
Chris
0
Answers
All --
I would like to work with BOUNDARY POINTS from an AREA / REGION.
The DISCUSSION above seems to be right on point about how to access this information within PREMIER.
I downloaded
SampleOutline.ipx
and attempted to run it within
PREMIER V9.1.4
The ERROR MESSAGE (below TOP) was generated and then LINE 37 of the CODE (below BOTTOM) was highlighted.
It seems that
sf.FeatureIndex
or
points
is not set up properly.
Since this IPX FILE was supplied by Yuri, I would think it was working when it was posted.
Can someone direct me to the correction that needs to be made?
Thanks.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
The project had old flag Optimizer Off. I've switched it to on and attached the new version.
Please try this,
Yuri
Yuri --
Thank you for your prompt response.
I downloaded the ZIP file . . . Put it in a new folder . . . Extracted the IPX file from within . . . Added the Project to the WORKBENCH . . . then I tied to run the SUBROUTINE.
I received the same error.
I shut down PREMIER 9.1.4 . . . moved the IPX file (to clear any memory of it from PREMIER) . . . Restarted PREMIER 9.1.4 . . . Added the Project to the WORKBENCH . . . then I tried to run the SUBROUTINE.
I received the same error.
I did the same as above with PREMIER 3D V9.3 and the routine works properly.
Any suggestions on why it is having a problem with 9.1.4?
Thanks.
-- Matt
I thought you are using 9.3. Please check in 9.3 and let me know the results.
Yuri
Yuri --
Thank you for your prompt response.
Here are my results
PREMIER 9.1.4 = ERROR
PREMIER 9.2 = WORKS
PREMIER 3D 9.3 = WORKS
I have queried the user to learn exactly which PREMIER he is using.
Any suggestions to make it VERSION INDEPENDENT?
Thanks.
-- Matt
Yuri
Yuri and Craig --
Thank you for the additional information.
I thought he was a long time PREMIER CUSTOMER but it seems he just recently purchased PREMIER so he probably has 9.2 (we are checking) so the EXAMPLE CODE may run fine.
I appreciate your assistance.
-- Matt
All --
I have been working on this project with PREMIER (2D) V9.2 and I thought I had it tackled but this glitch has appeared again.
In the first image below, you will see that a modified version of
PrintOutlineCoordinates
named
PrintOutlineCoordinates2
handles the BOUNDARY POINTS as intended (see first image below).
The problem is that I have created a CLEAN SHEET APP and I have a BUTTON within it that calls the same CODE.
When I trigger this function (see second image below), the ERROR
appears.
I tried to implement Craig's suggestion about replacing SINGLEPOINT with OBJECT in the DIM POINTS STATEMENT but it did not resolve the problem.
Your assistance with this resolving this issue would be much appreciated.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Do you have all Imports (at the top of VB file) as in my project?
Yuri
Yuri --
Thank you for your prompt response.
Yes . . . to the best of my ability I have IMPORTED the right things.
Please see below.
I have also performed an EXPORT REFERENCES from the EXAMPLE PROJECT and performed an IMPORT REFERENCES in my PROJECT.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Thanks,
Yuri
Yuri --
Thank you for your response.
Per your request, I created and attached
Save Boundary Points Project V1A -- 2017-03-04-172040.ipx
and
black-dot.tif
so you will be able to run the software with the same image that I am using.
I have been doing the recent DEVELOPMENT and TESTING with PREMIER 9.2. I do not have PREMIER 9.3 on my computer.
When I try to load the PROJECT (via FILES or IPX FILE) I get the error shown in the SCREEN CAPTURE shown below.
Thank you for your assistance.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
I checked your project and here are my notes:
1. Premier 9.3 is a free upgrade to Premier 9.2, so please download and install it, so we are on the same page. (http://www.mediacy.com/support/productupdates )
2. Your IPX file looks strange, it looks like you just zipped the folder with IPP project and renamed it to IPX. If yes, then it's not the way you create IPX files. You have to use the Package menu item in the project workbench.
3. Your project had Optimizer Off - this was used with old projects, all new projects in 9.2 and above use "Optimizer On", you can change it in the Project Workbench.
After this change your project runs correctly.
4. You should add more checks like:
If ThisApplication.ActiveImage Is Nothing Then Exit Sub
as your macro throws errors if the active image is Welcome page.Regards,
Yuri
Yuri --
Thank you for your response. Especially because on WEEKEND TIME.
1) I will address this ASAP.
2) I created the IPX file with a
PREMIER + WORKBENCH + FILE + PACKAGE + AS PROJECT PACKAGE
The only thing out-of-the-ordinary that I did was to put a DATE and TIME at the end of the IPX FILE NAME.
3A)
I made your suggested change from
Optimizer Off
to
Optimizer On
and the PROJECT / APP loads and operates in PREMIER 2D 9.2 and PREMIER 3D 9.3 with no complaints. It still throws errors in 2D 9.1.4 but that is really not a problem
Thank you very much.
3A)
Regarding how OPTIMIZER got set to OFF, that is a mystery that I cannot explain.
In the SCREEN CAPTURE below, please see the IPP FILES for 3 PROJECTS (with APP and MOD) that were created with P 3D 93, P 2D 92, and P 2D 914. Please see that ON is the setting created by 3D93. 2D92 and 2D914 both created an IPP FILE with OFF as the setting.
4)
Thank you for the reminder. There are many FEATURES and FUNCTIONS that need to be added to this to make it complete.
**
Thanks again for your assistance with this and other challenges I have had with IPPLUS and IPREMIER. It has been very helpful.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Optimizer is a switch to use different macro engine. The new versions starting from 9.2 should use On (it is On by default starting from 9.3), it ensures code validation on compilation stage and has better .NET support. When it's Off, wrong types or undefined variables could be passed unnoticed, so it's not recommended (from 9.3.1 the Off flag will be detected and prompted to be set to On).
Yuri
Yuri --
Thank you for the additional information about OPTIMIZER and with the help provided debugging the issue I was experiencing related to it.
-- Matt