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 209998 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

8 Replies
1577 Views

Similar Articles

[PageSpeed] 54

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 (2304)
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:

to save images in matlab
hi...i'm doin project on face recognition.... u see i have a database of stored faces and this project basically determines whteher a testimage is a face at all; if its is....whether it is there in the database or not; or if its not there...i've to save it in the stored database.. i need the code for that(saving the new image in the database) Please treat this as very urgent.... ...

Saving image matlab
I am facing is that I need to save the image and perform histtogram equaliuzation on it but I am getting an error on saving it as (I2, []) Also I need to perform histogram equalization on 32*32 blocks of the image.. is this the right approach or is there a better way... I3=histeq(I2, [32 32]) This is my code: I = imread('029_2_4.bmp-polar.jpg'); backApprox = blkproc(I,[16,16 ],'mean(x(:))'); backApprox = (backApprox)/255; % Convert image to double. %figure, surf(backApprox); %set(gca,'ydir','reverse'); % Reverse the y-axis. backApprox256 = imresize(backAppr...

what does it mean 'to save a part of image as a variable' in matlab? Image processing and visualization help
I have my point spread function image and I need to calculate the point spread fucntion and modulation transfer function. in an article it was written you need to visualize your psf .for visualizing your psf in a certain plane you should cut a rectangle of your psf and save it as a variable. next take the cross section of the bead for each frame and assemble it into its own image. so how am i suppose to calculate the value for psf after this then? I am not sure what exactly this means, could someone explain abit? and what does it mean to save the image as a variable? On May 19, 7:01=A0am, ...

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 open hyperspectral image in matlab
I want to open a hyperspectral image in matlab. Please help me how to open it in matlab. I need the corresponding matlab code. Thanks Can you tell us more about what format this image is in? Its file extension might give you an idea. One of these functions might be useful: IMREAD and MULTIBANDREAD. Ashish Uthama <first.last@mathworks.com> wrote in message <i789at$gpr$1@fred.mathworks.com>... > > Can you tell us more about what format this image is in? Its file > extension might give you an idea. > One of these functions might be useful: IMREAD and MULTIB...

Opening and saving quickly in Matlab
Hi all, I have a process in Matlab that is doing what I want it to do, however I want to add in one more thing to make it better. Not sure if I can do it though!! Basically, I'm loading in an image (124x163x3 pixels), from this image some processing is being carried out on my image. I then want to save the image (with a slightly different name) to the same directory. So if my original image is image 1.png the processed version should become image 1_new.png. I can only see how to save the full thing which includes the axis etc. Also, I will have many images (image 1 - image 1000), is ther...

Saving MATLAB images with a colorbar
Hello everyone, I ran into difficulty saving images with a colorbar, till now I used to plot the images with IMAGESC, add the colorbar and PRINT the plots to a '.jpg' file. This method, however, is time consuming since making and displaying the plots takes time. Is there a more effecient method for writing the images? I tried IMWRITE but it also doesn't save the image with a colobar Thanx Amit.Weinberg@gmail.com wrote in message <1189053677.761189.324680@o80g2000hse.googlegroups.com>... > Hello everyone, > > > I ran into difficulty saving images with a c...

reading raw images in Matlab
Hi, I wish to read "RAW" Images in Matlab. I believe there is a function which allows me to do so after I feed in correct header information which I have. I am aware of imread and fread function but there is function specifically written for this. Nipun "nipun patel" <nipunREMOVECAPSpatel@gmail.com> writes: > Hi, > I wish to read "RAW" Images in Matlab. I believe there is a function > which allows me to do so after I feed in correct header information > which I have. > > I am aware of imread and fread function but there is function >...

Save a Colored Image in MatLab
Hi my name is Link and I am trying to save an colored image. I want to save a colored image using MatLab. Below is a simple setup that I think should work. It does not work because the image is saved in black and white. Please tell me why it doesn't work and how to save a colored image. BTW: I have used jpg in this example, but have tried all the other options of image types that 'imwrite' will allow and they all save as black and white. I am willing to save as other image type, but would prefer jpg. %-----------------------------------------------------------------...

How to open JPEG2000 image in Matlab
Can anyone tell me how to open a JPEG2000 image in matlab. The JPEG2000 zipped file on the Central file exchange by peter is corrupted. Can any1 help me with this ...

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...

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...

How to save jpeg image in matlab?
Hi guys, thanks for dropping by.. Can someone advise me on how to save a jpg image in my matlab gui? I managed to capture an image inside an axis and i've got a separate button that says save. I just am not sure how to link the pic and the button together.. i need to be able to save the picture. Im new to matlab! Thanks so much for popping by.. Cheers Rina Rina wrote: > > > Hi guys, thanks for dropping by.. Can someone advise me on how to > save > a jpg image in my matlab gui? I managed to capture an image inside > an > axis and i've got a separate button th...

Saving Matlab images as GIF
Is there any way to save matlab figures as transparent gif images ? thanks, Neel Neel wrote: > > > Is there any way to save matlab figures as transparent gif images ? > > thanks, > Neel > > Yes, using the imwrite function. My choice would not be a gif.image though, I use png. /PB ...

Opening a Image in MatLAB GUI
If I open a Image in MatLAB GUI say for example the resolution is (2000 x 1500) it fit to the axes correctly Then after If I open another Image which has a different resolution (500 x 600), it doesn't fit to the axes and it uses the previous one(2000 x 1500) and display the (500 x 600) Image. So the difference is left as a white space How to tackle this problem? I want to fit to the axis always, If I open a the Images successively. Thank you, Best Regards, Paheerathan Paheerathan: Try this code I yanked from one of my m-files: % Display image array in a window on th...

How to save an array of images in matlab
Hi, I am pretty new to matlab. I have the following doubt. Suppose I have a variable img, then I can write into an image file using the command imwrite(img,'img1.png') However, in my program the variable img keeps changing, and I want to each time store it in different files Basically I would like to do for i=1:20 inwrite(img, 'img%d.png',i) end This would give me img1, img2 .... How do I acheive that? Thanks Viswanath "Kizhakkencherry " <viswanath.shanker@gmail.com> wrote in message <guuu4l$1jd$1@fred.mathworks.com>... > Hi, > > I 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...

Saving a matlab plot as an image
Hi everyone, I have a matlab related quetion which can seem simple but it's taking me ages. I am plotting an x and o over an image and I want to save that image whith the same size as the original one. This is what I mean: figure, imshow('data0002.tif'), hold on, figure,plot(Z{2}(1,:),Z{2}(2,:),'rx',hat_X{2}(1,:),hat_X{2}(3,:),'co') With this command I am able to do the plot, the problem is that after that I want to save that plot as tiff image which would be same size as data0002. I've done that before using imwrite but this time I am not sure ho...

Saving Matlab figure to image
If you are wanting to save a Matlab figure to a file or image, look into the "print" command. It is an old command used to send figures to printers. However, it could be very useful for outputting many figures to disk. I hope this helps some of you! On Apr 28, 1:54=A0pm, "James Harper" <jphar...@ucsd.edu> wrote: > If you are wanting to save a Matlab figure to a file or > image, look into the "print" command. =A0It is an old command > used to send figures to printers. =A0However, it could be very > useful for outputting many figures ...

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...

Opening several image folders in matlab
Hi, i am having a little problem and would like your help. i have a Folder called Images, and this folder contains 5 Folders, and each one of them contains also 10 folders, in which each one of them has about 500 images. i would like to open the folder Images in matlab, and with my algorithmus that i wrote i want to read all the images from each and every sub-folder. with this alg. i can read all images from one folder only. path2img = 'C:\Users\Desktop\Images\a1\1' img = dir(path2img) img = {img(~[img.isdir]).name}; but how can i load the main folder Images...

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...

MATLAB created image does not open in VC++
Hi, Need some pointers. I have created image data using MATLAB. This follows the ITU standard for JPEG images. 1. a file was created using fopen...say "myPic.jpg". 2. I wrote all headers,markers that were computed from a bmp---convereted--- to jpeg , were written into this file as the standard requires. 3. When i open this "myPic.jpg" in VC++ in Binary mode it does not show the Hex table correctly, nor does it show the picture. I have written Hex values into the file originally ,ie for SOS,SOF etc markers and data, huffman runlength etc. absolutely correctly as requir...

Web resources about - Open and Save *.raw images - comp.soft-sys.matlab

Twist Image
At Twist Image, we connect brands to people and people to brands. Let us show you what we mean.

Wikipedia:WikiProject Images and Media/Photography - Wikipedia, the free encyclopedia
This WikiProject 's primary aim is to encourage the contribution and improvement of photographs on Wikipedia. The project seeks to act as a focal ...

Holden’s bold plan to ‘de-bogan’ its image, appeal more to Chinese and Indian buyers
HOLDEN wants to “de-bogan” its image and appeal to a “modern Australia” — by targeting buyers of Chinese and Indian heritage.

Curved M7-like rear of HTC One M10 revealed in new leaked image
Our previous glimpses at the rumored HTC One M10 confirmed that the device takes heavy visual cues from the One A9. However, a new leaked image ...

Messages Image(2217315798)
Visit the post for more.

World Press Photos Name Top Images
The winners of the 59th annual World Press Photos contest have been announced, and as usual, the images are stunning. The contest attracted drew ...

Tiny, blurry pictures find the limits of computer image recognition
... have started to get really good at visual recognition. They can sometimes rival humans at recognizing the objects in a series of images. But ...

Maserati Levante shows Kubang inspiration in leaked images
Filed under: Geneva Motor Show , Maserati , Crossover , Luxury , Performance There are six leaked images of the new Levante CUV floating about, ...

Canonical to release Snappy Ubuntu Core Linux image for Samsung ARTIK IoT platform
... bloated. It remains to be seen if Windows 10 IoT will be embraced. Today, Canonical announces that it will be releasing an Ubuntu Core image ...

Ronda Rousey apologizes for sharing a Photoshopped image of herself: 'I'm appalled'
Ronda Rousey has issued an apology for posting a Photoshopped image of herself. The UFC fighter shared an image on Instagram after appearing ...

Resources last updated: 2/23/2016 11:04:37 PM