cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MaxWendorff
Level: Powered On

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 Staff npouhaer
Power Apps Staff

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 Staff antoinec
Power Apps Staff

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
Level: Powered On

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 Staff antoinec
Power Apps Staff

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.

Microsoft v-siky-msft
Microsoft

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 Staff npouhaer
Power Apps Staff

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
Level: Powered On

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 Staff npouhaer
Power Apps Staff

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Kudoed Authors
Users online (10,628)