I have around 200,000 images that need to be rotated correctly.
Also, 30 images with their corresponding rotated images, how will I train opencv to achieve what I want? Some tips would be appreciated.
I'm using this library for opencv
Thanks!
Open each file using the readImage method as per their examples and the Matrix your callback receives has a rotate function you can use.
Related
I'm processing a 3D numpy array and would like to know if it is possible to write/read the entire 3D volume as 1 single 3D .dcm rather than a series of 2D .dcm files. Can this be accomplished using pydicom library as this is what I'm using. I'm new in working with DICOMs so I'm not sure how to go about about implementing this if possible.
I found this to be what I wanted but I could not access the code as the link to it is dead. https://github.com/pydicom/pydicom/issues/786
Any help will be appreciated.
I just want to register UAV images side by side using pix4D software, but the problem is I don't have any GCPs. How do I get a mosaic where all the images are stitched properly?
Images with Pix4d are typically referenced with geo-information (data tagged from INS/GPS and IMU). If this is not the case, there is no way for Pix4d to know where your images are in space.
An alternative to geo-referenced images is to create Manual Tie Points. This is a tedious process and has an effect on accuracy + image distortion. Check out Pix4D tutorials on Youtube or Pix4d/FAQ's for how to tag your images with MTP's.
Hope that helps & good luck.
GOAL: I have to create a 3d model of a machine part. I have about 25 images of the same thing taken from different angles.
Progress: I am able to extract the coordinates for a label that is on the machine for most of the images.
Problem: but I have no idea how to proceed. I have read a bit about aero-triangulation, but I couldn't figure out how to implement it. I would really appreciate it, if you could guide me in the right direction.
It would be really helpful, if you could provide your solutions using python and opencv.
Edit: sorry but I cannot upload the code for this one as it is confidential. don't blame me please I am just an intern. Although I can tell that I cropped a template of the label from an image and then used Sift to match that template on all the images to get the coordinates of the label.
If you want to implement things yourself with OpenCV, I would command looking at SIFT (or SURF) features, RANSAC and the epipolar constraint. I believe the OpenCV cookbook describe those. Warning: math involved. And I don't know how to do dense mapping in OpenCV.
I know the GUI program "VisualSFM" that can automatically recreate 3D model from images. It uses SFM and other command line utilities behind the scenes. Since everything is opensource, you could create a python wrapper around the actual libraries (I found https://github.com/mapillary/OpenSfM asking Google). VisualSFM prints the command it calls, so a hacky way could be to call the same commands from python.
If it is a simple shape and you don't want to automate it, it could be faster to model it yourself (and the result could look better). In 1.5 week I managed to learn the basics of blender and to model a guitar necklace: https://youtu.be/BCGKsh51TNA . And I would now be able to do it in less than 1h. How long are you ready to invest to find a solution with OpenCV?
Is there any way to create a GIF animation out of 50 or more JPG files ( pretty big files ) using the GPU ?
At this moment it takes about 15 secs to create a GIF out of 24 JPG images and looking for a much faster solution ( using ImageMagick ).
Thanks!
Not really what you are asking for, but you could try using gifsicle instead of imagemagick. It should create gifs faster.
I have many raster (bitmap) images that I'd like to transform from unprojected lat-lon to a projected rendering. (e.g. GIF, PNG).
I don't understand how to use PROJ.4 to render the resulting image. I'd like a library or software that can do this all automatically. GRASS GIS is large. The transforms are relatively simple transforms and of raster images only.
Or is there basic code or an example of how I would do this? using PROJ.4 and GraphicsMagick.
It is a little confusing about what you are asking for here.
If you are trying to convert from a LAT Long geo referenced image to another projection or if you just want to keep the current geo referencing of a bitmap and convert it to another format such as GIF or PNG.
If you wish to change formats I don't believe PNG or GIF supports geo referencing in its header so this will not be possible. If you are looking at trying to compress the image so it doesn't take up as much space you could look at JPEG or JPEG2000 as these support both. For a full list of image formats and what supports geo referencing and what does not this page is a good place to start:
Link
If you wish to change the co-ordinate projection from lat, long to something else (like Mercator mga zone XX) You can use something like GDAL to batch the process.
Download from here: http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries
See here for a list of inlcuded utilities: Link
See here for the utility help for changing projections: Link
See here for utility that changes image formats: Link
Hopefully that will be of help to you.