PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV and WEBDEV 27 feature!
  • Properties specific to the description of aiImageResult variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
aiImageResult (Type of variable)
In french: iaRésultatImage
AjaxNot available
The aiImageResult type is used to retrieve the result of AIDetect.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
arrElement is array of 1 int
arrElement[1] = aidMotorbike
 
arrAIImageResult is array of aiImageResult
 
arrAIImageResult = AIDetect(IMG_NoName1, arrElement)
 
IF arrAIImageResult.Count = 0 THEN RETURN
 
iImage is Image = IMG_NoName1
dStartDrawing(iImage, dNoErase + dWithOpacity)
 
InitRandom(1) //Fixed value to always have the same rectangle colors
 
nMargin is int = CoordinateEditorToScreen(5)
cColor is Color
nIndex is int
iElement is aiImageResult
FOR EACH ÉLÉMENT iElement OF arrAIImageResult
nIndex ++
cColor.Red = Random(0,170)
cColor.Green = Random(0,170)
cColor.Blue = Random(0,170)
dBackground(iImage, White, 0, 0, 0)
dPen(iImage, cColor, 0, CoordinateEditorToScreen(5), 128)
dPolygon(iImage,iElement.Polygon)
nXCenter is int
nYCenter is int
IF iElement.Polygon.Point[1].X < iElement.Polygon.Point[2].X THEN
nXCenter = (iElement.Polygon.Point[1].X + iElement.Polygon.Point[2].X)/2
nYCenter = (iElement.Polygon.Point[1].Y + iElement.Polygon.Point[3].Y)/2
ELSE
nXCenter = (iElement.Polygon.Point[1].X + iElement.Polygon.Point[4].X)/2
nYCenter = (iElement.Polygon.Point[1].Y + iElement.Polygon.Point[2].Y)/2
END
 
dPen(iImage, cColor, 0, 2, 200)
dBackground(iImage, White, 0, 0, 200)
dRectangle(iImage, nXCenter - nMargin, nYCenter - nMargin, nXCenter + nMargin, nYCenter + nMargin)
dPen(iImage, cColor, 0, 1, 255)
END
 
IMG_NoName1 = iImage
Remarks

Properties specific to the description of aiImageResult variables

The following properties can be used to handle the result of object detection in an image:
Property nameType usedEffect
aidElementTypeInteger constantConstant corresponding to the detected object:
  • aidAirplane: Plane in the image.
  • aidSportsBall: Sports ball in the image.
  • aidBanana: Banana in the image.
  • aidBench: Bench in the image.
  • aidBoat: Boat in the image.
  • aidBaseballBat: Baseball bat in the image.
  • aidBowl: Bowl in the image.
  • aidFireHydrant: Fire hydrant in the image.
  • aidBottle: Bottle in the image.
  • aidBroccoli: Broccoli in the image.
  • aidToothbrush: Toothbrush in the image.
  • aidBus: Bus in the image.
  • aidTruck: Truck in the image.
  • aidSofa: Sofa in the image.
  • aidCarrot: Carrot in the image.
  • aidKite: Kite in the image.
  • aidChair: Chair in the image.
  • aidCat: Cat in the image.
  • aidHorse: Horse in the image.
  • aidDog: Dog in the image.
  • aidScissors: Scissors in the image.
  • aidKeyboard: Keyboard in the image.
  • aidKnife: Knife in the image.
  • aidTie: Tie in the image.
  • aidSpoon: Spoon in the image.
  • aidDonut: Donut in the image.
  • aidTv: TV screen in the image.
  • aidElephant: Elephant in the image.
  • aidSink: Sink in the image.
  • aidTrafficLight: Traffic light in the image.
  • aidOven: Oven in the image.
  • aidFork: Fork in the image.
  • aidFrisbee: Frisbee in the image.
  • aidBaseballGlove: Baseball glove in the image.
  • aidCake: Cake in the image.
  • aidGiraffe: Giraffe in the image.
  • aidToaster: Toaster in the image.
  • aidClock: Clock in the image.
  • aidHotdog: Hot dog in the image.
  • aidBed: Bed in the image.
  • aidBook: Book in the image.
  • aidMicrowave: Microwave oven in the image.
  • aidMotorbike: Motorbike in the image.
  • aidSheep: Sheep in the image.
  • aidBird: Bird in the image.
  • aidOrange: Orange in the image.
  • aidLaptop: Laptop in the image.
  • aidBear: Bear in the image.
  • aidTeddyBear: Teddy bear in the image.
  • aidStopSign: Stop sign in the image.
  • aidUmbrella: Umbrella in the image.
  • aidParkingMeter: Parking meter in the image.
  • aidPerson: Person in the image.
  • aidPizza: Pizza in the image.
  • aidSurfboard: Surfboard in the image.
  • aidPottedPlant: Potted plant in the image.
  • aidLicensePlate: Plaque
  • aidApple: Apple in the image.
  • aidTennisRacket: Tennis racket in the image.
  • aidRefrigerator: Refrigerator in the image.
  • aidBackpack: Backpack in the image.
  • aidHandbag: Handbag in the image.
  • aidSandwich: Sandwich in the image.
  • aidHairDryer: Hair dryer in the image.
  • aidSkateboard: Skateboard in the image.
  • aidSki: Skis in the image.
  • aidSnowboard: Snowboard in the image.
  • aidMouse: Mouse in the image.
  • aidDiningTable: Dining table in the image.
  • aidCup: Cup in the image.
  • aidRemote: Remote control in the image.
  • aidCellphone: Cellphone in the image.
  • aidToilet: Toilet in the image.
  • aidTrain: Train in the image.
  • aidCow: Cow in the image.
  • aidSuitcase: Suitcase in the image.
  • aidVase: Vase in the image.
  • aidBicycle: Bicycle in the image.
  • aidWineGlass: Wine glass in the image.
  • aidFace: Face in the image.
  • aidCar: Car in the image.
  • aidZebra: Zebra in the image.
ConfidenceLevelIntegerObject detection confidence score, from 0 to 100.
PolygonPolygon variablePolygon that corresponds to the points surrounding the detected element.
Related Examples:
WD Object Detection Training (WINDEV): WD Object Detection
[ + ] This example shows how to use AIDetect.
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment