Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for matlab to use its own camera in notebook?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "what is the method of matlab using notebook camera". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Built-in camera

This is an example of GUI, with the fig file linked at the end of the text.

Function varargout = camera (varargin)

Gui_Singleton = 1

Gui_State = struct ('gui_Name', mfilename,...

'gui_Singleton', gui_Singleton,...

'gui_OpeningFcn', @ camera_OpeningFcn,...

'gui_OutputFcn', @ camera_OutputFcn,...

'gui_LayoutFcn', [],...

'gui_Callback', [])

If nargin & & ischar (varargin {1})

Gui_State.gui_Callback = str2func (varargin {1})

End

If nargout

[varargout {1:nargout}] = gui_mainfcn (gui_State, varargin {:})

Else

Gui_mainfcn (gui_State, varargin {:})

End

Function camera_OpeningFcn (hObject, eventdata, handles, varargin)

Handles.output = hObject

Guidata (hObject, handles)

Function varargout = camera_OutputFcn (hObject, eventdata, handles)

Varargout {1} = handles.output

Function pushbutton1_Callback (hObject, eventdata, handles)

Axes (handles.axes1)

Vid1=videoinput ('winvideo',1,'YUY2_640x480')

VidRes1=get (vid1,'VideoResolution')

NBands1=get (vid1,'NumberOfBands')

Set (vid1,'ReturnedColorSpace','rgb')

Himage1=imshow (zeros (vidRes1 (2), vidRes1 (1), nBands1))

Preview (vid1,himage1)

This is the end of the content of "what is the way for matlab to use its own camera in notebook"? thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report