How to use 'OpenCV' in ActionScript3? - actionscript-3

I would like to use OpenCV in my actionScript 3 code.
Is there a way to do so ?
I have a list of coordinates to draw a polygon on a mask,
and I need a way to grow the polygon and shrink it and also to add feather to it,
using OpenCV functions (I do not want to use AS3's 'scale').
Can this be done ?

you can not use OpenCV in actionscript-3, because actionscript-3 is a advanced language, but openCV is made by C-language, it's a base language

Related

Create Diagonal image from bitmap image in windows phone

I want to make a diagonal/ triangle shape image from bitmap source without using any polygon control, how to do this in windows phone.
Hm what do you mean without using any polygon controls?
You can create a WriteableBitmap, and draw on it with any tools you prefer. If you want to avoid all additional tools you can call set/get pixel methods and for loops.
When you are happy with your WriteableBitmap you can create a BitmapImageSource and then call .AsBitmap() on your WriteableBitmap. With that complete you can then use the whole imaging SDK chain.
Edit: You can find the .AsBitmap method in Nokia.InteropServices.WindowsRuntime namespace.

How to draw different shapes using pencil on group container and resize and rotate it in flex4?

All operations like moving,rotating,resizing drawn shape can be performed.I'm using as3 and flex4.6.
It seems like you have to use object handles library for moving,rotating, re sizing shapes ..
you can download this library from the below links.
https://github.com/marc-hughes/ObjectHandles
http://www.objecthandles.com/

How to extract the shape of MovieClip?

We have a flash application that we are planning on converting to javascript. It's a pretty simple map application with an image as the background and a bunch of simple polygon movie clips that represent destinations on the map.
I would like to iterate through each movie clip and extract the shape into an array of x,y points to redraw the polygon using an external javascript function.
Is this possible with actionscript?
If you want to export the shape coordinates at author time, you can do try the JSFL script recommented by #strille or this one or export transparent images (if that's not too limiting for your application).
If you need to export the shapes at runtime, you can use the awesome as3swf library to decompile the swf and export the shapes. Have a look at the ShapeExport wiki as there are couple of handy exporters for js like JSCanvasShapeExporter and the more generic JSONShapeExporter
There are ways you can read the coordinates from an SWF. For instance, I've written a parser in PHP (link). Getting the data doesn't help though, as it turns out. The Flash painting model is different enough from the HTML5 one enough to make transfer exceeding difficult. The main obstacle I discovered is that in Flash, a path can be filled with two fill styles: one for area enclosed by the path, the other for enclosed area considered to be "outside" by the even-odd rule (e.g. the pentagon in the middle of a star). Since the HTML5 canvas let you specify only one fill style, you can't redraw shapes from Flash accurately. I was trying to create a tool that extract shapes as SVG and was getting a lot of gap and holes in the result.
Flash Player 11.6 introduced readGraphicsData() which does exactly what you ask for.
If you need to target an earlier version, then there's no simple way to read shape coordinates from a display object with ActionScript at runtime unfortunately.
If you just want to extract the shape coordinates once someone has written a jsfl script for Flash CS3 which looks like it might be able to help you out.

actionscript library for interactive path drawing (or any other library for the equations

I am making a flash app where I want to have a user defined viewport like the stage in the flash IDE which the user can use to define objects that have a starting postition somerwhere off or on the stage and an ending position either or on or off the stage with the object then tweening between the two points.
My question is this: I want the user to be able to define a curved path for the object to tween along. Is there a library of code that I can use to define curved paths for the app?
Ideally I would like something similar to the functionality available in Flash, so a bezier curve sort of path that is subdivided into handles that can be dragged to define the path of the tween.
If there isn't an existing library, then do you know of the functions that I would need to define (mathematical equations related to drawing curves etc)?
Many thanks
You could use TweenMax with the BezierPlugin
Or define the path elsewhere and use LinePath2D

ActionScript / Flash - Programatically Bitmap-Fill IDE Drawn Vectors?

my current situation maybe akin to me painting myself into a corner.
i have many vector shapes drawn with the Flash Professional CS5 IDE, which have been converted into sprite objects and exported to actionscript. for example, here are 3 shapes:
i want to programatically fill each shape with a bitmap from my library. i realize i can fill these shapes with library bitmaps in the IDE, but i need to scale the bitmaps at runtime as well as swap them out for others.
how is it possible to programatically bitmap-fill shapes drawn within the IDE at runtime without having to also programatically redraw them?
what about using your shapes as masks rather than going through a painful on the fly drawing process ?
it would go like :
bitmap.mask = shape;
as long as shape is a DisplayObject, it should work.
otherwise you can still use a JSFL to export your shapes, store them as arrays of points and draw them at runtime.
here's a basic JSFL export tool
http://ericlin2.tripod.com/bugwire/bugwiret.html
here's an advanced JSFL tool:
http://www.lidev.com.ar/?p=192
here's a ( shamelessly self-promoting :) ) example of an application:
http://en.nicoptere.net/?p=1331
[EDIT]
NB when compiled, your vector shapes are turned into opcode, a set of instructions that you can't read easily.
it remains possible though: http://wahlers.com.br/claus/blog/hacking-swf-1-shapes-in-flash/ but still it's a bit complex if the same result can be achieived with masks :)