Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2024, 02:51:02 02:51


Login with username, password and session length


Pages: [1]
Print
Author Topic: help needed about matlab  (Read 2927 times)
0 Members and 1 Guest are viewing this topic.
tokyo_emb
Junior Member
**
Offline Offline

Posts: 90

Thank You
-Given: 144
-Receive: 44


« on: February 25, 2010, 08:19:52 20:19 »

guys,now a days i am doing a project on automatic traffic control system depending on cars load.in the roads where the no of cars will be more that signal will remain open for longer time compared to less amount of car's road.i am trying to develop it with matlab image processing.matlab already gave some tutorial about vehicle detecting(only for bright colored car)...so my work is little less.now i am facing problem in multiframe Acquisition.i am writting the bellow code:-
Code:
% Create video input object. 
vidobj = videoinput('winvideo', 1);
vidobj.FrameGrabInterval = 5;
set(vidobj, 'TriggerRepeat', inf);
set(vidobj, 'FramesPerTrigger', 50);
start(vidobj)
%numAvail = vidobj.FramesAvailable
framesavailable = get(vidobj, 'FramesAvailable')
in both the time i am getting
numAvail=0
framesavailable=0

so,i cannt grab the multiframes but can take snapshot easily.can take multiple shot through my youcam software.i am getting the input from my webcam.some data of my webcam is given bellow:-
imaqhwinfo

ans =

    InstalledAdaptors: {'coreco'  'winvideo'}
        MATLABVersion: '7.6 (R2008a)'
          ToolboxName: 'Image Acquisition Toolbox'
       ToolboxVersion: '3.1 (R2008a)'

imaqhwinfo('winvideo')

ans =

       AdaptorDllName: [1x81 char]
    AdaptorDllVersion: '3.1 (R2008a)'
          AdaptorName: 'winvideo'
            DeviceIDs: {[1]  [2]}
           DeviceInfo: [1x2 struct]

device1 = hwInfo.DeviceInfo(1)

device1 =

DefaultFormat: 'YUY2_160x120'
    DeviceFileSupported: 0
             DeviceName: 'USB Video Device'
               DeviceID: 1
      ObjectConstructor: 'videoinput('winvideo', 1)'
       SupportedFormats: {1x5 cell}

      
    someone would help me how can i get multiframe in matlab with my this webcam?
« Last Edit: February 27, 2010, 05:32:25 05:32 by tokyo_emb » Logged
tokyo_emb
Junior Member
**
Offline Offline

Posts: 90

Thank You
-Given: 144
-Receive: 44


« Reply #1 on: February 27, 2010, 08:27:28 08:27 »

at last got the solve...... my webcam dont have any properties called 'FramesAvailable'.but it works with 'FramesAcquired' property.so instead of 'FramesAvailable' when i am using 'FramesAcquired' it is giving me multiframe output.by the way thank you all.
Logged
tokyo_emb
Junior Member
**
Offline Offline

Posts: 90

Thank You
-Given: 144
-Receive: 44


« Reply #2 on: February 27, 2010, 12:44:05 12:44 »

i am trying to get frames from webcam in one second two frames.and save each frame in a separate variable.can anyone helo me about the code for that?when i am using multiframe acquisition then 30frames or 40frames are saved in one matrix.so i am having problem to save frames of 30minits or 60minits video captured by webcam.then the matrix becoming so large to handle all the frames.i got some little tips of help from an user...i cannot complete the code.....the code is given bellow:-
Code:
vidobj = videoinput('winvideo');
set(vidobj, 'FramesPerTrigger', 30);
start(vidobj)
for i = 1:20
    image_name = 'images\im_';
    filename = sprintf('%s%d.jpeg',image_name , i );
    imwrite(A,filename,'jpeg');
end
    stop(vidobj);
  

here i am not finding what i should use instead of A in imwrite().i think that gonna save multiple snapshot from a continious webcam input.....thanks for your help in advance.
« Last Edit: February 27, 2010, 12:51:09 12:51 by tokyo_emb » Logged
tokyo_emb
Junior Member
**
Offline Offline

Posts: 90

Thank You
-Given: 144
-Receive: 44


« Reply #3 on: February 27, 2010, 05:27:36 17:27 »

sorry for interruptiing you guys.but atlast it is solved also.
Code:
vidobj = videoinput('winvideo');
set(vidobj, 'FramesPerTrigger', 30);
set(vidobj,'TriggerRepeat',30);
vidobj.FrameGrabInterval = 5;
start(vidobj)
for i = 1:10
    image_name = 'im_';
    filename = sprintf('%s%d.jpeg',image_name , i );
    current_img=getsnapshot(vidobj);
    imwrite(current_img,filename,'jpeg');
end
    stop(vidobj);

actually the files which is going to save is not shown in the workspace.so its little bit confusing.so for work with those frame again matlab needs to read them in their workspace.thank you all....
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC