Open and Save *.raw images

Hello everybody!
I have qustions: How can sufficient open and save .raw images in
Matlab, without losing any information, byte order...

Thank you for you help!

marko
0
marko.usaj (12)
12/1/2007 3:28:08 PM
comp.soft-sys.matlab 206967 articles. 560 followers. lunamoonmoon (258) is leader. Post Follow

8 Replies
1095 Views

Similar Articles

[PageSpeed] 25
icemare <marko.usaj@gmail.com> wrote in message <5d58718e-
516d-472a-b9d6-34da8dc8ae7d@l1g2000hsa.googlegroups.com>...
> Hello everybody!
> I have qustions: How can sufficient open and save .raw 
images in
> Matlab, without losing any information, byte order...
> 
> Thank you for you help!
> 
> marko

If I recall correctly there is no one format for raw 
images. Different camera manufacturers have their own 
format. Thus it may not be an easy solution. However; if 
you check the Matlab help (search for raw) some information 
is available for imread and imwrtie. Possibly this info is 
applicable to what you are trying to do.

Reed
0
12/1/2007 4:22:31 PM
ok...i found that multibandread and multibandwrite do their job ok!

But

multibandwrite is very slowly...my code is:

multibandwrite(16BPP_data,[resultPath1,'name.raw'],'bip',[1,1,1],
[512,640,1],'precision','uint16');

is there something that will do things faster...

OR

Is there any other solution instead this function

thanks!!!

Marko

Reed Farrar je napisal:
> icemare <marko.usaj@gmail.com> wrote in message <5d58718e-
> 516d-472a-b9d6-34da8dc8ae7d@l1g2000hsa.googlegroups.com>...
> > Hello everybody!
> > I have qustions: How can sufficient open and save .raw
> images in
> > Matlab, without losing any information, byte order...
> >
> > Thank you for you help!
> >
> > marko
>
> If I recall correctly there is no one format for raw
> images. Different camera manufacturers have their own
> format. Thus it may not be an easy solution. However; if
> you check the Matlab help (search for raw) some information
> is available for imread and imwrtie. Possibly this info is
> applicable to what you are trying to do.
>
> Reed
0
marko.usaj (12)
12/5/2007 2:32:01 PM
icemare <marko.usaj@gmail.com> wrote in message <3aa4c6d1-
c7d1-445f-b164-207eeb6cbc52@l16g2000hsf.googlegroups.com>...
> ok...i found that multibandread and multibandwrite do 
their job ok!
> 
> But
> 
> multibandwrite is very slowly...my code is:
> 
> 
multibandwrite(16BPP_data,[resultPath1,'name.raw'],'bip',[1,1,1],
> [512,640,1],'precision','uint16');
> 
> is there something that will do things faster...
> 
> OR
> 
> Is there any other solution instead this function
> 
> thanks!!!
> 
> Marko
> 
> Reed Farrar je napisal:
> > icemare <marko.usaj@gmail.com> wrote in message 
<5d58718e-
> > 516d-472a-b9d6-
34da8dc8ae7d@l1g2000hsa.googlegroups.com>...
> > > Hello everybody!
> > > I have qustions: How can sufficient open and save .raw
> > images in
> > > Matlab, without losing any information, byte order...
> > >
> > > Thank you for you help!
> > >
> > > marko
> >
> > If I recall correctly there is no one format for raw
> > images. Different camera manufacturers have their own
> > format. Thus it may not be an easy solution. However; if
> > you check the Matlab help (search for raw) some 
information
> > is available for imread and imwrtie. Possibly this info 
is
> > applicable to what you are trying to do.
> >
> > Reed

You might try DCRAW.  It is a C program that reads and 
converts most if not all camera RAW formats to TIFF or 
PPM.  I don't know how fast it is compared to 
multibandread, but an 8 mega-pixel Canon CR2 file converts 
to 16-bit per color TIFF in about 14 seconds on my laptop.  
The resulting TIFF file is 46Mb.  The import wizard or 
imread loads the TIFF into an NxMx3 uint16 matrix in less 
than 1 sec.

Links to DCRAW,
Author's page
http://cybercom.net/~dcoffin/dcraw/

Compiled executables,
http://www.lebsanft.org/blog/?tag=dcraw


Ken

0
12/5/2007 4:53:58 PM
On 5 dec., 17:53, "Ken Garrard" <ken_garrar...@ncsuDOT.edu> wrote:
> icemare <marko.u...@gmail.com> wrote in message <3aa4c6d1-
>
> c7d1-445f-b164-207eeb6cb...@l16g2000hsf.googlegroups.com>...> ok...i found that multibandread and multibandwrite do
> their job ok!
>
> > But
>
> > multibandwrite is very slowly...my code is:
>
> multibandwrite(16BPP_data,[resultPath1,'name.raw'],'bip',[1,1,1],
>
> > [512,640,1],'precision','uint16');
>
> > is there something that will do things faster...
>
> > OR
>
> > Is there any other solution instead this function
>
> > thanks!!!
>
> > Marko
>
> > Reed Farrar je napisal:
> > > icemare <marko.u...@gmail.com> wrote in message
> <5d58718e-
> > > 516d-472a-b9d6-
>
> 34da8dc8a...@l1g2000hsa.googlegroups.com>...
>
>
>
> > > > Hello everybody!
> > > > I have qustions: How can sufficient open and save .raw
> > > images in
> > > > Matlab, without losing any information, byte order...
>
> > > > Thank you for you help!
>
> > > > marko
>
> > > If I recall correctly there is no one format forraw
> > > images. Different camera manufacturers have their own
> > > format. Thus it may not be an easy solution. However; if
> > > you check the Matlab help (search forraw) some
> information
> > > is available for imread and imwrtie. Possibly this info
> is
> > > applicable to what you are trying to do.
>
> > > Reed
>
> You might try DCRAW.  It is a C program that reads and
> converts most if not all cameraRAWformats to TIFF or
> PPM.  I don't know how fast it is compared to
> multibandread, but an 8 mega-pixel Canon CR2 file converts
> to 16-bit per color TIFF in about 14 seconds on my laptop.
> The resulting TIFF file is 46Mb.  The import wizard or
> imread loads the TIFF into an NxMx3 uint16 matrix in less
> than 1 sec.
>
> Links to DCRAW,
> Author's pagehttp://cybercom.net/~dcoffin/dcraw/
>
> Compiled executables,http://www.lebsanft.org/blog/?tag=dcraw
>
> Ken

Thank you for your answer!!

But for me is necessary that i saw data in .raw format as it does
multibandwrite function.
I am quite happy with multibandread fastness.
and i'm sorry that i didnt mention before, i have 16BPP grayscale
image (with MSB setting to zero)...it just must be in that way

So, do you have any other solution?

Thank you in advance !

Marko
0
marko.usaj (12)
12/5/2007 10:13:01 PM
Row images can simply be loaded to the memory by using the load function. Have you tried load?
0
kirani.singh (457)
12/6/2007 7:49:55 AM
On 6 dec., 05:49, Yumnam Kirani Singh <kirani.si...@gmail.com> wrote:
> Rowimagescan simply be loaded to the memory by using the load function. Have you tried load?

Yes i tried, but it seems that it doesn't work properly.. i dont know
why...but when i do some processing the result i right only when i use
multibandread and multibandwrite....

like:

multibandwrite(image2,[PathName,filename.raw'],'bip',[1,1,1],
[512,640,1],'precision','uint16');

And

image16H = multibandread([resultPath2,fname], [512 640 1],'*uint16',
0, 'bip', 'ieee-le');

Any suggestion?

Marko
0
marko.usaj (12)
12/6/2007 11:03:12 AM
icemare <marko.usaj@gmail.com> writes:

>> icemare <marko.u...@gmail.com> wrote in message <3aa4c6d1-
>>
>> c7d1-445f-b164-207eeb6cb...@l16g2000hsf.googlegroups.com>...> ok...i found that multibandread and multibandwrite do
>> their job ok!
>>
>> > But multibandwrite is very slowly...my code is:
>>
>> multibandwrite(16BPP_data,[resultPath1,'name.raw'],'bip',[1,1,1],
>>
>> > [512,640,1],'precision','uint16');
>>
>> > is there something that will do things faster...

> But for me is necessary that i saw data in .raw format as it does
> multibandwrite function.  I am quite happy with multibandread
> fastness.  and i'm sorry that i didnt mention before, i have 16BPP
> grayscale image (with MSB setting to zero)...it just must be in that
> way

Define slowly.  Put a "tic" before the multibandwrite, and a "toc"
afterward, and see how long it actually takes.

Another solution (given your simple format) is to just use fwrite to
output the data:

fid = fopen('name.raw', 'wb');
fwrite(fid, 16BPP_data, 'uint16')
fclose(fid);

You might need to transpose 16BPP_data.


-Peter

0
boettcher (2303)
12/6/2007 11:42:34 AM
On 6 dec., 12:42, Peter Boettcher <boettc...@ll.mit.edu> wrote:
> icemare <marko.u...@gmail.com> writes:
> >> icemare <marko.u...@gmail.com> wrote in message <3aa4c6d1-
>
> >> c7d1-445f-b164-207eeb6cb...@l16g2000hsf.googlegroups.com>...> ok...i found that multibandread and multibandwrite do
> >> their job ok!
>
> >> > But multibandwrite is very slowly...my code is:
>
> >> multibandwrite(16BPP_data,[resultPath1,'name.raw'],'bip',[1,1,1],
>
> >> > [512,640,1],'precision','uint16');
>
> >> > is there something that will do things faster...
> > But for me is necessary that i saw data in .rawformat as it does
> > multibandwrite function.  I am quite happy with multibandread
> > fastness.  and i'm sorry that i didnt mention before, i have 16BPP
> > grayscale image (with MSB setting to zero)...it just must be in that
> > way
>
> Define slowly.  Put a "tic" before the multibandwrite, and a "toc"
> afterward, and see how long it actually takes.
>
> Another solution (given your simple format) is to just use fwrite to
> output the data:
>
> fid = fopen('name.raw', 'wb');
> fwrite(fid, 16BPP_data, 'uint16')
> fclose(fid);
>
> You might need to transpose 16BPP_data.
>
> -Peter

I defined slowly:

Elapsed time is 27.834668 seconds.

but i found the trick!

this is why i set parameter Method: Band-Interleaved-by-Pixel, 'bip'.
Then i changed this parameter to Band-Sequential,  'bsq' and now the
time is

Elapsed time is 0.076887 seconds.

So...now is everything ok! i suppose...


thank you for your answers anyway!

regards

Marko
0
marko.usaj (12)
12/7/2007 8:58:33 AM
Reply:
Similar Artilces:

open stdin a second time
Hi, I´m opening stdin to get a file and pass it through a pipe. r=popen("/usr/local/bin/mfilt","w"); while((ret=fread(l,1,sizeof(l),stdin))>0){ fwrite(l,1,sizeof(l),r) } pclose(r); After that, if mfilt returns me an error I want to send an email with the original message attached...but how can I re-read stdin to do that. I do not want to save the message to a temp file or save it to memory for i/o questions. Is there a way to re-read stdin ? amit khan <nospam@nospam.com> writes: > I´m opening stdin to get a file and pass it thro...

Seperating Row Interleaved Stereo Images
Hi, Is there way I can access individual pixel, row and column wise of a Jpeg or a bitmap image? I have a row interleaved Stereo image and I want to seperate left and right image out of that single row interleaved image. Thanks in advance. Regards Sid ...

Open Forum 4 ALL #2
Opened Forum ! http://sqlwarrior.freehostia.com/forum SQL Warrior Forum The most opened forum on the world ! Every one can join and asks question, expert will reply ! Discussion about SQL, Dotnet and VB... Job seeker and company requirement : Found best workers here and posts your jobs here for free. Workers can posts resume and search for jobs ! Advertise here for free! (in the misc forum) Posts anything you want to know. Show your site and get higher traffic Join now it's free http://sqlwarrior.freehostia.com/forum http://sqlwarrior.freehostia.com/forum ...

Image Procesing Matlab
Hi, I want to read all the pixel values at alternate locations of a given image to alternate matrices, is it possible in matlab. I have read the image using 'imread' which gives all the pixel values in a matrix X and after that I want all the values at even location in the matrix X goes to a and values corresponding to odd locations go to matrix b. so that i have all the alternate values in a and b respectively. please help if you can... thankx... Try this: evenImage = originalImage(2:2:end, 2:2:end); oddImage = originalImage(1:2:end, 1:2:end); Try to avoid short, non-desc...

GalCiv2: Where are the save files?
I am having trouble with the galciv2 forums. In what subdirectory are the save games found? Usually I can find these easily for games. Thx, Bryce "JHawk" <brycej@truman.edu> wrote in message news:1142902863.299947.293940@j33g2000cwa.googlegroups.com... > I am having trouble with the galciv2 forums. > > In what subdirectory are the save games found? Usually > I can find these easily for games. My Documents\My Games\Sid Meier's Civilization 4 I am looking for Galciv2. But yes, they are buried about 4 levels deep under documents an...

Open Debate About OpenDocument
http://www.foxnews.com/story/0,2933,172063,00.html James Prendergast's column, Massachusetts Should Close Down Open Document, touched a nerve among FOXnews.com's tech savvy readers and ignited a heated response. ... Editor's Note: The column "Massachusetts Should Close Down OpenDocument" that appeared on FOXnews.com Sept. 28 identified author James Prendergast as executive director of Americans for Technology Leadership, but failed to disclose that Microsoft is a founding member of that organization. ATL is a coalition of t...

Re: Shortcut for doing a Save as of SAS code
On Thu, 24 Nov 2005 23:44:09 -0800, Hari <excel_hari@YAHOO.COM> wrote: >Hi, Hi again! >In Office documents I can press F12 for doing Save As . > >Is there an equivalent key for saving a SAS code with new >name/location? > >Regards, >Hari >India I tried assigning this functionality to my F2-button by writing "keydef F2 dlgsave" in the command-window. It worked in all windows *except* the Enhanced Editor. However, if I wrote "dlgsave" directly in the command-window, then the box opened... :-) Enhanced Editor doesn't like F2, I think.....

Create DMG-like (ISO) Windows-compatible disk image
Is it possible to create a disk image on a Mac (using Tiger) that a Windows user could use to create a CD? That is, can I create an .iso file on a Mac that is useable on a PC? I'd prefer to do this using the shell but I'll take any solution using the GUI. I want to put JPEGs and MPEGs in an .iso file for download via the web. Thanks for your help. I've seen 'mkisofs' spoken about (via Google) but it's not in my path: which mkisofs no mkisofs in /bin /sbin /usr/bin /usr/sbin /usr/local/bin On 2005-12-22, dave@earth.mac <dave@earth.mac> wrote: > Is it...

Macro for opening files by passing filenames as token
Hello Folks I was trying to write a macro to open files by passing the file names as a token and I tried the following syntax but it didn't work. Define fsdts1 (!POS !CHAREND ('/')). !DO !fsds !IN (!1). GET FILE=CONCAT("'D:\temp\",!fsds,".sav'".) !DOEND. !ENDDEFINE. *** fsdts1 "fname"/. can any one help me on this ? Thanks in Advance -Anantha Try this Define fsdts1 (!POS !CHAREND ('/')). !DO !fsds !IN (!1). get fil !Quote(!concat('D:\temp\', !fsds, '.sav')). !DOEND. !ENDDEFINE. A...

Tried Open Office. Hate it.
Using Office 2003. Love it. On Aug 16, 9:05=A0pm, reporter <TruckSaf...@gmail.com> wrote: > Using Office 2003. =A0Love it. to each his own.... we love you for trying it. "reporter" <TruckSafety@gmail.com> stated in post c6aff9c3-eee2-4d48-af8f-edbf8fbfb154@v26g2000prm.googlegroups.com on 8/16/08 6:05 PM: > Using Office 2003. Love it. Curious what about Open Office was not to your liking? The current version is excellent but, of course, it has its pros and cons like anything. -- "Innovation is not about saying yes to everything. It's about saying...

Open panel too long to open....
OS 10.3.4 on a G4 Cube w Internet connection open (cable) When using a context menu 'Open with..' on a file in the Finder... it takes a long long time to display the Open Panel (spinning wheel)... is it searching a complete list of libraries to display including out searching on internet ?...... why it's so long ? any way to shorten this delay ? thanks for hints Joss ...

Runtime error R6025 and Vision Image window freezing
I'm running LabView 8.0.1 and Vision 7.0 (our site license currently only covers to this version). For some VIs (running in LabVIEW, not runtime) on some machines, the following occurs:When clicking on an Image window with the pointer (Tool 1) the Image window freezes - i.e. cursor position is not updated, and the user is unable to click further.&nbsp; This is usually, but not always, remedied by changing the tool to something else and back again.&nbsp; In any case, when the application is closed, it causes a R6025 runtime error.- On two machines (with the same VIs used) this does ...

Obtaining the pixel values of two black points in an image!
Hi there. I desperately need help on this topic. I am trying to obtain pixel values for two black points automatically with a single command on Matlab workspace for an input image which is http://img4.imageshack.us/f/twopoints1.jpg/, in this image, there are two black points, and i want to find the pixel values of those two points automatically, instead of pointing at them and noting the values. Please help on this topic asap. Thanks Siddharth Magazine: My image processing demo: http://www.mathworks.com/matlabcentral/fileexchange/25157 will handle this perfectly - you just have...

Open Intervals Represented by Gauges
I would like to represent an open interval (on the real line) with a Horizontal or VerticalGauge. Let's say (0, 1). I can represent this in calculations by using ConditionalExpression[x, 0 < x < 1] where x might be set by a HorizontalGauge. Then the ConditionalExpression of x becomes Undefined at the endpoints. But I would also like this to be reflected in the appearance of the Gauge. For interior points I would like the Gauge marker to be a blue triangle, and at the endpoints to change to a white triangle with a black outline. The following was my attempt us...

Proxy site open all blocked sites 7811
Proxy site open all blocked sites http://yourp.zxq.net ...

Opening multiple m files
I currently use the R2007a version of MATLAB. However, the previous version you could open multiple mfiles in one window but different tabs. However, this version, whenever you try to open another mfile while one is already opened, it will make the currently opened one invisible and there is no way you can get to it. This is frustrating "ade77 " <ade100a@gmail.com> wrote in message <gc9d0d$hjn$1@fred.mathworks.com>... > I currently use the R2007a version of MATLAB. However, the previous version you could open multiple mfiles in one window but different tabs. > ...

Free open source IDE for C programming
Hi, I would like to know what do u suggest for Free open source IDE for C programming. The minimum features i expect are online help (in the editor) something u see in Borland C compiler (with that Ctrl+F1 option), highlighting, auto indenting. Dev C++ does the last two but i don't seem to have online help i expect. Thanks in advance. Greenhorn. On 8 Feb 2005 12:47:14 -0800, "Greenhorn" <teachgreenhorn@yahoo.com> wrote: >Hi, > I would like to know what do u suggest for Free open source IDE for >C programming. The minimum features i exp...

Failure to add object in kepserver (Open Process Control app)
Hi everyone, I am asking you this question because I'm pretty much stuck. I am a student and my assignment is to make a simple OPC client/server application. To this end I've gotten Vihang Patil's OPC simulation program from here: http://www.mathworks.com/matlabcentral/fileexchange/27788-opc-serverclient-demo However, when I run it, without modifications, I get a "non-existent field" error and a "ui callback" error upon pressing the two buttons of the GUI, for a cylinder and ejector device, respectively. Kepserver, the app used for the OPC server part of...

Problems with Using OPEN in Fortran MEX
OS - Win 7 Ultimate - 64 bit MATLAB - 2010a - 64 bit Fortran - Intel Visual Fortran 11.1 I have a DOS Fortran program that uses lookup tables contained in binary files on the local hard drive read in using "OPEN". The lookup tables are static and do not change from run to run. The program works fine. I wrote a wrapper for the program, had a few issues that I eventually worked out, but now the mexFunction wrapper is working. (I checked with "mexPrintf", and the inputs argument passed from MatLab are all correct) However, deep in the program, it bombs when I call the "...

Cannot open MS Word from within our VO app
Hi all, the OrtoWin software we develop, contains a few connections via OLE to open MS Word and MS Outlook, etc. One of our customers isn't capable of opening MS Word from within our OrtoWin application. We added a few messageboxes into the app, in order to find the exact location of the fault in the code. The problem seems to be in the call procedure of the OLE object. When we check if the object is NIL, the answer is no, so we have an object. When we continue and check if the fInit is succeeded, the returnvalue is false, so the fInit had failed. We have reasons...

How do I open this
Can anybody tell me what program I can use to open this I tried gsview, distiller, rope, and a bunch of other small programs. they all give me errors. I have windows but can get to a mac, but dont know were to get pagemaker at least a version that will open this file. So does anybody know a program that will more than likely open it. all programs usually give me to errors missing font times-roman, and an error saying that the file is corrupt or terminates early. please help. here is what the first part of the file says %!PS-Adobe-2.0 %%Title: chap6.sltn.new %%Creator: PageMaker 4.21 %%Creat...

Imaging for dual boot?
Been using Acronis True Image for WinXP, but am now dual booting with Vista. Anyone recommend imaging software that can properly handle the dual boot? Thanks -- Derek DerekBaker <Derek@DontBother.com> wrote: > Been using Acronis True Image for WinXP, but am now dual booting with Vista. > Anyone recommend imaging software that can properly handle the dual boot? TI handles that fine. * Rod Speed: > DerekBaker <Derek@DontBother.com> wrote: > >> Been using Acronis True Image for WinXP, but am now dual booting with Vista. > >&g...

draw line in an existing image
Hello Friends, I have an image 300*200 pixels. I need to draw a line on it. I know the coordinates for it. Can anyone tell mw how to go about it? Thanks, M. Mudita: <SNIP line on top of an image one of the solutions img=load('clown'); imagesc(img.X); colormap(img.map); axis image; line([10,100],[20,50],... 'linewidth',10,... 'color',[0 1 0]); us Mudita wrote: > Hello Friends, > I have an image 300*200 pixels. I need to draw a line > on it. I know the coordinates for it. > Can...

FCC Adopts First Open Internet Regulations [telecom]
Party Line Vote Exposes Deep Divisions; Two Republican Commissioners Are Harshly Critical by John Eggerton -- Multichannel News, 12/21/2010 | The Federal Communications Commission voted along strict | party lines Tuesday to adopt regulations on Internet | access. | | The meeting was characterized by cordial delivery of | scathing dissents by the Republicans and a less-than | enthusiastic concurrence by swing vote Democratic | commissioner Michael Copps, who said he had seriously | considered dissenting before concluding it was at least | a first step in the right direction. Repu...

Cannot open excel through weblogic/tomcat server
I'm not able to open an excel file through weblogic/tomcat server.why?It opens as an excrypted file.Can someone help to figure out a solution?? On 14 Aug, 05:56, ruds <rudra...@gmail.com> wrote:> I'm not able to open an excel file through weblogic/tomcat server.> why?> It opens as an excrypted file.> Can someone help to figure out a solution??http://www.mrc-productivity.com/members/manual/servletmanual/using_tomcat_to_serve_excel_files.htmlGenerally it is useful to search Google BEFORE posting the question,the above was the 1st result of google search for 'tomcat ...