matlab中的视频聚类(video clustering in matlab)
我正在尝试编写本文的代码: “在自动视听视频结构的无监督挖掘中改进群集选择和事件建模”
它的一部分是关于视频集群:
“视频流基于颜色直方图被分割成镜头,以检测突然变化和渐进过渡。每个结果镜头由一个关键帧汇总,在镜头中间拍摄,依次表示为带有8个箱子的RGB直方图自下而上的聚类依赖于使用Ward的连接的512维颜色直方图之间的欧几里德距离。“
我已经完成了这个并达到了一系列这样的数字:
1.0e + 03 *3.8334 3.9707 3.8887 2.1713 2.5616 2.3764 2.4533
在执行树形图部分后,结果变为:
174.0103 175.0093 176.0093 177.0093 178.0093 178.0093 179.0093
但根据文章作者给出的玩具示例,结果应该是如下间隔:
{47000,50000},{143400,146400},{185320,187880},{228240,231240},{249440,252000},{346000,349000}这里有什么问题?i'm trying to write the code of this article:"Improving Cluster Selection and Event Modeling in Unsupervised Mining for Automatic Audiovisual Video Structuring"
a part of the it is about video clustering:
"The video stream is segmented into shots based on color histograms to detect abrupt changes and progressive transitions. Each of the resulting shot is summarized by a key frame, taken in the middle of the shot, in turn represented as a RGB histogram with 8 bins per color. Bottom-up clustering relies on the Euclidean distance between the 512-dimension color histograms using Ward’s linkage."
i've done this and reached to an array of numbers like this:
1.0e+03 *3.8334 3.9707 3.8887 2.1713 2.5616 2.3764 2.4533
that after performing the dendrogram part, the result became:
174.0103 175.0093 176.0093 177.0093 178.0093 178.0093 179.0093
but according to a toy example that was given by authors of the article the result should be intervals like:
{47000, 50000}, {143400, 146400}, {185320, 187880},{228240, 231240}, {249440, 252000}, {346000, 349000} what is wrong here?
原文:https://stackoverflow.com/questions/18035978
最满意答案
代码逻辑可能是正确的,
但有一个错误,你通过
Thread.sleep(int)
事件调度线程必须将
Thread.sleep(int)
更改为Swing Timer然后第一步是JButton#setEnabled(false) ,其余代码应该从Swing Timer调用的Swing Action中触发
I got this working by running task to be performed on click of button on new thread.
相关问答
更多-
透明JButton(Transparent JButton)[2024-04-08]
button.setOpaque(false); button.setContentAreaFilled(false); button.setBorderPainted(false); button.setOpaque(false); button.setContentAreaFilled(false); button.setBorderPainted(false); -
JButton的问题(Issue with JButton)[2023-08-05]
指着月亮! import java.awt.Image; import javax.swing.*; import javax.imageio.ImageIO; import java.net.URL; class TestRolloverIcon { public static void main(String[] args) throws Exception { URL url1 = new URL("http://pscode.org/media/citymorn1.jpg ... -
单击JButton时出错 - 未执行ActionEvent(Error when clicked a JButton - ActionEvent is not performed)[2023-05-06]
当用户单击确认按钮时程序“停止”的原因是程序正在等待命令行上的输入。 具体来说,您的input变量绑定到System.in (即命令行)。 您只需在命令行输入答案,按Enter键即可继续执行程序。 OTOH,我怀疑在使用GUI时使用命令行并不是你想要的。 相反,您可以添加输入字段(例如JTextBox)。 The reason your program "stops" when the user clicks the confirm button is that the program is waiting ... -
but= new JButton[4]; 这只为四个数组元素分配空间 ; 每个元素都初始化为null ,这是JButton对象之类的引用类型的默认值 。 but[0] , but[1] , but[2] , but[3]都是null 。 你应该像这样初始化它们: but[0] = new JButton(); //or whatever. but= new JButton[4]; This only allocates space for four array elements; each el ...
-
回顾JButton值(Recalling JButton value)[2024-01-17]
阅读以下代码,你会得到一些想法...... 我使用StringBuilder在每次使用StringBuilder.append(JButton.getText()。toString())单击它们时存储Button的值。 这是在JButtons的actionPerformed方法中完成的。 然后最后在完成按钮actionPerformed方法中,我已经将字符串构建器保存在数组中。 PS我知道你正在使用16个JButton我只是简单地使用了3个... import javax.swing.*; import j ... -
在更改组件的可见性或添加或删除组件之后,您需要在组件的容器上调用revalidate()和repaint() (我相信这是示例中的contentPane,至少它是第二个窗口)重新布置其组件,然后重新绘制自己以摆脱其窗口上的脏区域。 btn_create.setVisible(false); getContentPane().revalidate(); getContentPane().repaint(); 已经说过,通过不向用户翻转窗口而只使用一个JFrame并通过CardLayout交换JPanel视图 ...
-
问题不在于编辑。 SPACE键击也不会转发到第一列中的默认编辑器。 问题是JTable为SPACE键定义了一个Action,因此在它有机会传递给编辑器之前就被截获了。 在我的博客中搜索Key Bindings条目,您将在其中找到列出JTable的所有默认Key Bindings的程序。 被调用的Action被称为“addToSelection”,所以我不确定为什么它的工作方式不同,具体取决于行选择。 无论如何,一个解决方案是删除此操作: InputMap im = table.getInputMap(JTa ...
-
您需要使用ActionListener与MouseClickListener。 从技术上讲,用户确实点击了您的按钮。 :) http://download.oracle.com/javase/tutorial/uiswing/events/actionlistener.html You need to use an ActionListener vs a MouseClickListener. Technically, the user did click in your button. :) http:/ ...
-
代码逻辑可能是正确的, 但有一个错误,你通过Thread.sleep(int) 事件调度线程 必须将Thread.sleep(int)更改为Swing Timer 然后第一步是JButton#setEnabled(false) ,其余代码应该从Swing Timer调用的Swing Action中触发 I got this working by running task to be performed on click of button on new thread.
-
您可以使用setVisible(boolean)来更改可见性,以下是基于已发布代码的示例: import java.awt.*; import javax.swing.*; import java.awt.event.*; public class test extends JFrame { public static void main(String[] args) { new test(); } public test() { super("U ...