Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Core Image Detection

All examples are included with download of MBS FileMaker Plugin.

Core Image Detection.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists1
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Core Image Detection
4 fields defined, 1 record
Core Image Detection

Fields

Table Name: Core Image Detection - 4 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
ImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      ResultNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          TypeNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          • Value list: Types
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              OutputNormal, BinaryAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1

                  Layout Objects: Core Image Detection

                  Regular Fields

                  Field Name: Core Image Detection::Image
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 64 pt
                  • Left: 76 pt
                  • Bottom: 189 pt
                  • Right: 329 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  No

                  Field Name: Core Image Detection::Result
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 198 pt
                  • Left: 76 pt
                  • Bottom: 524 pt
                  • Right: 652 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  Yes

                  Field Name: Core Image Detection::Type
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 65 pt
                  • Left: 399 pt
                  • Bottom: 86 pt
                  • Right: 652 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Pop-up Menu
                  • Display values from: Types
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  Yes

                  Field Name: Core Image Detection::Output
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 65 pt
                  • Left: 663 pt
                  • Bottom: 524 pt
                  • Right: 1374 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  No

                  Buttons

                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Detect Features
                  • Top: 92 pt
                  • Left: 516 pt
                  • Bottom: 126 pt
                  • Right: 652 pt
                  • Anchoring: Left, Top
                  Perform Script [ “Detect” ]

                  Scripts:


                  Value Lists

                  Value List NameSourceValuesOn Layouts
                  TypesCustom
                  • Face, Rectangle, QRCode, Text

                  Script Hierarchy

                  Detect

                  Script NameDetect
                  Run script with full access privilegesOff
                  Include In MenuYes
                  Layouts that use this script
                  Scripts that use this script
                    Script Definition
                    Script Steps
                    • Set Field [ Core Image Detection::Result; MBS( "CoreImage.Detect"; Core Image Detection::Image; Core Image Detection::Type; "Smile¶EyeBlink" ) ]
                    • #Show areas
                    • If [ MBS("IsError") = 0 ]
                    • Set Variable [ $json; Value:MBS( "JSON.Parse"; Core Image Detection::Result ) ]
                    • Set Variable [ $count; Value:MBS( "JSON.GetArraySize"; $json ) ]
                    • Set Variable [ $image; Value:MBS( "GMImage.NewFromContainer"; Core Image Detection::Image ) ]
                    • Set Variable [ $imageHeight; Value:MBS( "GMImage.GetHeight"; $image) ]
                    • If [ $count > 0 ]
                    • #for loop
                    • Set Variable [ $index; Value:0 ]
                    • Loop
                    • Set Variable [ $item; Value:MBS( "JSON.GetArrayItem"; $json; $index) ]
                    • #draw area
                    • Set Variable [ $x; Value:MBS( "JSON.GetPathItem"; $item; "x" ; 1 ) ]
                    • Set Variable [ $y; Value:MBS( "JSON.GetPathItem"; $item; "y" ; 1 ) ]
                    • Set Variable [ $w; Value:MBS( "JSON.GetPathItem"; $item; "width" ; 1 ) ]
                    • Set Variable [ $h; Value:MBS( "JSON.GetPathItem"; $item; "height" ; 1 ) ]
                    • Set Variable [ $y; Value:$ImageHeight - $y -$h /* coordinates from CoreImage are swapped vertically */ ]
                    • Set Variable [ $r; Value:MBS( "GMImage.SetFillColor"; $image; "#FFFF00" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.DrawRectangle"; $image; $x; $y; $x+$w; $y+$h ) ]
                    • #left eye
                    • Set Variable [ $hasLeftEyePosition; Value:MBS( "JSON.GetPathItem"; $item; "hasLeftEyePosition" ; 1 ) ]
                    • If [ $hasLeftEyePosition = 1 ]
                    • Set Variable [ $x; Value:MBS( "JSON.GetPathItem"; $item; "leftEyePositionX" ; 1 ) ]
                    • Set Variable [ $y; Value:MBS( "JSON.GetPathItem"; $item; "leftEyePositionY" ; 1 ) ]
                    • Set Variable [ $y; Value:$ImageHeight - $y /* coordinates from CoreImage are swapped vertically */ ]
                    • Set Variable [ $r; Value:MBS( "GMImage.SetFillColor"; $image; "blue" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.DrawRectangle"; $image; $x-20; $y-20; $x+20; $y+20 ) ]
                    • End If
                    • #right eye
                    • Set Variable [ $hasRightEyePosition; Value:MBS( "JSON.GetPathItem"; $item; "hasRightEyePosition" ; 1 ) ]
                    • If [ $hasRightEyePosition = 1 ]
                    • Set Variable [ $x; Value:MBS( "JSON.GetPathItem"; $item; "rightEyePositionX" ; 1 ) ]
                    • Set Variable [ $y; Value:MBS( "JSON.GetPathItem"; $item; "rightEyePositionY" ; 1 ) ]
                    • Set Variable [ $y; Value:$ImageHeight - $y /* coordinates from CoreImage are swapped vertically */ ]
                    • Set Variable [ $r; Value:MBS( "GMImage.SetFillColor"; $image; "blue" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.DrawRectangle"; $image; $x-20; $y-20; $x+20; $y+20 ) ]
                    • End If
                    • #mouth position
                    • Set Variable [ $hasMouthPosition; Value:MBS( "JSON.GetPathItem"; $item; "hasMouthPosition" ; 1 ) ]
                    • If [ $hasMouthPosition = 1 ]
                    • Set Variable [ $x; Value:MBS( "JSON.GetPathItem"; $item; "mouthPositionX" ; 1 ) ]
                    • Set Variable [ $y; Value:MBS( "JSON.GetPathItem"; $item; "mouthPositionY" ; 1 ) ]
                    • Set Variable [ $y; Value:$ImageHeight - $y /* coordinates from CoreImage are swapped vertically */ ]
                    • Set Variable [ $r; Value:MBS( "GMImage.SetFillColor"; $image; "red" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.DrawRectangle"; $image; $x-50; $y-20; $x+50; $y+20 ) ]
                    • End If
                    • #next
                    • Set Variable [ $index; Value:$index + 1 ]
                    • Exit Loop If [ $index >= $count ]
                    • End Loop
                    • End If
                    • Set Variable [ $r; Value:MBS( "JSON.Release"; $json ) ]
                    • Set Field [ Core Image Detection::Output; MBS( "GMImage.WriteToPNGContainer"; $image; "test.png" ) ]
                    • End If
                    Fields used in this script
                    Scripts used in this script
                      Layouts used in this script
                        Tables used in this script
                        Table occurrences used by this script
                        Custom Functions used by this script
                          Custom menu set used by this script

                            Download example: Core Image Detection

                            Used functions: