利用MATLAB查詢我自己筆電的攝影機資訊:

>> info = imaqhwinfo('winvideo')

info =

       AdaptorDllName: [1x67 char]
    AdaptorDllVersion: '4.3 (R2012a)'
          AdaptorName: 'winvideo'
            DeviceIDs: {[1]}
           DeviceInfo: [1x1 struct]

>> info.DeviceInfo

ans =

             DefaultFormat: 'YUY2_160x120'
       DeviceFileSupported: 0
                DeviceName: 'USB2.0 Camera'
                  DeviceID: 1
     VideoInputConstructor: 'videoinput('winvideo', 1)'
    VideoDeviceConstructor: 'imaq.VideoDevice('winvideo', 1)'
          SupportedFormats: {1x4 cell}

>> info.DeviceInfo.SupportedFormats

ans =

  Columns 1 through 3

    'YUY2_160x120'    'YUY2_176x144'    'YUY2_320x240'

  Column 4

    'YUY2_640x480'

--------------------------------這是分隔線-------------------------------

info = imaqhwinfo('winvideo');
vid = videoinput('winvideo',1,'YUY2_640x480');

只支援YUY2格式@@, 不支援RGB格式..,

該說現在韌體越來越偷懶, 還是廠商為了省成本, 少付錢給韌體單位.??

查了google 大神, 只需要加一行指令, 可以省去自己轉換格式的麻煩

set(vid,'ReturnedColorSpace','rgb');

YUY2 to RGB converter

 

arrow
arrow
    全站熱搜

    me1237guy 發表在 痞客邦 留言(0) 人氣()