HTML5 canvas game performance vs. alternatives [closed] - performance

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am starting development on a HTML5 game using the canvas. Things are going alright so far, but I have some things I am a little puzzled on, mostly having to do with performance of such game. So instead of me running into a bunch of problem deep down the development process, I would be grateful to find out now.
I have before worked in languages such as OpenGL and learned how important it is to render things in an efficient order, this is something that can give a factor of hundreds better performance than just randomly drawing stuff to the screen switching back and forth between textures/shaders etc. Is this something I should keep in mind with a canvas game, or will things automatically be queued up and rendered in an efficient order?
It is going to be a 2D game, but with quite a few objects on the screen, and most of them dynamically desaturated and changed in brightness (filters). Is performance going to be a serious problem?
What are the alternatives, any javascript game-engine that can help performance? Am I going to get a performance boost by switching to WebGL even though standard canvas has hardware-acceleration?

Yes, you'll get a big performance boost with WebGL.
Consider using the excellent 2D rendering system called Pixi.
It renders sprites to WebGL with a fallback to Canvas.
Or, you can make your own low-level WebGL sprite rendering system using game-shell and gl-modules. gl-now is a good entry point into these modules. You can use them to build your own game engine.
Phaser, is an complete HTML5 game engine that currently has a lot of traction, and uses Pixi under the hood for rendering. A better place than Stackoverflow to look for help about all these issues is http://www.html5gamedevs.com.

Related

How to use Machine Learning/Vision functions to find frames in a scan of film strip? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have recently taken up film photography. Part of the workflow is to scan the images using a flatbed scanner. Unfortunately this process is very slow. Using some software (Silverfast) you make a prescan, zoom in make a more detailed pre scan, click ad drag around a rectangle which highlights the frame, do this for 12 frames, then set the software to do the full res scans.
I want to automate this process. Rather than layout where each frame is, I want to scan the whole film strip, and then use ML.Net to find each frame (X,Y coordinates of the top left corner) which I will then pass to ImageMagick to extract the actual image.
I want to use ML.Net because I am a .Net developer and may have the opportunity to use this experience later. So although example using OpenCV would be welcome, ML.Net would be preferable.
I am a bit of noob when it comes to ML stuff. My first thought is to try train a neural net, inputting the scan image and outputting the X and Y values. However that seems naive (as the image is 100s of MB in size). I imagine the there are better tool then just a raw neural net.
My searching on 'ML object recognition' didn't seem to help as the examples I found were about finding the Dog or Person in an image not a 'frame'; which could be a dog or a person.
Even a pointer in the right direction, of the correct name for this problem would be a great help.
So, what are the type of tool/functions I should I be using to try and solve this type of problem using ML.net?
This is not so much a machine learning problem as it is an image processing problem. I would think ML.Net is quite overkill.
What you probably want is an image processing library and utilize some form of edge detection or "region of interest" detection.
For example, look at this question:
Detect display corners with Emgu
Maybe I misunderstand what you want to do and you actually would benefit from machine learning; then you probably should pre process your images with an image processing library before feeding them to your model.
Hope it helps.

Software for creating simple animations in Unity [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm trying to add few animations to my game. I searched a bit for some animations software but everything I found was too complicated for me. Is there any simple animation software which I can use with Unity or should I just stick to default Unity animation tool?
If you want to roll it as you said, you can accomplish this in several ways without exiting Unity.
For instance, here are some :
Using an Animator component in the cube and applying a premade Animation (made within Unity via Animation window, just change transform rotation properties)
Using Physics to apply a constant rotation force (torque)
Using scripting to modify transform rotation properties on each frame update (c# or javascript)
Probably more exist but those are the simplest and easiest.
If I were to choose one, Animator + Animations would be my choice. Also have in mind that this component (Animator) is much better performance wise than any other solution when used on several instances in the scene (lots of cubes).

Phash vs. SIFT in identifying similar image [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have questions about both sift and phash
First of all, I'm using SIFT to identify similar image in real-time service.
Like pictures by phone-camera, small amount of rotation and blurred effect could be.
And I found Phash. So, I test phash on its demo page. But result made me to sigh.
This is result of above test:
In this test, two images are fixed on x-axis. So they don'
t have rotation. But right images' logo were removed and person was moved to left side. In my eye, This is 'Very Similar'. In addition, SIFT catch this completely.
Now, This is question.
pHash is faster than SIFT?
Is pHash's accuracy reliable?
SIFT's output was too big to use in real-time service. So I must use hash to make output smaller size like LSH(Locality-sensitive hashing). Any other way to I try?
Ok, I got it.
pHash can't recognize rotation and critical movement as same thing.
In case of data space, pHash was dramatically good for using. It is very small size: one image to one hash. SIFT, however, need 128 bytes to get feature point. And there are many feature points in one image.
Eventually, SIFT can identify similar image well than pHash. But more and more size was needed.
In speed bench, I can't test yet. But I think, pHash was faster than SIFT because SIFT have to operate for many features on one images.
If you have another answers for above question, tell me please.

2d data matrix(barcode) detection algorithm is not giving me results [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am working on detection of 2d data matrix but there is a problem in detection because barcode changes its design in each product so how to detect it? can anybody help me ?
The specification of datamatrix is designed to be identified. You need to look at the code the way it is intended to be looked at. Where I'd start is that the code has a quiet zone and an "L" pattern. That is what you are looking for.
How you go about doing this depends a lot on the general parameters of the image.
The first consideration is lighting and contrast. Can you depend on having a fixed midpoint, where everthing lighter is called white and everything darker black? Or will a simple histogram give a usable midpoint? Or do shadows and uneven lighting cause a value to be called black on the sunny side of the image and the same tone white on the shadow side of an image? On a flatbed scanner it is easy to depend on good contrast, but camera phone photos are more problematic.
The next consideration is size and resolution. For a camera phone application, it is expected that in a low resolution image, a high percentage of the image will contain the barcode, while a scanner may have a lot of image and a little amount of barcode data which needs to be searched for.
Finally comes presentation. Will the barcode appear in 360 degrees of rotation? Will it be flat and level or can it be be skewed, curled and angled? Is there any concern about lens distortion?
Once you can answer the considerations, it should point to what you need to do to identify the barcode. Datamatrix has clocking marks which enable distorted codes to be read, but it is a lot more work to define distortion, so if it is not needed, you wouldn't do it.

How to do 3d animation in iPhone using openGL ES? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new to OpenGL ES. I was doing iOS development. Now I actually want to animate a 3d character. Can anyone help me out how I can animate it? I have some idea that it needs frames to animate. Can someone give me some sort of demo so I can work it out?
This is a great tutorial for animating graphics & making games.
http://www.lynda.com/tutorials/Building-and-Monetizing-Game-Apps-for-iOS/82407-2.html
There are different techniques for character animations but the skeletal-animation technique should be the best for characters. Using this technique requires some work:
Load animation frames
Interpolate animations
Create animation matrices
This not gonna be easy, especially when you want to use facial animations you need techniques like morph-targets additional to the skeletal animation ( skeletal works here too, but it's hard to use ).
Side-note:
Animations are CPU expensive and should be used carefully when creating apps for iOS.

Resources