cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxWendorff Helper II
Helper II

Getting a Text Value from object detection

Hello, 

 

I have been working with the object detector. As a test model I used a calculator. Everything works fine however I am struggling with how to pull the result of the scan onto a label. I just want the object name that is scanned to be put in a label. Right now the labels code that I am trying to use is as follows:

 

 

ObjectDetector1.VisionObjects.displayName

 

Any help would be much appreciated!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps
Power Apps

Re: Getting a Text Value from object detection

The easiest way is to use a data table (Insert > Data table)

 

Then select your data table and in the formula bar type: 

ObjectDetector1.VisionObjects

 

Once that's done, you just need to select the fields you want to display. (Edit fields from the right panel and then select the fields you want to display like displayName and count). 

 

If you want more control over the visualization, you can use a productGallery instead of a data table. 

View solution in original post

7 REPLIES 7
Power Apps
Power Apps

Re: Getting a Text Value from object detection

Hi Max, would you be able to provide a visual example of what you are trying to achieve? Are you trying to detect an object and then extract text within the bounds of that object? Or are you just trying to extract text from an image?

MaxWendorff Helper II
Helper II

Re: Getting a Text Value from object detection

Yes! Below is the test app that I am running as you can see it registers the calculator. In the label below I am trying to have it say "calculator." or whatever the object is be it a stapler or glasses etc. Let me know if you need any more info!

 

Unknown.jpeg

Power Apps
Power Apps

Re: Getting a Text Value from object detection

Ah ok, that makes sense. I think what you're looking for is "First(ObjectDetector1.Results).tagName". Let me know if that works or if I misunderstood.

Community Support
Community Support

Re: Getting a Text Value from object detection

Hi  @antoinec 

It seems we are not able to exact Text from the ObjectDetector component since we cannot find any Results outcome.

Am I miss something?

Annotation 2020-02-27 143157.png

Sik

Power Apps
Power Apps

Re: Getting a Text Value from object detection

@MaxWendorff , 

 

If you only have one object, you can use this:

If(First(ObjectDetector1.VisionObjects).count > 0, First(ObjectDetector1.VisionObjects).displayName)

 

The If statement is here just to make sure there is at least one object in the picture. 

 

Thanks,

Nicolas

MaxWendorff Helper II
Helper II

Re: Getting a Text Value from object detection

That 100% works for 1 object!! However I have 3 different objects (Stapler,Calculator and Safety Glasses) would there be a way as of now to be able to get the result in text from the other two? Or does this method only work with a one object model? Let me know what you think and I appreciate the help!!

Power Apps
Power Apps

Re: Getting a Text Value from object detection

The easiest way is to use a data table (Insert > Data table)

 

Then select your data table and in the formula bar type: 

ObjectDetector1.VisionObjects

 

Once that's done, you just need to select the fields you want to display. (Edit fields from the right panel and then select the fields you want to display like displayName and count). 

 

If you want more control over the visualization, you can use a productGallery instead of a data table. 

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (2,481)