How to correctly read the data from an image .dat file?
Show older comments
I have a .dat file created by a C++ code segment. The format of the dat file is as per these guidelines: http://users.iit.demokritos.gr/~nstam/ICDAR2013HandSegmCont/Protocol.html
This is the image file:

And here is the dat file for the above image : https://www.dropbox.com/s/q8h3psin2k67vew/color_test.dat
I can tell that the segmented words in the dat file are store in the same format as the bwlabel command would do.
But how do I get the data from the dat file into an array in Matlab for further processing? Suppose the first word is labeled with 1 and the second word with 2. How do I get the 1 to a different array and the 2 to a separate array and so on. Such that I can further work on that array such as imshow or im2bw or even regionprops?
I tried fopen and fread. They did manage to open the file but created a single column vector having 8000+ elements.
thank you
Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!