DETECTING A USER GENERATED LINE PROFILE IN AN IMAGE . . .
All --
I have a customer that has a large set of images. Some of the images (illustrated by AAA.TIF below) have ANNOTATION TEXT BOX, MEASUREMENT LINE OBJECTS, and SCALE BAR. Some of the images (illustrated by BBB.TIF below) have ANNOTATION TEXT BOX, USER GENERATED LINE PROFILE LINE, and SCALE BAR.
I am writing an APP to do some work on these images.
Can you provide guidance on what CODE can determine / indicate whether an image is TYPE AAA (No USER LINE PROFILE LINE) or TYPE BBB (Yes USER LINE PROFILE LINE).
I think this may be possible indirectly in this case by determining the number of MEASUREMENT LINE OBJECTS are in the IMAGE (>0 = TYPE AAA, 0 = TYPE BBB) but I would rather do it directly in case there is a unique image that has both.
If I activate the LINE PROFILE TOOL and a TYPE AAA IMAGE is being processed, IMAGE-PRO automatically places a LINE PROFILE LINE in the image and this causes issues.
Thank you in advance.
-- Matt
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
AAA.TIF and BBB.TIF with LINE PROFILE TOOL DEACTIVATED

AAA.TIF and BBB.TIF with LINE PROFILE TOOL ACTIVATED

0
Best Answer
-
Matt, you can disable adding default line profile in the options. The check for existing LP feature could be done wo LP panel and active tool:
Dim lpe As MediaCy.Commands.LineProfile.McLineProfileEngine lpe = MediaCy.Commands.LineProfile.AddIn.LineProfileEngine(ThisApplication.ActiveDocument, True) If lpe.LFeatures.Count > 0 Then 'check for any LP feature End If
Nikita.0
Answers
-
2020-09-07-194934All --An alternative would be if there is a MODE in IMAGE-PRO that will display the USER GENERATED LINE PROFILE LINE if it is stored with the image no LINE PROFILE if there is none stored with the image.Thanks.-- Matt
0 -
Hi Matt,
You can check profiles collection of LineProfileEngine (search forum for LineProfileEngine).
Thanks,
Nikita.0 -
2020-09-08-094743Nikita --Thank you for your suggestion.I did the search that you suggested and scanned through the results.It looks like all of these require the LINE PROFILE TOOL to be ACTIVE.I am hoping that there is CODE that will allow a routine to test an image to see if there is a USER GENERATED LINE PROFILE LINE embedded in the IMAGE via the TIF FILE.Can you direct me to one of the discussions that addresses this or perhaps post a routine that will determine that AAA.TIF (below) does not contain a USER GENERATED LINE PROFILE LINE and BBB.TIF (below) does contain a USER GENERATED LINE PROFILE LINE?Thanks again.-- Matt
0 -
2020-09-08-174654Nikita --I will check for the AUTO DEFAULT LINE OPTION. Turning that off might also smooth out some things.Thank you for the FEATURE COUNT CODE for LINE PROFILE.This looks like just the key to unlock the information I am looking for to make a branch in the CODE depending upon whether the image is similar to AAA.TIF or BBB.TIF.Thanks again.-- Matt
0 -
2020-09-08-192923Nikita --I wired the CODE that you provided into a routine namedtesterwhich is below.I ran that routine on the AAA.TIF and BBB.TIF images provided and got the following results.------------------------
C:\Users\Owner\Desktop\AAA.tif
USER LPE NOT FOUND
------------------------
C:\Users\Owner\Desktop\BBB.tif
USER LPE FOUNDThat is AFTER clearing a LINE PROFILE LINE out of AAA.TIF that snuck in there somehow.This gives me the CODE I need to detect and handle TYPE AAA IMAGES and TYPE BBB IMAGES.Thank you very much.-- Matt--------------------------------------------------------------------------Public Sub tester() Debug.Print "------------------------" Dim lpe As MediaCy.Commands.LineProfile.McLineProfileEngine lpe = MediaCy.Commands.LineProfile.AddIn.LineProfileEngine(ThisApplication.ActiveDocument, True) If lpe.LFeatures.Count > 0 Then Debug.Print ThisApplication.ActiveDocument.FileName Debug.Print "USER LPE FOUND" Else Debug.Print ThisApplication.ActiveDocument.FileName Debug.Print "USER LPE NOT FOUND" End If End Sub
0
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