How does the browser api BarcodeDetector detect barcodes and bounding boxes? - algorithm

Context
Been curious about how will the Barcode Detection Browser API detects a barcode (1 or 2 dimensional) and draws a bounding box to it.
The MDN only really tells how to use it
And the WICC specification only links you to Google's Play Services which is outdated apparently
And it was superseeded by the ML Kit
Question
What is the main strategy that browsers will use to detect, decode and draw bounding box to barcodes?

Related

Javascript library to visualize network graph with custom image background

Is there any javascript library for graph (network topology) visualization with support custom image as background with zoom support? Idea is to use floor plan (jpg/png) and change positions of nodes according their real position. I can't find any example with background image. Thank you!
example screenshot
I think this meets your requirement in having a background image to the whole diagram:
https://gojs.net/latest/samples/kittenMonitor.html
Control-mouse-wheel or pinch-zoom to change the scale interactively.
This sample does not happen to show any links connecting the nodes, and those nodes happen to be moving slowly, but those features are not necessary for showing any background image. FYI, I am a developer of GoJS.

Suggests or methods of tv logo auto finding/locating/detection

Usually the logo detection means find the logo and recognize the logo. Some common works do the two steps together using SIFT/SURF matching method, detailed in
(1) Logo recognition in images
(2) Logo detection using OpenCV
But, if the logo is tiny and blur, the result is poor, and kind of time consuming; I want to split the two steps, firstly finding where the logo is in video; then recognize the logo using template matching or other method, like:
(3) Logo recognition - how to improve performance
(4) OpenCV logo recognition
My problem is mainly focused on finding the logo automatically in video. I tried two methods:
Brightness method. The logo on tv screen usually always there when the show goes on, I select a list of frames randomly and do difference between frames, the logo area tend to be 0; I do some statistics of 0 brightness with threshold to determine whether the pix is logo or not. This method usually do well but failed while the show has static background.
Edge method. Likely, if the logo is there, the border tends to be obvious. I do the statistic work like Brightness method, but edge sometimes unstable,such as very bright background.
Are there any suggestions or state of art methods to auto finding logo areas and any other logo recognition method except sift or template matching ?
Let's assume your list of logos known before hand and you have access to examples (video streams/frames) of all logos.
The 2017 answer to your question is to train a logo classifier, and most likely a deep neural network.
With sufficient training data, if it is identifiable to the TV viewers it will be able to detect it. It will be able to handle local blurring and intensity changes (which may thwart "classic" image processing methods of brightness and edges).
OpenCV can load and run network models from multiple frameworks like Caffe, Torch and TensorFlow, so you can use one of their pre-trainined models or train one yourself.
You could also try the Tensorflow's object detection API here: https://github.com/tensorflow/models/tree/master/research/object_detection
The good thing about this API is that it contains State-of-the-art models in Object Detection & Classification. These models that tensorflow provide are free to train and some of them promise quite astonishing results. I have already trained a model for the company I am working on, that does quite amazing job in LOGO detection from Images & Video Streams. You can check more about my work here: https://github.com/kochlisGit/LogoLens
The problem with the TV is that the LOGOs will probably be not-static and move along the frames. This will result in a motion blur effect, which will probably make your classifier to get confused or not see the LOGOs. However, once you find a logo You can use an object tracking algorithm to keep track of the logo (e.g. deepsort)

Huge image resample on the fly

I have a huge image (234 megapixels) I want to plot in a way that it is dynamically resampled depending on the size of the area the user wishes to see. Is there any tool that supports doing this, or will I need to do this myself?
Typically the techniques to do this are referred to as (Image) Tile Rendering. Basically this is how applications such as Google Maps work.
A quick search on google turned up an OpenGL library for doing this for you (http://www.mesa3d.org/brianp/TR.html). I'm sure there are others that you should be able to discover if this library doesn't fit your technology needs.

How to color fill a country on a map outline

Is it possible in Bing or Nokia maps to display a blank map of the world where each country is only outlined by its border, and then fill some countries with a solid color? Thanks!
A recent blog post on developer.here.com announced that:
The Geocoder API now supports the retrieval of admin boundary shapes
(multi-polygon coordinates) with geocoding results. This feature is
available for all countries & territories - in line with the country's
depth of coverage.
The HERE Community Examples on GitHub offers a web-based example showing this. It is written in JavaScript but should give you the idea.
Make http request to the REST Geocoder service using the additionaldata=IncludeShapeLevel,[level], parameter
Parse Well-known-Text format (WKT) using a regular expression.
Take the coordinates and convert to Polygon
Now depending on your situation, on a phone you may prefer to offer offline only support - because you know the maps are available directly from the device, so if you know for sure which regions you require it would make sense to pre-load the shapes based on a KML or GeoJSON file. If you don't know beforehand, your app relies on http anyway (or the potential set of locations is arbitrarily large) you may as well just http use REST geocoding for the regions you need.
By the way, one advantage of the online solution - because the Bing and Nokia Maps both use the same dataset as HERE, you can be certain that any shapes you download will match exactly.
You can render arbitrary polygons on top of Bing maps, but there's no built in functionality to render regions like provinces, states, counties, etc. In order to highlight a region you would need to provide all the points of a polygon and overlay it over a region on the map. Here's a great article that discusses drawing "advanced" polygon shapes with version 7 of the Bing Maps AJAX control.
“Advanced Shapes” (i.e. Donut Polygons) on Bing Maps
A possible duplicate question in regards to Bing maps API
Bing map - highlight country with a polygon on hover

How do you make and recognize gestures?

I am using a web cam to get video feed and then performing motion tracking on this video feed. The motion tracker returns (x,y) co-ordinates continuously.
I want to use these (x,y) to recognize gestures such as "swipe left", "swipe right", "swipe up" or "swipe down".
How do i make and store templates of these gestures and how do i figure out/recognize if one
of the gestures has happened ?
Thank you in advance :)
PS: I am using Flex 4 and ActionScript 3.0. If someone could help me out with the logic, i can write it in ActionScript.
An approach I could think of working would be to have a series of (X,Y) coordinates representing points along the gesture. On a small scale if a gesture that passed through your screen was graphed as such:
|1|1|1|
|1|0|0|
|1|0|0|
and represented (from the upper left corner representing 0,0):
(0,2)(0,1)(0,0)(0,1)(0,2)
Break the x,y coordinates up into individual 2d arrays with total distance traveled between the current coordinate and the first point (in all cases in this example it would increment by 1) so you would have two arrays:
X:(0,0)(1,1)(2,2)
Y:(0,1)(1,1)(2,2)
Now do a least square fit on each array to find the closest representation of the change in x and change in y as quadratic functions. Do the same to your per-deteremined gestures and then plug in the x,y coordinates of your per-determined gestures into to the user's gesture's quadratic function and the per-determined gestures you designed and see which one it matches the closest. This is your gesture.
(I've never tried processing gestures, but I don't see why this wouldn't work)
You should divide your task into smaller subtasks. In computer vision there is no thing like a generic gesture detection that works out of the box in all environments.
First of all, you need to be able to detect motion at all. There are several ways to do this, e.g. background subtraction or blob tracking.
Then you need to extract certain features from your image, e.g. a hand. Again, there is more than one way to do this. Starting from skin color approximation/evaluation, which is very error prone to different lighting conditions, to more advanced techniques which really try to "analyze" the shape of an object. Those algorithms "learn" over time how a hand should look like.
I can only recommend to buy a decent book about computer vision and to research the web for articles etc. There are also libraries like OpenCV you can use for learning more about the implementation side. There should be several ports of OpenCV to ActionScript 3. I also can recommend the articles and tools from Eugene Zatepyakin (http://blog.inspirit.ru). He's doing great CV stuff with ActionScript 3.
Long story short, you should research motion tracking and feature extraction.
The best place to start is to read about how sign language recognition or trackpad input works, such as creating reference images and comparing them to user input. Specific to Adobe, there's the FLARToolKit, which is detailed in an augmented reality article on their website.
References:
Trackpad Science
Hand Gesture Recognition
Sign Language Recognition Research - PDF
Gesture Recognition Walkthrough - Video

Resources