Animate camera location/pitch in mapdeck - mapdeck

This seems like a simple thing, but I'm stuck. I've been trying to animate the camera angle on a map and export the animation into some sort gif, mp4, etc. On the github website for mapdeck (https://symbolixau.github.io/mapdeck/articles/layers.html) some of the vignettes show this kind of zoom/pitch/camera location animation -- but the code provided for the vignettes (https://github.com/SymbolixAU/mapdeck/blob/master/vignettes/layers.Rmd) only produces still images.
Would anyone be able to provide code that would create the kind of animation shown for "Grid" in the vignettes on the github site (https://symbolixau.github.io/mapdeck/articles/layers.html) as an example?
Thank you in advance!
(I've tried using mapdeck_view with a "duration" and "transition" argument with no success yet.)

Related

iOS custom image crop using paths

I need to implement a custom image crop on iOS and I can't seem to be able to find a technology that will allow me to do that easily. The goal is to have an interface as follows:
The idea is to have some sort of path or something around the face that the user can "nudge" around with their finger. Is there a library for this?
I have played a bit with UIBezierPaths, but I don't see how they can be edited after being stroked.
The best that I can come up with is having the user manually draw a line around the face, but then the line wouldn't be editable.
Please help! Does anyone know of a solution for this? I am in a bind and need to provide my client with a solution.

Applying Ken Burns effect on an AVMutableVideoComposition

I'm working on an app that creates videos from a series of images, using AVMutableVideoComposition. I wanted to add a "Ken Burns" effect on the images, and I created the effect applying transforms to the main AVMutableVideoCompositionLayerInstruction object using the method "setTransformRampFromStartTransform:toEndTransform:timeRange:"
It works, but the scale effect gives an ugly result... it looks like refreshes of the frames are visible... it is like an old computer that cannot keep up the frame rate of the video... I don't really know how to explain this :)
Do you think there is a better way to achieve the result? For example, using AVVideoCompositionCoreAnimationTool?
Can I add animations to the single video tracks in the compositions?
Thanks for your help!

Obtain iOS7-like blur effect with Qt

I was asking myself how I could obtain an iOS 7 like blur/transparency effect. Something like this:
(source: ilounge.com)
I'd like to apply this to a whole QDialog. I know how to obtain a nice transparency, but not how to get this blur.
Can someone help?
Thanks a lot!
Basically, you need to first get a screenshot of the desktop. Then you need to blur it. Then probably save the image to the harddrive. Then you need to set it as the background for your dialog.
And then you need to make the background for each button transparent, too.
If you use QGraphicsView or OpenGL, the last three steps may be very different.
http://qt-project.org/doc/qt-5.0/qtgui/qscreen.html#grabWindow
http://qt-project.org/doc/qt-5.0/qtwidgets/desktop-screenshot.html
Lines of code where it actually grabs the screen:
QScreen *screen = QGuiApplication::primaryScreen();
if (screen)
originalPixmap = screen->grabWindow(0);
In Qt 4.8, it used to be done this way:
http://qt-project.org/doc/qt-5.0/qtgui/qpixmap.html#grabWindow
To blur the screenshot, use this:
http://doc-snapshot.qt-project.org/4.8/qgraphicsblureffect.html
You may need to save it to the harddrive for QStylesheets to be able to find it.
To set the background image, try something like this:
http://qt-project.org/doc/qt-5.0/qtwidgets/stylesheet-reference.html#background-image-prop
Example of how to set a stylesheet:
qApp->setStyleSheet("QLineEdit { background-color: yellow }");
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html
http://qt-project.org/forums/viewthread/1397
Hope that helps.
Thanks a lot for your help phyatt, I succeeded. Although my code works, the result is not as pretty as iOS':
iOS7-like blur with Qt
however, I'm going to post the whole code on my website, I'll post the link here in a while.
Stay tuned!
[EDIT] here's the link to the detailed how-to: iOS7 like blur effect with QT

iOS: Draw on top of AV video, then save the drawing in the video file

I'm working on an iPad app that records and plays videos using AVFoundation classes. I have all of the code for basic record/playback in place and now I would like to add a feature that allows the user to draw and make annotations on the video—something I believe will not be too difficult. The harder part, and something that I have not been able to find any examples of, will be to combine the drawing and annotations into the video file itself. I suspect this is part is accomplished with AVComposition but have no idea exactly how. Your help would be greatly appreciated.
Mark
I do not think that you can actually save a drawing into a video file in iOS. You could however consider using a separate view to save the drawing and synchronize the overlay onto the video using a transparent view. In other words, the user circled something at time 3 mins 42 secs in the video. Then when the video is played back you overlay the saved drawing onto the video at the 3:42 mark. It's not what you want but I think it is as close as you can get right now.
EDIT: Actually there might be a way after all. Take a look at this tutorial. I have not read the whole thing but it seems to incorporate the overlay function you need.
http://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos

Get Started with Open CV image recognition

I am trying to make an app for image recognition with Open CV, i want to implement something like this but i don't know how should i do it can any one give me any help where should i begin from i have downloaded Opencv for iOS from here,
I have a hardcopy of image as an example which i want to scan through the camera and the images(markers) i have imported in project now when i scan the image through camera then it should overlay the markers on the image and when i tap/select the marker it should show the info of that marker.
Here is my image :
It's just an example i have taken (Square,Circle and Triangle as Markers)
So now when the image is scanned then the markers will come up as an overlay and on clicking the markers i should get the names (If the Overlay image over the Circle Named "Air" is tapped it should show me "Air" on an alert or if Square Named "Tiger" is tapped it should say "Tiger")
My problem is that the images are kind of same pattern but the result is different on every part so i don't know how should i approach in this ..
Please can any one help me out by suggesting any idea or if any one has done thing like this please tell me how should i implement it.
I have to start from scratch any help please .
Can this be achieved using Open CV or i have to use any other SDK such as vuforia or layar.
Maybe you should search a little bit before asking help...
Anyway, the shapes you want to find do not seems to change (scale, rotation) so, you can look at the template matching methods implemented in OpenCV (see Tutorial OpenCV)
If the shapes are changing, you should look at more powerful methods such as SIFT or SURF. Both are already implemented in OpenCV (the link from aishack is a tutorial to re-implement SIFT, you can find in the same website a tutorial to use the OpenCV method).

Resources