Can I get the Fourier Descriptor coefficients for an object outline without using macro code?
I want to study the outlines of objects using Fourier descriptors. I see that their is a macro that uses the maximum of the Fourier descriptor coefficients to rename obects. Can I get the coefficients withour writing macro code? In particular, I would like to get output to Excel for the first 20 coefficients for all the objects in an image.
Thanks
0
Answers
-
Mark, You can see all Fourier descriptor coefficients in the Object window. It shows data for the selected object. Yuri0
-
Hello
I'm using also the Fourier descriptors but i would like to have 128 instead of the 32 that are by default. How can I change it.
Thanks0 -
You can set the number of elements after executing the Count operation running the following macro:
Public Sub SetNumberOfElements Dim md As MediaCy.Addins.Measurements.McMMData=ThisApplication.ActiveImage.MeasurementsData If md.Rows>0 Then Dim rgn As MediaCy.IQL.Features.McRegions=md.Item(0).MainSubFeature.GetFeatures() rgn.maRgnFourierDescriptor.NumElements=128 End If End Sub Yuri
0 -
Hello again
It's my first time using this program and I don't know very well how to run macros. I tried to do it using your instructions but when I try to run it a error occurs in this "If md.Rows>0 Then"0 -
The error is Unexpected text
Module 'Project6.ipp', line 16, character 00 -
You must have an active image with some counted objects to make it work, so execute Count first and then run the macro.0
-
I did that but still same error just shows up0
-
You may not have proper references. Please use my project (load it to Premier by double clicking on it and then run SetNumberOfElements macro).0
-
Ok I did that and now it shows up that the number set was 128, but still when I go to the active image only 32 shows up0
-
Sorry it took some time but it change now. Thank you so much for your help Yuri.0
-
I have added a function to print out all Fourier Descriptor coefficients for every feature to Output window, from which you can send data to Excel.
Public Sub SetNumberOfElements If ThisApplication.ActiveImage Is Nothing Then MsgBox "No active image" Exit Sub End If Dim md As MediaCy.Addins.Measurements.McMMData=ThisApplication.ActiveImage.MeasurementsData If md.Rows>0 Then With ThisApplication Dim rgn As MediaCy.IQL.Features.McRegions=md.Item(0).MainSubFeature.GetFeatures() rgn.maRgnFourierDescriptor.NumElements=128 'MsgBox "Number of elements for Fourier Descriptor is set to 128" .Output.Show .Output.Clear Dim fd As New MeasEntry(eMeasures.aRgnFourierDescriptor,mcmmStatField.Values) For Each sf As McMMSubFeature In md.SubFeatures .Output.PrintMessage(sf.Name & vbTab & .McObjects.GlobalTools.McToText(sf.Value(fd),New Object() {"%f3", "",vbTab}).Value) Next End With Else MsgBox "No measurement objects" Exit Sub End If End Sub
The project attached.
Yuri0 -
Once again thank you very much. Best regards0
-
Do I copy that to the project that you sent me?0
-
Sorry once again, the attached project wasn't showing up. No help needed.
Thanks0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions