sind hier vielleicht Leute unterwegs, die mit digitaler Bildverarbeitung/Erzeugung zu tun haben?
Es geht mir um Folgendes: Ich habe Daten in Form einer Matrix, deren Dimension Platten beschreiben und deren Inhalte die Dicke der Platten representieren. Alles im Ascii Format, reine Textdateien.
Also Beispielsweise 1m^2 Platte hat 1000x1000 Punkte. Die Dicke liegt so zwischen 9.8 und 10.2mm. Von diesen numerischen Daten moechte ich gerne ein Bild als Pixelgraphik haben. Also BMP oder sonstiges. Das Bild sollte 1000x1000 Pixel haben, und die Dicke sollte variabel einstellbar von duenn(weiss) nach Dick(schwarz) gehen. Das gleiche sollte auch farblich gehen.
Liesse sich sowas mit Photoshop realisieren? Mit Matlab kann ich's plotten, aber auch exportieren als Bilddatei?
Gruss
Mark
Didn't find your answer? Ask the community — no account required.
G
Gernot Fink
Schau die mal das PPM Dateiformat an. Das ist vermutlch fas so aufgebaut wie deine rohdaten. Konvertieren sollte da leicht sein.
formatting link
MFG Gernot
H
Henning Paul
Mark wrote:
RTFM:
IMWRITE Write image to graphics file. IMWRITE(A,FILENAME,FMT) writes the image A to the file specified by FILENAME in the format specified by FMT. A can be an M-by-N (grayscale image) or M-by-N-by-3 (color image) array. A cannot be an empty array. If the format specified is TIFF, IMWRITE can also accept an M-by-N-by-4 array containing color data that uses the CMYK color space. FILENAME is a string that specifies the name of the file. FMT is a string specifying the format of the file. See the reference page, or the output of the IMFORMATS function, for a list of supported formats. [...] Table: summary of supported image types --------------------------------------- BMP 1-bit, 8-bit and 24-bit uncompressed images GIF 8-bit images HDF 8-bit raster image datasets, with or without associated colormap; 24-bit raster image datasets; uncompressed or with RLE or JPEG compression JPEG 8-bit, 12-bit, and 16-bit Baseline JPEG images PBM Any 1-bit PBM image, ASCII (plain) or raw (binary) encoding. PCX 8-bit images PGM Any standard PGM image. ASCII (plain) encoded with arbitrary color depth. Raw (binary) encoded with up to 16 bits per gray value. PNG 1-bit, 2-bit, 4-bit, 8-bit, and 16-bit grayscale images; 8-bit and 16-bit grayscale images with alpha channels; 1-bit, 2-bit, 4-bit, and 8-bit indexed images; 24-bit and 48-bit truecolor images; 24-bit and 48-bit truecolor images with alpha channels PNM Any of PPM/PGM/PBM (see above) chosen automatically. PPM Any standard PPM image. ASCII (plain) encoded with arbitrary color depth. Raw (binary) encoded with up to 16 bits per color component. RAS Any RAS image, including 1-bit bitmap, 8-bit indexed, 24-bit truecolor and 32-bit truecolor with alpha. TIFF Baseline TIFF images, including 1-bit, 8-bit, 16-bit, and 24-bit uncompressed images, images with packbits compression, images with LZW compression, and images with Deflate compression; 8-bit and 24-bit images with JPEG compression; 1-bit images with CCITT 1D, Group 3, and Group 4 compression; CIELAB, ICCLAB, and CMYK images. XWD 8-bit ZPixmaps Please read the file libtiffcopyright.txt for more information. See also imfinfo, imread, imformats, fwrite, getframe.
Reference page in Help browser doc imwrite
Das sollte reichen, oder?
Gruß Henning
V
Volker Staben
Am 13.04.12 04.55, schrieb Mark:
Die Matlab-Funktion print
formatting link
kann Grafikdateien in verschiedenen Formaten erzeugen. Für Falschfarbendarstellungen gibts colormaps:
formatting link
V.
H
Henning Paul
Das stimmt, ist dann aber mit Achsen und -beschriftungen. Kommt drauf an, ob man das möchte. "Nackte" Bitmaps kann man mit imwrite erzeugen.
Gruß Henning
E
Eric Brücklmeier
Hallo Mark,
BMP unkomprimiert ist ja ein relativ einfaches Format. Hast Du mal darüber nachgedacht, so ein Programm in der Sprache Deiner Wahl selbst zu schreiben? Das sollte an einem Nachmittag erledigt sein.
Viele Grüße
Eric.
Am 13.04.2012 04:55, schrieb Mark:
V
Volker Staben
Am 13.04.12 11.06, schrieb Henning Paul:
klaro muss man sich die Grafik schon so erzeugen, wie man sie im Grafikfile haben möchte. GGf. muss man Ticks, Beschriftungen, xlabels, Grid etc. wegprogrammieren oder so hinprogrammieren, wie man es haben möchte. Vielleicht möchte jemand auch mal eine in LaTeX gesetzte Achsenbeschriftung? In Matlab gibts oft viele - oft unterschiedlich "luxuriöse" - Wege zur Lösung.
V.
S
Stefan
Am 13.04.2012 11:32, schrieb Eric Brücklmeier:
Wollte ich auch gerade vorschlagen. Mit Delphi ist die reine Grafikdarstellung und -speicherung eine Sache von ein paar Minuten.
Gruß
Stefan DF9BI
E
Eric Brücklmeier
Am 13.04.2012 11:47, schrieb Stefan:
Selbst in nacktem C ist das keine schwarze Magie...
Eric.
H
Heiko Nocon
Sicher. Nur das, was du da beschreibst, hat mit Bildverarbeitung praktisch nix zu tun. Es handelt sich vielmehr um eine reine Datenvisualisierung.
Ja klar. Überhaupt mit jedem Programm, was irgendwie Bilder darstellen kann und eine Scripting-Schnittstelle bietet, mit der man einerseits Textdateien einlesen und andererseits Bilder für den Host erstellen/ändern kann. Also notfalls sogar z.B. mit Excel...
Mit einem geigneteren Programm als Excel geht es jedenfalls ungefähr so:
-Lies Textdatei ein
-Stelle Auflösung pro Dimension und Wertebereich der Daten fest
-Hole vom Host ein Bild passender Größe und gewünschter Eigenschaften (TrueColor oder Greyscale)
-Fülle dieses Bild mit den entsprechend dem zur Visualisierung gewünschten Algorithmus skalierten Werten
Kinderkram für Hobby-Programmierer. Wie schon gesagt: Mit wirklicher Bild_verarbeitung_ hat das nix zu tun.
F
Florian Rist
Du müsstest es nur schaffen, aus den ASCII Text 8 oder 16 Bit Interger zu machen und die binär zu speichern, einfach Pixel nach Pixel, alle
1000x1000 hintereinander ohne weiter Headerdaten. Dann könntest Du diese Datei direkt mit Photoshop als Bild öffnen, dazu gibt es den Photoshop RAW Import Filter, der *.RAW Dateien öffnet. Nach dem Auswählen der Datei muss man dem Import natürlich noch die Bittiefe (8 oder 16 Bit) und die breite und Höhe des Bildes angeben.
Grüße Flo
M
Mark
Jetzt ists mir mittlerweile klar. Ein eigenes Programm kam mir auch schon in den Sinn. Erstmal will ich damit nur eine Software ausprobieren. Wenn ich mehr mache dann lohnt sich das vielleicht.
Gruss, Mark
M
Mark
Ja, kann ich naechstes mal javorher machen. Dann haette sich die Frage wohl eruebrigt. Scheint mir recht loesbar zu sein.
Gruss, Mark
M
Mark
Danke fuer die Tips, hatte mich nur noch nicht so ausgiebig ueber die Bildformatstandards informiert. Schein doch recht einfach zu sein.
Gruss, Mark
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.