如何在 MATLAB 中创建用于播放、暂停、快进和快退视频的 GUI?

2024-03-30

我是 MATLAB 新手。我正在尝试创建一个 GUI 来逐帧播放、暂停、快进和快退 avi 视频。目前,我可以通过切换按钮播放和暂停视频,但是当我再次按下播放时,视频从零帧开始播放。我意识到我需要存储下次按播放时使用的帧号,但我不知道该怎么做。 任何帮助将非常感激。我意识到 MATLAB 中有一个 implay 选项,但我还有一些其他代码要实现,这些代码我已经做好了,这就是我想创建自己的 GUI 的原因。下面是暂停/播放视频的代码。

我最近的代码看起来像,

   function varargout = N_Play_Pause_2(varargin)
% N_PLAY_PAUSE_2 MATLAB code for N_Play_Pause_2.fig
%      N_PLAY_PAUSE_2, by itself, creates a new N_PLAY_PAUSE_2 or raises the existing
%      singleton*.
%
%      H = N_PLAY_PAUSE_2 returns the handle to a new N_PLAY_PAUSE_2 or the handle to
%      the existing singleton*.
%
%      N_PLAY_PAUSE_2('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in N_PLAY_PAUSE_2.M with the given input arguments.
%
%      N_PLAY_PAUSE_2('Property','Value',...) creates a new N_PLAY_PAUSE_2 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before N_Play_Pause_2_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to N_Play_Pause_2_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help N_Play_Pause_2

% Last Modified by GUIDE v2.5 29-Aug-2013 08:39:38

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @N_Play_Pause_2_OpeningFcn, ...
                   'gui_OutputFcn',  @N_Play_Pause_2_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
% End initialization code - DO NOT EDIT


% --- Executes just before N_Play_Pause_2 is made visible.
function N_Play_Pause_2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to N_Play_Pause_2 (see VARARGIN)

% Choose default command line output for N_Play_Pause_2
handles.output = hObject;
handles.VidObj = VideoReader('x05.avi');
handles.nFrames = handles.VidObj.NumberOfFrames;
handles.videoPos = 1; %Current video position. Starts at 1.

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes N_Play_Pause_2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = N_Play_Pause_2_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in togglebutton1.
function togglebutton1_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of togglebutton1
while get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
     if handles.videoPos >= handles.nFrames % Protect your code not to go be number of frames available
      break;
    end
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle
set(hObject,'Value',false);


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle
set(hObject,'Value',false);


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    handles.videoPos=handles.videoPos-1;     % Increment the stored position
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle
set(hObject,'Value',false);


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    handles.videoPos=handles.videoPos+10;     % Increment the stored position
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle
set(hObject,'Value',false);


% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    handles.videoPos=handles.videoPos-10;     % Increment the stored position
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle
set(hObject,'Value',false);

最终解决方案

所以,我还没有看到你更新了你的代码。查看您的代码相当容易,看起来您在显示图像后正在递增,因此如果您按下播放按钮,它将显示之前的图像

function varargout = N_Play_Pause2(varargin)
% N_PLAY_PAUSE2 MATLAB code for N_Play_Pause2.fig
%      N_PLAY_PAUSE2, by itself, creates a new N_PLAY_PAUSE2 or raises the existing
%      singleton*.
%
%      H = N_PLAY_PAUSE2 returns the handle to a new N_PLAY_PAUSE2 or the handle to
%      the existing singleton*.
%
%      N_PLAY_PAUSE2('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in N_PLAY_PAUSE2.M with the given input arguments.
%
%      N_PLAY_PAUSE2('Property','Value',...) creates a new N_PLAY_PAUSE2 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before N_Play_Pause2_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to N_Play_Pause2_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help N_Play_Pause2

% Last Modified by GUIDE v2.5 23-Aug-2013 13:50:30

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @N_Play_Pause2_OpeningFcn, ...
                   'gui_OutputFcn',  @N_Play_Pause2_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
% End initialization code - DO NOT EDIT


% --- Executes just before N_Play_Pause2 is made visible.
function N_Play_Pause2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to N_Play_Pause2 (see VARARGIN)

handles.output = hObject;
handles.VidObj = VideoReader('x05.avi');
handles.nFrames = handles.VidObj.NumberOfFrames;
handles.videoPos = 1; % Current video position, starts at first frame.

snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
imshow(snapshot),title(handles.videoPos);

% Choose default command line output for N_Play_Pause2
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes N_Play_Pause2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = N_Play_Pause2_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in togglebutton1.
function togglebutton1_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of togglebutton1

while get(hObject,'Value')  && handles.videoPos < handles.nFrames 
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(handles.videoPos);
    end
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle

% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value') && handles.videoPos>1
    handles.videoPos=handles.videoPos-1;     % Increment the stored position
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value') && handles.videoPos<handles.nFrames-9
    handles.videoPos=handles.videoPos+10;     % Increment the stored position
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle


% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value') && handles.videoPos>10
    handles.videoPos=handles.videoPos-10;     % Increment the stored position
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(handles.videoPos);
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle

看来你对编码有点困惑,我已经编辑了它并评论了你的错误。 它们之前是% COMMENT:

function varargout = N_Play_Pause(varargin)
% N_PLAY_PAUSE MATLAB code for N_Play_Pause.fig
%      N_PLAY_PAUSE, by itself, creates a new N_PLAY_PAUSE or raises the existing
%      singleton*.
%
%      H = N_PLAY_PAUSE returns the handle to a new N_PLAY_PAUSE or the handle to
%      the existing singleton*.
%
%      N_PLAY_PAUSE('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in N_PLAY_PAUSE.M with the given input arguments.
%
%      N_PLAY_PAUSE('Property','Value',...) creates a new N_PLAY_PAUSE or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before N_Play_Pause_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to N_Play_Pause_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help N_Play_Pause

% Last Modified by GUIDE v2.5 13-Aug-2013 16:26:32

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @N_Play_Pause_OpeningFcn, ...
                   'gui_OutputFcn',  @N_Play_Pause_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
% End initialization code - DO NOT EDIT


% --- Executes just before N_Play_Pause is made visible.
function N_Play_Pause_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to N_Play_Pause (see VARARGIN)

% Choose default command line output for N_Play_Pause
handles.output = hObject;
handles.VidObj = VideoReader('x05.avi'); % COMMENT: PAY ATTENTION, 's' was missing!
handles.nFrames = handle.VidObj.NumberOfFrames;
handles.videoPos = 1; % Current video position, starts at first frame.

% Update handles structure
guidata(hObject, handles); % Here you are saving the handles method at the hObject, this is the handle from your GUI figure.

% COMMENT: In the original code here, you would save guidata twice, you didn't need that, just save guidata after you make ALL ALTERATIONS IN IT!


% --- Outputs from this function are returned to the command line.
function varargout = N_Play_Pause_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in togglebutton1.
function togglebutton1_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of togglebutton1


while get(hObject,'Value')
    snapshot = read(handles.VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(double2str(handles.videoPos));            
    if handles.videoPos >= handles.nFrames % Protect your code not to go be number of frames available
      break;
    end
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle

读了你的问题标题我想,你还需要什么?你也想要沙漠吗?但开玩笑说,我错了,至少你有一些工作。

我不是 matlab 的图像专家,而是做a = 0在回调函数中(因此将视频重置为开始位置),您需要在 GUI 中保存视频位置。有多种方法可以做到这一点,一种方法是使用guidata, setappdata,或者通过参数将其传递给回调。你可以称它为变量videoPos并将其添加到handles您存储的结构guidata。还保存您的nFrames该结构中的变量。

快进将与您展示的相同,但不是这样做videoPos = videoPos + 1你会做videoPos = videoPos + n, where n是您想要快进的速度倍增器。要倒带,只需减少你的videoPos,或将其重置为 1,具体取决于您的需要。

Note:不要忘记添加棋子,你不会想要你的videoPos小于0或大于nFrames.


就功能而言:N_Play_Pause_OpeningFcn添加以下数据:

handle.VidObj = VideoReader('x05.avi');
handle.nFrames = VidObj.NumberOfFrames;
handle.videoPos = 1; % Current video position, starts at first frame.

% Update handles structure
guidata(hObject, handles); % Here you are saving the handles method at the hObject, this is the handle from your GUI figure.

然后,在您的活动中togglebutton1_Callback do:

% --- Executes on button press in togglebutton1.
function togglebutton1_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of togglebutton1


% You won't need this line anymore a=0;
% If you would like to retrieve the stored guidata you would do it here, by doing **handles=guidata(hObject);** but this is not needed, the handles data stored at the figure handle is already given to you as the third argument internally by the matlab!    

while get(hObject,'Value')
    snapshot = read(VidObj,handles.videoPos); % Here we use the stored video position 
    imshow(snapshot),title(double2str(handles.videoPos));            
    if handles.videoPos >= handles.nFrames % Protect your code not to go be number of frames available
      break;
    end
    handles.videoPos=handles.videoPos+1;     % Increment the stored position
end
guidata(hObject,handles) % Save the modifications done at the handles structure at the figure handle

请注意,您需要更新guidata每次退出方法时,以便保持更新并保存在图形句柄上。另一个细节是您传递给guidata不需要是图形句柄,而是它所持有的任何对象,如您创建的播放按钮。正如 guidata 帮助中所示:

GUIDATA(H, DATA) 将指定数据存储在图形的 应用程序数据。

H is a handle that identifies the figure - it can be the figure
itself, or any object contained in the figure.

现在只需添加更多按钮并使用togglebutton1方法,快进是相同的,但使用而不是+1,+n.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 MATLAB 中创建用于播放、暂停、快进和快退视频的 GUI? 的相关文章

  • 从 Java 运行 MATLAB 函数

    我在 MATLAB 中有一个 m 文件 我想从 Java 调用该文件 并以字符串或 Java 中的任何形式获取解决方案 这听起来很简单 但由于某种原因我无法让它发挥作用 我试过这个 matlab nosplash wait nodeskto
  • 如何每次使用按钮将数据添加到 MATLAB 中的现有 XLSX 文件?

    我有一个函数可以生成一些变量 例如分数 对 错 未回答 使用按钮调用此功能 问题是如何每次将函数生成的这些值添加 附加到 XLSX 文件中 或者 如何创建 MAT 文件以便可以添加它 可能的解决方案是什么 附加到 xls 文件所涉及的挑战是
  • 为什么 mex 文件中的 OpenMP 仅产生 1 个线程?

    我是 OpenMP 新手 我有以下代码 使用配置了 MSVS2010 的 Matlab mex 可以正常编译 计算机有 8 个可用处理器 我也使用 matlabpool 检查过 include mex h include
  • 垂直子图的单一颜色条

    我想让下面的 MATLAB 图有一个沿着两个子图延伸的颜色条 像这样的事情 使用图形编辑器手动完成 Note 这与提出的问题不同here https stackoverflow com questions 39950229 matlab t
  • 如何使用javascript将视频文件转换为字符串?

    我在 signalR 工作 我想通过将视频文件拆分为不同部分来将视频文件从一个客户端发送到另一个客户端 我已经通过分割图像源数据发送图像并在另一个客户端上接收该图像 document getElementById fileUpload ad
  • 如何编辑 QProgressBar 的样式表

    我无法在我的应用程序中编辑进度条的颜色 仅编辑文本颜色 pyhton 3 9 PySide6 QT Creator 7 0 2 Python应用程序 https i stack imgur com 6hKFI png import sys
  • mod_rewrite GUI?

    任何人都有用于开发 mod rewrite 规则的图形工具 理想情况下 它会显示重写管道 然后当给定 uri 实例时 会显示应用时的转换 让它们正确设置总是很痛苦 因此任何使其变得更容易的方法都会有所帮助 对于 htaccess 阅读 mo
  • Python 或 C 语言中的 Matlab / Octave bwdist()

    有谁知道 Matlab Octave bwdist 函数的 Python 替代品 此函数返回给定矩阵的每个单元格到最近的非零单元格的欧几里得距离 我看到了一个 Octave C 实现 一个纯 Matlab 实现 我想知道是否有人必须用 AN
  • 如何随着分辨率的变化自动调整大小和调整表单控件

    我注意到某些应用程序会更改控件的位置以尽可能适应当前的分辨率 例如 如果窗口最大化 则控件的设置方式应使整个 GUI 看起来平衡 是否可以使用 C 在 Visual studio 2010 中制作或实现此功能 Use Dock http m
  • 如何使用 C++ 禁用另一个进程中窗口上的关闭按钮?

    我需要从另一个进程禁用窗口上的关闭按钮 我有它的句柄hWnd我尝试这样做 DWORD dwCStyle GetClassLongPtr hWnd GCL STYLE SetClassLongPtr hWnd GCL STYLE dwCSty
  • Kivy 视频播放器无法在 Raspberry 3B+ 上运行

    我刚刚在我的电脑上安装了 Rasbian Stretch 和 KivyRPI3 我的应用程序工作正常 只是视频未播放 Rasbian kivy 和 gstreamer 都是最新的 我的应用程序和视频正在处理KivyPie 0 9b没有任何问
  • Matlab 图像数据的 hist 函数

    我是 Matlab 新手 我想制作自己的函数 与 imhist 显示图像数据的直方图 完成相同的工作 但我对此完全是新手 我不知道如何做开发这样的功能 我开始做一些东西 但它非常不完整 function output args myhist
  • Android-全屏视频视图

    我正在尝试使此 VideoView 以全屏模式显示 public class ViewVideo extends Activity private String filename private static final int INSER
  • 游戏GUI框架

    我目前正在重新修改游戏的用户界面 OpenLieroX http www openlierox net即 我正在寻找一个可以轻松创建 GUI 的库 框架 具体来说 这是我的要求 开源 游戏是 LGPL 的 遇到许可问题是我们最不想关心的事情
  • 以 2 为底的矩阵对数

    Logm 取矩阵对数 并且log2 取矩阵每个元素以 2 为底的对数 我正在尝试计算冯 诺依曼熵 它涉及以 2 为底的矩阵对数 我该怎么做呢 如果将 以 2 为底 的矩阵指数定义为B expm log 2 A 或者如果您类似地通过特征分解直
  • 如何从intellij项目视图中隐藏不必要的文件?

    给定一个示例 gradle 项目 其项目结构如下所示 正如你所看到的 有很多东西你实际上不需要在想法中看到 但你需要它们存在 我知道下面被忽略的文件 文件夹类型Editor File Types但这些正在影响库和项目 idea 会在各处忽略
  • 在matlab中,如何读取python pickle文件?

    在 python 中 我生成了一个 p 数据文件 pickle dump allData open myallData p wb 现在我想在Matlab中读取myallData p 我的Matlab安装在Windows 8下 其中没有Pyt
  • HTML5 视频:使用 Blob URL 流式传输视频

    我有一个 Blob 数组 实际上是二进制数据 我可以表达它 但是效率最高 我现在正在使用 Blob 但也许Uint8Array或者有什么会更好 每个 Blob 包含 1 秒的音频 视频数据 每秒都会生成一个新的 Blob 并将其附加到我的数
  • matlab中无限while嵌套在for循环中

    我想做一个while循环 嵌套在for在 Matlab 中循环以查找数据中不同对之间的距离 我的数据具有以下形式 ID lon lat time 1 33 56 40 89 803 2 32 45 41 03 803 3 35 78 39
  • 了解 JavaScript - 资源

    使用 StackOverflow 的微型 Digit Blog 功能进行描述here https stackoverflow com about 我想发布以下我刚刚看到的 我觉得很有趣的谷歌技术谈话视频 我一直在理解 javascript

随机推荐

  • C 指针的一元加法如何工作?

    我知道一元运算符 对数字加一 然而 我发现如果我对 int 指针执行此操作 它会增加 4 我系统上 int 的大小 为什么要这样做 例如 以下代码 int main void int a malloc 5 sizeof int a 0 42
  • 使用适用于 Android 的 Jack 编译器获取未知属性“类路径”

    我正在尝试用下一个编译我的项目杰克编译器 https source android com source jack html 我刚刚将 Android Studio 更新到 2 2 Beta 并将我的 gradle 插件更新到 2 14 1
  • 从 Javascript Transformers 访问 Mirth Connect REST API (Mirth 3.5.1)

    我正在努力从 mirth connect 通道的源 javascript 转换器访问 mirth connect Rest api 端点 我的目标是能够使用转换器中的 javascript 代码导出和导入通道组 我知道不可能使用 XHR 因
  • 使用元 http-equiv 标记进行重定向时,避免将页面添加到浏览器历史记录中

    我有一个网页 它使用以下命令重定向到所需的目标网址 我想避免第一页出现在浏览器历史记录中 特别是 在手机 Android iOS 等 中 我希望后退按钮可以跳过重定向页面 您有两个选择 要么使用真正的 HTTP 重定向 要么使用 JavaS
  • 制作一个 Angular *ngFor 绘制两列不同的数据[关闭]

    Closed 这个问题是无法重现或由拼写错误引起 help closed questions 目前不接受答案 我正在尝试创建一个 ngFor 指令将数据放入两列 而不是像往常一样只放入一列 我什至按照我在那里看到的例子进行操作 但根本不起作
  • 发送 AT 命令到 Android 手机

    我想向 Android 手机发送 AT 命令 我知道SDK不支持这个 但有两种解决方案 更改内核代码并发布你的新Android 看来很难 环回开启USB 我认为蓝牙是一样的 关于第二种解决方案 当您将手机连接到PC时USB电缆 你会看到一个
  • 如何在 TWIG 中使用转储?

    我简单地添加模板 index html twig dump product 我有错误 The function dump does not exist in AcmeStoreBundle Default index html twig a
  • Instagram Oauth2 隐式身份验证重定向到页面不可用,如果您输入错误的密码

    我正在使用 oauth2 Instagram 隐式流程在 Instagram 中登录 我使用的基本网址是这样的 这个网址向我显示了 Instagram 登录页面 我输入了用户和密码 如果正确 API 会将我重定向到redirect uri
  • 如何使用pid获取进程状态?

    如果我知道一个进程的 pid 我如何使用 Python 判断该进程是否是僵尸进程 你可以使用status特征来自psutil https github com giampaolo psutil import psutil p psutil
  • 将 python (pandas) Dataframe 写入 SQL 数据库错误

    我正在尝试将 python 数据框放入 MS SQL DB 但收到以下错误 FUNCTION def put to server df df is a pandas data frame server KORNBSVM04 MSSQLSER
  • MathJax `\\` 换行符不渲染。简单地显示`\\`

    我使用 MathJax CDN 当我将其放入我的网页时 Say P k n is the probability of By definition 所有数学都正确呈现 但是 显示为 而不是换行符 并且没有换行符 它只是在同一条线上继续 所以
  • 使用node.js pm2在虚拟环境中运行python脚本

    我想参考一下这个问题 https stackoverflow com questions 32127834 how to run run python script like pm2 for nodejs因为我确信有人会将其标记为重复项 我
  • extjs 中的级联组合框

    我想在 extjs 中做级联组合框 我必须组合框 课程组合框 xtype combobox emptyText Course id combo course displayField name valueField id store cou
  • 该项目不是基于 Gradle 的项目。如何从根目录打开项目?

    我被这个问题困扰有一段时间了 绞尽脑汁 我用谷歌搜索了这个答案here https stackoverflow com questions 23752077 no gradle file shown while importing proj
  • java中2组最接近的和

    我在解决这个问题时遇到一些问题 给定一个数组ints 将输入分为 2 组 使其总和尽可能接近 2 组的长度必须相等 或者如果输入是奇数长度 则一组可以比另一组多 1 然后先打印较低的总和 然后打印较高的总和 前任 输入 gt 4 6 17
  • 从序列化的 post_meta (PHP) 中的数组中过滤一些值

    我在 WordPress 中设置了自定义帖子类型 艺术家 我有一个插件可以序列化来自艺术家的元信息 并且我需要按通道过滤此信息 channel s 6 trance 它也在序列化元 show data 中 a 1 s 32 57fba1b1
  • 在c#中比较RGB颜色

    我正在尝试找到一种方法来比较两种颜色以找出它们的相似程度 我似乎找不到有关该主题的任何资源 因此我希望在这里得到一些指示 理想情况下 我希望得到一个分数来表明它们有多相似 例如 0 到 100 其中 100 相等 0 完全不同 Thanks
  • BeautifulSoup:从锚标记中提取文本

    我想提取 来自以下 src 的文本image tag and 锚标记的文本位于div类数据 我成功地提取了 img src 但在从锚标记中提取文本时遇到了问题 a class title href http www amazon com N
  • 上传文件限制

    如何限制上传文件 例如 如果数据库已有 5 个条目 则不应采用第 6 个条目 并展示您只能拥有 5 个文件 我的代码
  • 如何在 MATLAB 中创建用于播放、暂停、快进和快退视频的 GUI?

    我是 MATLAB 新手 我正在尝试创建一个 GUI 来逐帧播放 暂停 快进和快退 avi 视频 目前 我可以通过切换按钮播放和暂停视频 但是当我再次按下播放时 视频从零帧开始播放 我意识到我需要存储下次按播放时使用的帧号 但我不知道该怎么