From: Saied on 20 Apr 2010 19:49 hi every one actually I need to save a lot of images using matlab but I don't know how. here is my code % READ THE AVI mov=aviread('timelapsevideo_1.avi'); % GRAB A SINGLE FRAME for i=1:5 figure; [im1,map] = frame2im(mov(i)); % SHOW THE FRAME figure(i); imshow( im1 ); imwrite(im1(i),'Frame1.bmp'); end
From: Nathan on 20 Apr 2010 19:57 On Apr 20, 4:49 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > hi every one actually I need to save a lot of images using matlab but I don't know how. > here is my code > % READ THE AVI > mov=aviread('timelapsevideo_1.avi'); > % GRAB A SINGLE FRAME > for i=1:5 > figure; > [im1,map] = frame2im(mov(i)); > % SHOW THE FRAME > figure(i); > imshow( im1 ); > imwrite(im1(i),'Frame1.bmp'); > > end try replacing: imwrite(im1(i),'Frame1.bmp'); with imwrite(im1(i),sprintf('Frame%d.bmp',i)); Is that your only problem? -Nathan
From: Saied on 20 Apr 2010 20:09 Nathan <ngreco32(a)gmail.com> wrote in message <caacae63-9839-48e9-ae63-2fdcd14f5497(a)w20g2000prm.googlegroups.com>... > On Apr 20, 4:49 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > > hi every one actually I need to save a lot of images using matlab but I don't know how. > > here is my code > > % READ THE AVI > > mov=aviread('timelapsevideo_1.avi'); > > % GRAB A SINGLE FRAME > > for i=1:5 > > figure; > > [im1,map] = frame2im(mov(i)); > > % SHOW THE FRAME > > figure(i); > > imshow( im1 ); > > imwrite(im1(i),'Frame1.bmp'); > > > > end > > try replacing: > imwrite(im1(i),'Frame1.bmp'); > with > imwrite(im1(i),sprintf('Frame%d.bmp',i)); > > Is that your only problem? > > -Nathan yah it solved my problem of saving alot of images but they are not saving correctly which mean the picture not shown ,I thought the problem from the colormap so I putted above it and I still have the same problem ,here is my code so u can understand more for i=1:1 figure; [im1,map] = frame2im(mov(i)); % SHOW THE FRAME figure(i); imshow( im1 ); colormap(map); <-----------------------------------------------here is the what I mean imwrite(im1(i),sprintf('Frame%d.bmp',i)) end Thanks man .
From: Nathan on 20 Apr 2010 20:24 On Apr 20, 5:09 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > Nathan <ngrec...(a)gmail.com> wrote in message <caacae63-9839-48e9-ae63-2fdcd14f5...(a)w20g2000prm.googlegroups.com>... > > On Apr 20, 4:49 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > > > hi every one actually I need to save a lot of images using matlab but I don't know how. > > > here is my code > > > % READ THE AVI > > > mov=aviread('timelapsevideo_1.avi'); > > > % GRAB A SINGLE FRAME > > > for i=1:5 > > > figure; > > > [im1,map] = frame2im(mov(i)); > > > % SHOW THE FRAME > > > figure(i); > > > imshow( im1 ); > > > imwrite(im1(i),'Frame1.bmp'); > > > > end > > > try replacing: > > imwrite(im1(i),'Frame1.bmp'); > > with > > imwrite(im1(i),sprintf('Frame%d.bmp',i)); > > > Is that your only problem? > > > -Nathan > > yah it solved my problem of saving alot of images but they are not saving correctly which mean the picture not shown ,I thought the problem from the colormap so I putted above it and I still have the same problem ,here is my code so u can understand more > for i=1:1 > figure; > [im1,map] = frame2im(mov(i)); > % SHOW THE FRAME > figure(i); > imshow( im1 ); > colormap(map); <-----------------------------------------------here is the what I mean > imwrite(im1(i),sprintf('Frame%d.bmp',i)) > > end > Thanks man . Note that the imwrite command has a MAP parameter... Try: imwrite(im1(i),map,sprintf('Frame%d.bmp',i)) -Nathan
From: Saied on 20 Apr 2010 20:45 Nathan <ngreco32(a)gmail.com> wrote in message <76e32902-0a40-4629-8b64-0e807d62eda9(a)p35g2000prf.googlegroups.com>... > On Apr 20, 5:09 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > > Nathan <ngrec...(a)gmail.com> wrote in message <caacae63-9839-48e9-ae63-2fdcd14f5...(a)w20g2000prm.googlegroups.com>... > > > On Apr 20, 4:49 pm, "Saied " <kezman_...(a)yahoo.com> wrote: > > > > hi every one actually I need to save a lot of images using matlab but I don't know how. > > > > here is my code > > > > % READ THE AVI > > > > mov=aviread('timelapsevideo_1.avi'); > > > > % GRAB A SINGLE FRAME > > > > for i=1:5 > > > > figure; > > > > [im1,map] = frame2im(mov(i)); > > > > % SHOW THE FRAME > > > > figure(i); > > > > imshow( im1 ); > > > > imwrite(im1(i),'Frame1.bmp'); > > > > > > end > > > > > try replacing: > > > imwrite(im1(i),'Frame1.bmp'); > > > with > > > imwrite(im1(i),sprintf('Frame%d.bmp',i)); > > > > > Is that your only problem? > > > > > -Nathan > > > > yah it solved my problem of saving alot of images but they are not saving correctly which mean the picture not shown ,I thought the problem from the colormap so I putted above it and I still have the same problem ,here is my code so u can understand more > > for i=1:1 > > figure; > > [im1,map] = frame2im(mov(i)); > > % SHOW THE FRAME > > figure(i); > > imshow( im1 ); > > colormap(map); <-----------------------------------------------here is the what I mean > > imwrite(im1(i),sprintf('Frame%d.bmp',i)) > > > > end > > Thanks man . > > Note that the imwrite command has a MAP parameter... > > Try: > imwrite(im1(i),map,sprintf('Frame%d.bmp',i)) > > > -Nathan I got the following error ??? Error using ==> imwrite at 378 Invalid colormap Error in ==> testCam at 12 imwrite(im1(i),map,sprintf('Frame%d.bmp',i))
|
Next
|
Last
Pages: 1 2 Prev: skeleton code Next: MathWorks Webinar: "Mixed-Signal Series: ADC and DAC Design"- 4/27/10 |