Is there a way to read a .pf file also known as picture floatmap file?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aravind Poolla
am 25 Mär. 2021
Kommentiert: Aravind Poolla
am 27 Mär. 2021
Hello, I am new to matlab and I am trying to open and visualize a .pf file as image but I was unable to do so. Is there a way to read .pf file and visualize it as a image.
I link fot the pf file https://drive.google.com/file/d/1BNML47BAD1hHogjxytxaVpOc4LJqvim-/view?usp=sharing. As for the file I cannot see or oopen it.
Any help is appreciated and Thank you so much in advance.
4 Kommentare
Cris LaPierre
am 26 Mär. 2021
Bearbeitet: Cris LaPierre
am 26 Mär. 2021
All files are from some software. What software created this file?
Akzeptierte Antwort
Cris LaPierre
am 26 Mär. 2021
Bearbeitet: Cris LaPierre
am 26 Mär. 2021
Specifically
- The PFM header is 3 consecutive "lines" of ASCII text. Your file has 5 lines
- The identifier line contains the characters "PF" or "Pf". PF means it's a color PFM. Pf means it's a grayscale PFM. You don't appear to have this line.
- The dimensions line contains two positive decimal integers, separated by a blank. The first is the width of the image; the second is the height. Both are in pixels. You file places the values on separate lines.
- The Scale Factor / Endianness line indicates if the numbers are stored in little endian or big endian format. Your file doesn't have this line.
However, with that information, it is possible to turn it into a valid pfm file format and use the function Walter pointed to to load it. BTW, your file uses big endian format. So you just need to replace your header
- Typ=Pic98::TPlane<float>
- Lines=750
- Columns=1125
- FirstLine=0
- FirstColumn=0
With a valid header. I didn't know the scale factor so I used 1.
- Pf
- 1125 750
- s1
Once you've made those changes to your file, you can load and visualize it with the following code. I've attached your file updated to a pfm format. I had to change the extension to txt to be able to attach it here.
img = read_pfm("PF_file.txt", false)
imagesc(img)
2 Kommentare
Walter Roberson
am 26 Mär. 2021
The files appear to be Luminance images from LMK Labsoft; https://www.technoteamvision.com/content/product_overview/photometer_colorimeter/software/lmk_labsoft/index_eng.html
Technical information inside https://www.technoteam.de/apool/tnt/content/e5183/e5432/e5733/e5735/OperationmanualLMKLabSoft_eng.pdf
LMK Labsoft offers export to MATLAB files.
Weitere Antworten (1)
Walter Roberson
am 26 Mär. 2021
Bearbeitet: Walter Roberson
am 26 Mär. 2021
maybe, if you rename to .pfm extension.
4 Kommentare
Walter Roberson
am 26 Mär. 2021
As suspected, you failed to quote the file name.
img = read_pfm('simulation.pfm', 'bPhotoshopCompatibility')
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!