I'm using the same matrix in cvWarpPerspective for several frames. Now I noticed that a lot of time seems to be spent creating maps for cvRemap. I would love to
cache the Maps that are created for cvRemap
maybe even combine that map with an undistortion map
I can't figure out how to create the maps from my 3x3 matrix myself quickly.
Thanks!
There is no OpenCV function to create the maps for you, but I did the same by copying the code from warpPerspective (the map creation part)
It's easy because warpPerspective creates the maps, then calls remap() with them.
In order to optimize memory usage, warpPerspective calculates the maps for small blocks - you have to modify it to create the full map.
As for combining it with distortion, you have to write your custom map generator - you'll need some math there.
Related
I have a simple globe view in my app. Previously we were using WhirlyGlobe, but have opted to use SceneKit instead. Everything works great and we are happy with it EXCEPT we used map tiles in Whirly Globe and the do not work (as far as I can tell) in SceneKit. We want to use that map (tiled, split or as one file) on an SCNSphere geometry.
I copied the satellite map that Apple uses in their documentation and it looks right, but is not the map we need. Our map is in web/sphere mercator projection and it looks bad in SceneKit on my sphere.
I do not* know what the 2x1 projection Apple is using is called, so JUST that information might be enough for me to find the solution.
I do now:
Equirectangular - RIGHT after I posted of course.
Also known as Platte Carre (per Hal Mueller's comment)
An export of our map in the web mercator projection is 1x1. Just squishing it in the vertical axis does not work (SceneKit does this automatically anyway).
I can convert the file programmatically, using a tool or some hybrid if needed.
If needed, I can provide thumbs of the map skins.
If you already have images and need to reproject them (say from Mercator to Plate Carree/Equirectangular), take a look at GDAL (http://www.gdal.org). In addition to the format conversions, it contains a reprojection library. GDAL runs on most systems, and can be used from the command line or bundled into other programs.
I want to add two different layers in one map. A is using EPSG:4326 projection, while B is using EPSG:3857 projection. When I tried this with openlayers3, some error come out.
I can't find function like setProjection in ol.View, it seems that openlayers3 do not support this action.
But when i use Cesium, Cesium support this.
What can i do if i have to do this with openlayers3?
OpenLayers 3 can reproject vector data sources without any problem. But since you mention Cesium, I guess you are asking about raster sources. Raster reprojection is currently not possible, but it is a planned feature.
I'd like to implement Measure functionality on openstreet map. Measure is adding two points on a map and find the distance between those points.
For that I referred https://github.com/danstowell/openstreetmap-website/commits/jsrouting-contextmenu
It will work fine except water area/region on openstreet map. In my case I am rendering my own maps on my project, so this is not work for me.
I am using below Environment:
Environment : Rails 4 and Ruby 2
Anyone know about it?
How do I implement measure functionality on my map?
Is there any other ways to implement this?
Not sure on the specifics relating to OSM, however assuming that you can convert the points to geodetic points then you can use the haversine or vincenty formulas to get the great circle distance:
http://www.movable-type.co.uk/scripts/latlong.html
OSM uses a spherical Mercator projection. If all you have are 2d Cartesian (projected) coordinates then you will need to convert these to geodetic coordinates.
If you also need to take into account terrain then this gets more complex but maybe OSM provides something for this that gives heights along a transect line.
I want to find curvature at depth map
Look at the picture
This is example of curvature
Maybe if i represent image as function and take second derivative from it a can find curvatures. But i couldn't to implement it. (I tryed sobel operator from opencv)
Is there way out?
PS Sorry for my writing mistakes. English in not my native language.
That is not a depth map, it is a point cloud (but I assume it is generated from one single depth map z = f(x,y).
What curvature do you want to estimate? Mean, Gaussian, the whole 2nd fundamental form?
See, e.g. here for definitions. Here's a recent reference on fast estimation methods:
i need to find a marker like the ones used in Augmented Reality.
Like this:
I have a solid background on algebra and calculus, but no experience whatsoever on image processing. My thing is Php, sql and stuff.
I just want this to work, i've read the theory behind this and it's extremely hard to see in code for me.
The main idea is to do this as a batch process, so no interactivity is needed. What do you suggest?
Input : The sample image.
Output: Coordinates and normal vector in 3D of the marker.
The use for this will be linking images that have the same marker to spatialize them, a primitive version of photosync we could say. Just a caroussel of pinned images, the marker acting like the pin.
The reps given allowed me to post images, thanks.
You can always look at the open source libraries such as ARToolkit and see how it works but generally in order to get the 3D coordinates of marker you would need to:
Do the camera calibration.
Find marker in image using local features for example.
Using calibrated camera parameters and 2D coordinates of marker do the approximation the 3D coordinates.
I've never implemented sth similar by myself but I think this is a general concept you should apply on your method.
Your problem can be solved by perspective n point camera pose estimation. When you can reasonably assume that all correspondences are correct, a linear algorithm should do.
Since the marker is planar, you can also recover the displacement from the homography between the model plane and the image plane (link). As usual, best results are obtained by iterative algorithms (link).