Open and Save *.raw images

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply marko.usaj (12) 12/1/2007 3:28:08 PM

See related articles to this posting


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
Reply reed.farrar.NOSPAM1 (10) 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
Reply 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
Reply ken_garrardAT (20) 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
Reply 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
Reply 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
Reply 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
Reply boettcher (2302) 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
Reply marko.usaj (12) 12/7/2007 8:58:33 AM
comp.soft-sys.matlab 203516 articles. 531 followers. Post

8 Replies
834 Views

Similar Articles

[PageSpeed] 38


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Raw Images Opening in Photoshop?
I do not have the Camera Raw Plug-In for photoshop, but when I open a raw image from a Nikon D100 (either the compressed or uncompressed raw images) PS asks about white balance and exposure and then seemingly accepts the image as it would any other. What is this process not doing that the PS plug-in or Nikon's Capture would do with the images. Also, seemingly PS makes no distinction between the compressed and uncompressed raw images??? Thanks in advanced for whatever info you can provide. On 6 Feb 2004 06:07:56 -0800, in rec.photo.digital z_q-g.-u@cox.net (john chapman) wrote: >I d...

Opening RAW image files
Is there a way, using Gimp or Kubuntu to open a group of RAW images? I am looking for something that does what Bridge does in Photoshop, I'd like to be able to see the RAW image thumbnails to pick which I want to open, without having to open them full screen one at a time. TIA, Richard me scripsit: > Is there a way, using Gimp or Kubuntu to open a group of RAW images? > I am looking for something that does what Bridge does in Photoshop, I'd > like to be able to see the RAW image thumbnails to pick which I want to > open, without having to open them full screen one at a...

How to save and open images automatically???
Hi everyone, can someone please please tell me on how to save images automatically in matlab. for a = 1:4 ****here there is a code that generates 4 images (as its under a loop of 4) which I need to save on to my matlab root directory**** ****currently i'm using the following to save the 4 images one by one**** [filename, pathname] = uiputfile('*.*', 'Save Sampled Image'); imwrite(out,cmap,[pathname filename]); end I would like to save the images automatically with each having a unique filename so that there is no need of a user to save them one by one. and...

Save an image in raw format
Hello everybody!I'm trying to make a function which implements the standard JPEG with a given quality L. In order to discover if it does work I'd like to save an image matrix to a file.y,so I can compare it with a .jpeg file. How to do such a thing?Imwrite has no options for raw format... On May 13, 8:02=A0am, "Matman86 Di" <pasqui.squ...@email.it> wrote: > Hello everybody!I'm trying to make a function which implements the standa= rd JPEG with a given quality L. > In order to discover if it does work I'd like to save an image matrix to = a file.y,so I can...

open and save a set of image
Hi! We're newbie in IDL programming and we have this problem: We have a set (72) images to open, analize and save the output. Do you know if exists a routine to automatize this process or if anybody has already written this routine or similar? Thanks in advance Cecilia e Maria Best regards cecilia.devecchi@gmail.com writes: > We're newbie in IDL programming and we have this problem: > We have a set (72) images to open, analize and save the output. > Do you know if exists a routine to automatize this process or if > anybody has already written this routine or similar? &g...

saving/resuming images with open resources.
Martin Cracauers raises at the end of: http://www.cons.org/cracauer/lisp-threads.html the question of save-and-stoping/resuming images maybe containing several threads, with respect to open files, terminals, sockets, etc. That question occurs also for example in Eros (http://www.eros-os.org). I don't think you can in general handle automatically the process of restauring open resources. Like with the EINTR errno of unix, you need to have a way to signal the process that a resource is not available anymore. Then user-level handlers can proceed depending on the purpose of the applica...

Create image and save in RAW format
Hi all, I manage to convert an image from video.avi. the image will be save as *.jpg normally. is there any method i can use to save it as *.raw. The reason is because, i need to use raw format is because to avoid from the image being compressed. Thanks zack On Aug 13, 11:48=A0am, "Zack Abdul Aziz" <zulkifli.abdula...@gmail.com> wrote: > Hi all, > I manage to convert an image from video.avi. the image will be save as *.= jpg normally. is there any method i can use to save it as *.raw. The reason= is because, i need to use raw format is because to avoid from the image b...

saving individual frames from a raw image sequence
hi how can the raw image sequence be read? like a sequence, foreman .qcif, yhat has raw individual frames , and each frame size is 176x144. then i want to write the frames individually. Any help? Thnaks ...

How Is Saved Selection Available to Another Opened Image?
I have an image. I select an area with the magic wand and save the selection. I also save the .psd file so that the selection will be available later. Now, here is the question: How can I have this selection available for anothe image that I have opened with File/Open? I have not closed the previous image. Thanks! maria On 2/11/06 12:53 AM, in article ekuqu15sh4iu8j1i7ro47h4ieepahjo5o7@4ax.com, "maria" <maria> ranted: > I have an image. I select an area with the magic wand and save the > selection. I also save the .psd file so that the selection will be > available...

prompting to "save as" rather than opening images
I have pages that I want a particular person to download dozens of images. Instead of opening each image separately with right-clicks, I want to be able to have them simply click, and the program will offer to save all the images to a location they specify. Can I do that with JavaScript? "Richard Hollenbeck" <richard.hollenbeck@verizon.net> wrote in message news:GRlMb.7388$sb3.1902@nwrddc01.gnilink.net... > I have pages that I want a particular person to download dozens of images. > Instead of opening each image separately with right-clicks, I want to be > able to...

Adjusting the Exposure Control when opening RAW images in PS CS?
I am floundering trying to edit RAW files in Photoshop CS. My current issue/question is the correct setting of the exposure control. Should I set the control so that the photo looks to be correctly exposed in the preview screen, or should I set it so that none of the color channels are being clipped (at least significantly clipped)? If I do the latter I can end up with some mighty dark images, which normally require more significant editing later in PS. If I do the former, then one or more colors can be clipped. The clipping is apparent if I open Layers later during editing, but not necess...

Saving image with open Project Editions Browser causes OmniBase problem
I've observed that an open Project Editions Browser becomes unusable after saving the image. It appears that the problem is that the Source Tracking System has a transaction that is referencing an OmniBase instance that is cleared as part of saving the image. Now that I know what is causing the Browser to be unstable I can work around it but it would be nice if StS and OmniBase would play better with the save image process. James Foster ...

Time in seconds to open raw image in Adobe CS/CS2 -- Computer Speed
I am getting tired of what seems to be the excessive times (in seconds) for a 14MB RAW file to open in CS2, and am considering building a newer faster PC. However, before I do this I would like to know just what kind of real world speed gains I might be able to actually realize. On my current home-built (AMD Athlon 64 3200+) it takes 6 seconds to open a full size 14.7MB RAW image in CS2, and 7.5 seconds to open the same image at the reduced 6MB size. For a 9MB NEF (Nikon RAW) file the times are respectively 5.2 seconds and 4.25 seconds. Times are measured when I hit open to when the image ...

Saving image on clipboard to file, or a contextual menu with "Save image to file"?
I've found myself having to save an image from the clipboard to a file a few times lately and have done the following: 1) Open GraphicConverter 2) Create a new canvas of large size 3) Pasting the image 4) Cropping the canvas down to the image size 5) Saving I'd really like to do this in fewer steps. Is there an application or something that will let me save directly from the clipboard to a file? (I don't care what image format it saves as.) What about a contextual menu? What about a different application that will let me streamline the above process? Thanks! -Lotofun In ar...

Saving 2 images as desktop image?
How do you save 2 pictures as one image so you can put it on the desktop? For example, if I wanted 2 pictures side by side, saved as a jpeg, so I could use it as the desktop. I know there must be a way of doing it but can't figure it out. Thanks. ------------- To send email, replace "antispam" with "sympatico" Pidge wrote: > How do you save 2 pictures as one image so you can put it on the > desktop? For example, if I wanted 2 pictures side by side, saved > as a jpeg, so I could use it as the desktop. The technique is called montage, often mis-called colla...

converting images and saving by the save name
Dears I want to modify an image and save it by the same name and did the following, but it does not work? What should I do? [f,p]=uigetfile('*.tif'); name=[p,f]; I=imread(name); D=imadjust(I); % saving save(D,f) toja <tojadeb@yahoo.com> writes: > I want to modify an image and save it by the same name and did the > following, but it does not work? What should I do? > > [f,p]=uigetfile('*.tif'); > name=[p,f]; > I=imread(name); > D=imadjust(I); > > % saving > save(D,f) In what way doesn't it work? What is the error message? If none, ...

New, Open, Save, Save As, Close
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or less complex technical calculations, several input variables. I would like to equipp the starting panel with the usual New, Open, Save, Save As, Close etc. menus (like in Excel, or Word, etc.) What is the best way to accomplish Save, or Save As? Should be the variables behind the entry fields be written to a binary file, or can the forms be saved directly with all the controls and it contents to a fil...

How to save an image created from multiple images?
Ok, this is my problem: I have succesfully created an image by pasting smaller images into area, created with canvas method: >>> canvas = Canvas(win, width=canvasX, height=canvasY, background='white') """ Then I add images to picture using line below """ >>> canvas.create_image(ax, yy, anchor='nw', image=testi) So, I got the image i wanted. How can I now save that picture as an jpeg? ...

save a overlay of Pcolor over image as image
I use Matlab to analyse images. I plot the results in a colors over the images using Pcolor. This works fine and gives nice pictures but I would like to safe the image with the overlay of Pcolor plot results as an image with the same resolution as the initial image. I can plot both in a figure and use getframe, but than I do not get the original resolution. Beside I don't want to plot a figure each time, but save the results directly to an image file. Does somebody knows how to solve this problem? thank you! Rik-Jan Lemmen ...

Vuescan: Read raw and save-as raw?
I already know how to tell Vuescan (8.4.52) to save a 'raw' file to disk and then to read that file and do some processing. However, I have been unable to figure out how to do #3 in the following workflow: 1. Scan and save raw file (64 bit RGBI) without any processing. 2. Read the raw file and only apply dust and grain filters 3. Save the processed file as a raw file When I tell Vuescan that the input is coming from a file (instead of the scanner) then the output tab does not give me the option to save as a raw file. I tried setting "Raw output with" = Scan ...

Saving 2 images as desktop image?
How do you save 2 pictures as one image so you can put it on the desktop? For example, if I wanted 2 pictures side by side, saved as a jpeg, so I could use it as the desktop. I know there must be a way of doing it but can't figure it out. Thanks. ------------- To send email, replace "antispam" with "sympatico" Pidge wrote: > How do you save 2 pictures as one image so you can put it on the > desktop? For example, if I wanted 2 pictures side by side, saved > as a jpeg, so I could use it as the desktop. The technique is called montage, often mis-called colla...

Read Image from RAW (image data before demosaicking)
Hello, Does anyone know how I can open a RAW image (preferably .RWL taken from a Leica camera) such that I can see the data straight from the sensor before color interpolation? For example, for pixel 1,1 I expect to see a value representing the Green, but a zero for Red and Blue... Any help would be greatly appreciated. Thanks! "Jack Branning" <jbr.nospam@nospam.com> wrote in message <i0ak93$480$1@fred.mathworks.com>... > Hello, > > Does anyone know how I can open a RAW image (preferably .RWL taken from a Leica camera) such that I can see the data...

Downloading image from URL not saving entire image?
I have an image proxy script I use to retrieve images from a remote server and store locally on the first request. On the second request (and all requests after) the image is returned from the local machine. This has been working fine, but now I am using images that are 4+ MB in size and the script is only saving a small portion of the image rather than the entire thing. Is there a limit to the size of the Image object? ------------- script snippet below ------------- if (! is_file($this->localDir . "/" . $image)) { $image_remote = @imagecreatefromjpeg($this->remoteUrl . ...