[問題] MATLAB已回收

看板MATLAB作者 (...)時間16年前 (2010/02/25 23:56), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
影像處理方面的問題 就是要把視訊攝影機擷取的圖片(不同時間同一地點) 儲存做圖片相減 以下是我的程式碼第一組程式碼是轉灰諧然後二值化 第二組就是兩張圖片的相減 該如何把兩組程式結合在一起呢? disp('按任何鍵開始照相') pause count=0 while count<2 obj = videoinput('winvideo'); photo = getsnapshot(obj); figure(1) image(photo); map=colormap ; i_str=int2str(count); filename=['im_a' i_str '.bmp'] %%存擷取後的原色照片(彩色) imwrite(photo,colormap,filename) ; %%若不存取直接轉灰階速度較快 %figure(2) %photo_g = rgb2gray(photo); %imshow(photo_g), colorbar %figure(3) %x = rgb2hsv(photo); %imshow(x) %figure(4) b=rgb2gray(photo); % RGB轉灰階 c=histeq(b,100); imshow(b),figure,imshow(c); % a圖(原始圖)、b圖(等化結果) imhist(b),figure,imhist(c); % c圖(原始圖)、d圖(等化結果) level = graythresh(photo); %取得標準差 bwimg = im2bw(photo,level); %二位元化 imshow(bwimg); %秀出圖片 這上面是我把圖片叫出來然後色彩轉灰階然後二位元化 A = imread('C:\Users\Desktop\potho1.jpg'); B = imread('C:\Users\Desktop\potho2.jpg'); Z = imsubtract(A,B); imshow(Z); 這是背景相減 還有我要如何定位我在攝影機上照出來的東西 (例如停車格) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 112.104.89.74

03/01 14:58, , 1F
感覺很亂,你這是兩組混在一起來還是??
03/01 14:58, 1F
文章代碼(AID): #1BXfsoD2 (MATLAB)
討論串 (同標題文章)
文章代碼(AID): #1BXfsoD2 (MATLAB)