How to convert point cloud .pts file into .pcd file format? - point-clouds

I downloaded big point cloud file with extension .pts and I want to convert it into .pcd format. What is the simplest and easiest way to do it?

Is .pts ASCII?
If so, you can easily write a parser for it and save it as a .pcd.
Or, if you are looking for a tool, meshlab can read in plain XYZ data and save it to .ply format (remove all header content, if there is any). .ply files are supported by the Point Cloud Library, you can either convert it or just read in the .ply.

Related

How to convert image to integer array? (do not use any non-standard library)

How to convert image.png or image.bmp to integer array? (do not use any non-standard library)
Please ignore chunks that are not directly related to image data.(IHDR、IEND...etc.)
thank you very much.
SOLVED: I should use binary I/O function in stdio.h to read image file. thanks
If you have to read images into arrays without any image processing libraries you need two things:
You need means to read files in general.
You need to know the internal structure of the file formats you want to read.
So for png refer to https://www.w3.org/TR/2003/REC-PNG-20031110/
This document will tell you where to find the image dimensions, pixel data and other features. It's basically a manual for software developers on how to use this standard format properly.
Some image formats will require additional work like decrompression.

Downloading open street map data in pbf format

I want to download data of a specific area from open street map. Whenever I try to export from openstreetmap.org it downloads the data in .osm format but I want the data to be in .pbf format. I have tried converting .osm file to .pbf file using osmconvert.exe but whenever I try to open the converted file in a text editor ( geany to be specific) it shows nothing. But when I tried opening the converted file in vim there was something but not readable. Can someone suggest me a way to download the data of specific area from open street map in readable pbf format?
For downloading area specific OSM files I would like to recommend the service of Geofabrik:
http://download.geofabrik.de/
The format .osm usually is human-readable since it's XML-structured text.
The format .pbf is not human-readable because this is a binary format. PBF-formatted OSM data are highly compressed and need to be converted (for example to .osm or to .csv) before you can read them.
Further information can be found in OSM Wiki:
https://wiki.openstreetmap.org/wiki/OSM_XML
https://wiki.openstreetmap.org/wiki/PBF_Format

How can I convert a extremly big .dat file to Image files?(Like jpg or something)

I have a folder of image file which have been compressed into .dat file. Since the .dat files are extremly huge(They are the microscopic image of the organ.), I don't really know what kind of tools that I can use to convert it into jpeg file. So the best case would that the whole image is split up into pieces, and I can get all the pieces of the image.
The ".dat" file suffix is used broadly, so you'll need to specify more details on what format/source software created the original data. As a guess, from a quick search of ".dat" format microscopy, these tools looks like they might be applicable to your domain:
http://gwyddion.net/
or
http://www.openmicroscopy.org/site/products/bio-formats
If you can't find a library for the format/languages you are using, then you'll need to find documentation of the file format, and write a converter (at least, the reading portion of the converter - you can use something like libjpeg to handle the writing portion.)

Can Ruby read a .dat file created in VB.NET?

How would I create a list of elements in VB.NET, save it to a .dat file, and make Ruby re-create such list (as an array) with such elements (they will be strings, booleans and integers)?
You can do it, but you'd need to find some representation for it. The easiest is probably JSON, so you would
make the data structure in VB
write it to JSON as a file
read the JSON file using Ruby.
Here's a JSON serializer for .Net:
A .dat file is just a binary blob, 'tis it not? If there's any particular format you use you could easily translate that to equivalent Ruby code. Just as long as the knowledge is duplicated on both ends, though that leads to a violation of the DRY principle. JSON might be a good intermediate representation (as noted by #Charlie Martin) because it's a plain text format and you can always add compression.

I need to write a .DDS file cross-platform, can someone point me to example?

I need to create a .DDS file with code that runs on both OSX and Windows. Although the format doesn't look difficult, I'd still like an example of writing the file. Note I don't need to read it, just write it.
C or C++ and RGBA bitmap.
I finally resorted to written a RAW file, and using GraphicConvertor (mac) to read it and write the DDS file. I think Photoshop can do it too. RAW files are simply RGB or RGBA or similar formats written straight to a binary file. Then in the reading application you tell it the dimensions so it can read it in. Then you export to whatever. Not a perfect solution but it worked for what I needed.

Resources