Detection of left or right turn of car using sensors(accelerometer or others) - accelerometer

Want to detect Is car take left turn or right turn on basis of azimuth,pitch and roll values calculated using sensors
Will i able to calculate using these values or need other parameters too?
Any Help will be appreciated :)

Related

Can you do pathfinding based on the pixelgrid of a .png file in Unity?

TL;DR: Can someone please help with pathfinding with no obstacles, fixed and known starting points, and edges based on transparency of the pixel grid of a .png file.
I'm trying to make a simple app for my students to teach them the correct stroke order and direction of the Chinese strokes.
So far I have achieved this by layering "start" and "end" game objects with CircleCollider2D components on top of the PolygonCollider2D generated by the sprite to check if they started the stroke, stayed within the stroke, and exited it correctly.
It does the job, yes, but it doesn't animate the fill in process like you'd expect from such an app, not to mention that I need to manually add "start" and "end" points myself.
Ideally I could just provide the stroke sprite, tell it which way I want the stroke to go (left to right, right to left etc.) and let the program create the ends based on the first/last 10% of the pixels, and of course animate it to fill in once completed correctly.
But baby steps!
First, I'd be grateful if someone could please tell me how to even get the pixel grid to begin with so I can perhaps attempt an A* approach.
Thank you!
This is the same case for validating AI racers if they are in racing in the correct way. You will have to indicate some sort of waypoint system that has is ordered by the way of strokes you want.
Imagine you're teaching them to write the number 2. You will have to create an array of nodes starting from the upper left most of the number until you get to the other end. You can validate the strokes if their fingers pass through the correct order or not.
No need for a complicated A* algorithm.
However, this won't do if you want to automate everything. This will require you to do some sort of image processing, editor tool, and loads of validations. I wouldn't suggest the automated one though.

Matlab - Flag points using nearest neighbour search

I have the following problem and I am a bit clueless how to tackle it as my programming skills are very elementary ( I am an engineer, so please dont bite my head off).
Problem
I have a point cloud, the picture above displaying one level off it. Every point is a centroid off a block (x =5, y=1, z=5) and is specefied by carteisian coordinates.
The centroids further have two values: one called "access" and one "product". If the product value is positive and pays for the access to the point I want to include it in my outcome. The red marker in the picture represents a possible starting point.
Starting Idea
As a start I am trying to set up an algorithm, that starts at the red marker, runs through the blocks left and right (along the x-axis), checks until where it would be feasible to access (so sum "product" > sum "access") and then goes to the next point (in y direction from marker) and does the same until the end of the level.
Final Goal
My final goal is that I can Flag points as accessed and the algorithm connects profitable "products" (so products that would pay for their access) on the shortest way to the access point (by setting blocks/points on the way to accessed).
I know this is a very open question and I apologize for that. I am just lacking a good starting point programming wise. I was thinking of knnsearch, but I am not sure if this is the right way to go as the blocks have different sizes and i technically want the nearest neighbour in every direction but also only one per direction.
Another idea I had was using shortestpath or creating a travel salesman problem out of it, but I am not sure how to properly implement it.
If you have any ideas or you could offer any help I would very much appreciate it. If any more information is needed I gladly provide it.

Setting area for BlobAnalysis in Matlab

I am using this example from a Computer Vision Made Easy" Matlab Webinar I watched, since I intend to use Computer Vision for my research in order to count cars and/or other types of vehicles.
Although I have changed some of the filter parameters and the detection works quite well, the problem is that the script displays ALL moving objects in the video. I would like to count vehicles from a specific road but my video screenshot includes many roads (screenshot here).
1) Is there a way to set the area of the video that I would like to detect cars? For example, only the "green arrow" road, and leave out the rest? I tried to crop the video but it is not a good solution since a part of another road always appears(screenshot here).
2) Moreover, in which part of the code can I add a counter in order to have an output on how many vehicles passed through the specific segment of the road? Any ideas on that?
If you know ahead of time where the road is, you can create a binary mask image, where the road is marked with 1's, and everything else has the value of 0. Then you can simply check whether or not a moving object is inside your region of interest.
Once you get comfortable with this example, check out a more advanced version, which not only detects moving objects, but also tracks them using the Kalman filter.

Not able to calibrate camera view to 3D Model

I am developing an app which uses LK for tracking and POSIT for estimation. I am successful in getting rotation matrix, projection matrix and able to track perfectly but the problem for me is I am not able to translate 3D object properly. The object is not fitting in to the right place where it has to fit.
Will some one help me regarding this?
Check this links, they may provide you some ideas.
http://computer-vision-talks.com/2011/11/pose-estimation-problem/
http://www.morethantechnical.com/2010/11/10/20-lines-ar-in-opencv-wcode/
Now, you must also check whether the intrinsic camera parameters are correct. Even a small error in estimating the field of view can cause troubles when trying to reconstruct 3D space. And from your details, it seems that the problem are bad fov angles (field of view).
You can try to measure them, or feed the half or double value to your algorithm.
There are two conventions for fov: half-angle (from image center to top or left, or from bottom to top, respectively from left to right) Maybe you just mixed them up, using full-angle instead of half, or vice-versa
Maybe you can show us how you build a transformation matrix from R and T components?
Remember, that cv::solvePnP function returns inverse transformation (e.g camera in world) - it finds object pose in 3D space where camera is in (0;0;0). For almost all cases you need inverse it to get correct result: {Rt; -T}

Matlab: Track point on object in video

I would like to track (if that is the right word for this) the movement of a point on an object and return the co-ordinates for the point in each frame to arrays for plotting. How would you go about doing this?
The point on the video is a certain color and so my first effort was to eliminate all other colors and change the part I wish to follow to black and everything else to white. Doing this left me with some areas in the background which are the same color but I wish to ignore them and just focus on the moving point. I do not know where to even begin with this or if I've even been trying to do the right thing so far?
Any help would be greatly appreciated! :)
Try searching for terms like 'tracking', 'morphological', 'computer vision', 'matlab'
Here's a project that I found that will probably get you started.
http://www.mathworks.com/matlabcentral/fileexchange/28757-tracking-red-color-objects-using-matlab
if your object of interests is of a certain specific color. You can always apply a color-filter. To give you a bit of a background, i was trying to track not a point on an object, but a moving object in one of the videos i have. (it was a ping-pong video and my goal was to track the ping-pong ball). My algorithm was simple and fast (as i did not want any of my filters to induce heavy computations at one single frame). The basic idea was to apply a color filter. Similar to other shape filters, if your target is of high similarity to the filter, the response will be distinctive enough for you to notice. In other words, if you minus two objects that are extremely similar, you will get 0, otherwise, it will be far greater than 0.