How to draw a polygon shaped data annotation shape for image detection? - artificial-intelligence

I am training some images using imageAI object detection. What i want to do is draw a polygon shaped data annotation around the objects in an image. Not a square box. Even though I ca draw the shape, the imageAI class doesn't consider polygon shapes. If some one can help me to find if is there is some model where polygon shapes are allowed in image training, that would be great.

ImageAI only supports PascalVOC image annotation format, which is upright rectangular bounding boxes. You would need to change frameworks for this to work. For a workaround, consider using an image editing tool to get rid of the background and then provide a square bounding box.

Related

Mapbox Get Point Raster Layer Color

I want to display a legend slider besides the map to show the color of the custom raster layer, of the hovered territory. Therefore, I need to get the layer pixel color where the cursor is.
I have found a solution to get the color of a pixel on the map How to get the color of pixels on mapbox, however, if we hover roads or names, another color gets read.
Is there a way to read the layer color on a specific map point?
Are the roads and place labels baked into the raster, or overlaid as vector data sourced layers?
I'm not sure of another method besides querying the canvas, in which case one option would be to hide the vector layers, query, then reshow. But that may not result in the interaction you want?

How to map CALayer texture to cube so text in layer show up correctly?

I am adding a CALayer to a SCNBox geometry contents... It works and I see this:
I want to be able to see the text on the box correctly. I understand that the texture is now applied to the geometry etc...
How can make it so the text I write in the CALayer shows up horizontally around the box...?
the default UVs (or texture coordinates) of an SCNBox are such that the same content is displayed on each side. You will have to rebuild a geometry with new texture coordinates so that the pattern does not repeat. You can start from scratch, or build an SCNBox and retrieve its geometrySources.

Drawing shapes, text and images with moving and scaling in WPF

I'm trying to draw simple map in WPF. I need to draw shapes, text and images. It also should be possible to use mouse to move around and zoom in and out.
Right now, I have combination of Canvas + Geometry + Transforms to draw shapes, but I don't know how to add text and images.
I already tried various combination of Canvas/Grid and Layout/Render transform. Biggest problem is adding text and images, because transformations are in geometries.
If i understand you right, you're currently putting Path objects (with transformed Geometries) into a Canvas. For adding text and images you could easily add TextBlock and Image objects to the same Canvas and apply your transformations to their RenderTransform property.
A completely different approach would be to use WPF low-level rendering, provided by the DrawingVisual class. You may start at WPF Graphics Rendering Overview.

How to render a VisualElement to a Vector Based Image?

I am working on a Chart Control,
I need to implement the Chart Snapshot feature for capturing a vector based image in high quality of Curves and Texts, in any requested size.
Can anyone suggest me any solution or a pointer to resolve this problem.
Any kind of help in deeply appreciated.
If you have to save your image in a vector format you can using tracing. Potrace is an open source bitmap-to-vector tracer library (but considers that bitmap tracing is imperfect). Also considers that wpf is linked closely with XAML, a vector graphics markup languages, so you may want convert raster graphics to XAML (though Charles Petzold you can't embed a bitmap in a XAML file)
If you need to draw a vector image you can use the Shape element that provides a base class for shape elements, such as Ellipse, Polygon, and Rectangle; and add the shape as Panel child. If you are dealing with thousands of shape I suggest to use the DrawingVisual class, a visual object that can be used to render vector graphics on the screen, and its RenderOpen method.
To zoom you have to work with transformations, in particular ScaleTrasnform and apply the transformation to your panel or to your shapes.
Hope this help.
You can take a look at XamlToy but I have not already try it.
http://xamltoys.codeplex.com/

What is the best way in Silerlight to make areas of a large graphic clickable?

In a Silverlight application I have large images which have flow charts on them.
I need to handle the clicks on specific hotspots of the image where the flow chart boxes are.
Since the flow charts will always be different, the information of where the hotspots has to be dynamic, e.g. in a list of coordinates.
I've found article like this one but don't need the detail of e.g. the outline of countries but just simple rectangle and circle areas.
I've also found articles where they talk about overlaying an HTML image map over the silverlight application, but it has to be easier than this.
What is the best way to handle clicks on specific areas of an image in silverlight?
Place the Image and a Canvas in a Grid so that the Canvas overlays the Image.
Add shapes of appropriate sizes and placed as needed to the canvas. All shapes will a transparent fill and no border, hence the user only sees the Image. On the Canvas MouseDown (or Up events) use OriginalSource to determine which shape generated the click. Use the Tag property of each shape to associate it with some object that represents the flowchart element being mapped.
I found an easy way to do this without a canvas:
How to get the coordinates of an image mouse click in the event handler?

Resources