我希望能够每秒在屏幕上拍摄一个特定区域的屏幕截图,并使用命令行和程序将文件命名为MMDDYYYYHH:MM:ss.我在考虑使用这样的脚本
for((i=0;i<1000;i++))
do
import -window root screenshot-$(date '+%d%b%y-%N').png
sleep 5m
done
Run Code Online (Sandbox Code Playgroud)
但我不知道访问程序的命令,以更改屏幕上的区域,并在保存到文件时限制图像质量.PS:我愿意使用不同的程序,如果它能工作的话.我正在使用Linux Ubuntu 10.04 64bit.
谢谢
我有一些工作代码,我改变了,但我似乎无法得到小时变量的数学.我想假期我需要很多食物,因为我想要一个空白.
## {{{ http://code.activestate.com/recipes/124894/ (r2)
from Tkinter import *
import time
import pygtk
import gtk
import time
class StopWatch(Frame):
""" Implements a stop watch frame widget. """
def __init__(self, parent=None, **kw):
Frame.__init__(self, parent, kw)
self._start = 0.0
self._elapsedtime = 0.0
self._running = 0
self.timestr = StringVar()
self.makeWidgets()
def makeWidgets(self):
""" Make the time label. """
l = Label(self, textvariable=self.timestr)
self._setTime(self._elapsedtime)
l.pack(fill=X, expand=NO, pady=2, padx=2)
def _update(self):
""" Update the label with elapsed time. """
self._elapsedtime = time.time() - self._start
self._setTime(self._elapsedtime) …Run Code Online (Sandbox Code Playgroud) 我正在尝试将多个音频文件与 3 秒交叉淡入淡出一起交叉淡入淡出,然后使用 sox 将它们合并到一个文件中。
我可以通过以下命令将多个文件连接在一起,但不确定如何在每个文件之间交叉淡入淡出:
sox $(ls /tmp/a*.wav | sort -n) /tmp/out/out.wav
Run Code Online (Sandbox Code Playgroud)
我可以使用下面的命令交叉淡入淡出两个文件,但不确定如何将连接多个文件的第一行与拼接/交叉淡入淡出的第二行组合在一起
sox 100hz.wav 440hz.wav out.wav splice $(soxi -D 100hz.wav),3
Run Code Online (Sandbox Code Playgroud)
我发现了这个问题,但答案对我不起作用。 使用 sox splice 淡入淡出一组音频文件
如何转换图像的RGB直方图以创建显示组合颜色以及正确颜色波长范围的直方图?
示例代码:
pkg load image
f=imread('/tmp/marbles.jpg');
f=uint8(f); %need to convert back to uint8 to show picture
%Split into RGB Channels
f_red = f(:,:,1);
f_green = f(:,:,2);
f_blue = f(:,:,3);
%Get histValues for each channel
[y_f_red, x] = imhist(f_red);
[y_f_green, x] = imhist(f_green);
[y_f_blue, x] = imhist(f_blue);
subplot (2,1,1); imshow(f);
subplot (2,1,2); plot(x, y_f_red, 'r', x, y_f_green, 'g', x, y_f_blue, 'b');
Run Code Online (Sandbox Code Playgroud)
示例图像以及代码生成的单独RGB直方图:
我试图让直方图看起来像下面的图像,但颜色从红色变为蓝色:
另一个图片示例:
PS:我使用的Octave 4.0与MATLAB非常相似.
我在octave/matlab的数组中有一行有数百列
example of a row:
540 6.28319 0 538.3 6.26573 0
Run Code Online (Sandbox Code Playgroud)
我希望它看起来像这样.每第3列将数据移动到下一行.
540 6.28319 0
538.3 6.26573 0
Run Code Online (Sandbox Code Playgroud)
我试过了:
tmp = [540 6.28319 0 538.3 6.26573 0];
a = reshape(tmp, [], 3); but that gives me
540 0 6.26573
6.28319 538.3 0
Run Code Online (Sandbox Code Playgroud)
我想要的
540 6.28319 0
538.3 6.26573 0
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?谢谢
我可以使用fft来获取加载的1秒音频文件的人,说"ahhhh"并重新创建它,频率,相位和幅度.我现在要做的是找出每个频率开始的位置以及它们在1秒音频文件中的结束位置并将数据放入数组中
示例:100hz从.23seconds开始到.34seconds,104.34hz从.35seconds开始,到.37seconds结束.
fft可以做到这一点还是我需要将整个程序转移到使用小波?还有八度音阶中的小波示例,说明如何做我想要完成的事情吗?
我正在使用来自repo的Ubuntu Linux 12.04和Octave 3.2.4
谢谢里克
我正在尝试运行一个程序,让它在ubuntu 12.04中启动一个外部linux程序.当它被输入终端窗口时该命令有效,但是当它被放入QT 4.8中点击的按钮对象时,我似乎无法使它工作.
这是在终端窗口中输入时有效的代码.(它访问网络摄像头并使用叠加层).我想要做的是每当按下一个按钮时,它将拍摄网络摄像头并使用日期和时间作为文件名保存图像)
gst-launch-0.10 v4l2src ! video/x-raw-yuv, width=640, height=480 ! timeoverlay halignment=right valignment=bottom shaded-background=true ! clockoverlay halignment=left valignment=bottom text="M/D/Y:" shaded-background=true time-format="%m/%d/%Y %H:%M:%S" ! autovideosink
Run Code Online (Sandbox Code Playgroud)
我正在关注文件
HOWTO:从Qt应用程序启动外部程序
http://www.qtforum.org/article/3079/howto-start-an-external-program-from-a-qt-application.html
但是当我在QT中将代码添加到按钮时
void runprg2::on_pushButton_clicked()
{
commandAndParameters<<"gst-launch-0.10 v4l2src ! video/x-raw-yuv, width=640, height=480 ! timeoverlay halignment=right valignment=bottom shaded-background=true ! clockoverlay halignment=left valignment=bottom text="M/D/Y:" shaded-background=true time-format="%m/%d/%Y %H:%M:%S" ! autovideosink";
}
Run Code Online (Sandbox Code Playgroud)
它不编译,我得到错误.这个教程是否正确?
请参阅错误
../test3/main.cpp: In function 'int main(int, char**)':
../test3/main.cpp:23:26: error: expected primary-expression before '<<' token
../test3/main.cpp:28:48: error: no matching function for call to 'QProcess::QProcess(QStringList&)'
../test3/main.cpp:28:48: note: …Run Code Online (Sandbox Code Playgroud) 如何在多维数组中找到具有相同值的所有单元格?
我可以部分地使用 result = A(:,:,1)== A(:,:,2),但我不知道如何也包括A(:,:,3) 我试过结果= A(:,:,1)== A(:,:,2)== A(:,:,3)但是当应该有1个正确答案时,结果将返回全0,其中数字8是位于阵列所有页面上的同一单元格中.注意:这只是一个测试,可以多次找到重复的数字和不同的数字.
PS:我使用octave 3.8.1,就像matlab一样
见下面的代码:
clear all, tic
%graphics_toolkit gnuplot %use this for now it's older but allows zoom
A(:,:,1)=[1 2 3; 4 5 6; 7 9 8]; A(:,:,2)=[9 1 7; 6 5 4; 7 2 8]; A(:,:,3)=[2 4 6; 8 9 1; 3 5 8]
[i j k]=size(A)
for ii=1:k
maxamp(ii)=max(max(A(:,:,ii)))
Ainv(:,:,ii)=abs(A(:,:,ii)-maxamp(ii));%the extra max will get the max value of all values in array
end …Run Code Online (Sandbox Code Playgroud) 我正在尝试测试位于 Octave 信号包中的 specgram 函数,但我对 specgram 的输入/输出变量有点困惑。我想要做的是能够将频谱图数据放入一个数组中,该数组将显示频率开始和停止时的频率和时间长度。
请参阅下面的示例代码:我试图让数组显示 t1 的长度为 7hz,t2 为 12hz,t3 为 2hz。我该怎么做呢?
我正在使用 ubuntu 12.04 和 Octave 3.2.4 以及信号包 1.0.11
% combines sig with spectra plot
clear all,clc,tic;
fs=1000;
t1=linspace(0,2*pi,fs/0.1); %need to round off no decimals
t2=linspace(0,2*pi,fs/0.3); %need to round off no decimals
t3=linspace(0,2*pi,fs/0.6); %need to round off no decimals
%Create signal in different arrays
y1=sin(7*t1);
y2=sin(12*t2);
y3=sin(2*t3);
%append arrays to test specgram
yt = [y1 y2 y3];
%plot(yt) %will show combined plot
%Spectrum section
yts=specgram(yt',20,500, 2,1); …Run Code Online (Sandbox Code Playgroud) 我正在尝试修剪 30+ 分钟文件的前 .010 毫秒。修剪命令会修剪它,但我得到的输出是 0.010 毫秒。我想要的是保留音频文件的结尾部分并去掉文件开头的 0.010 毫秒。
我尝试使用以下命令:
sox input.wav output.wav trim 0 .010
Run Code Online (Sandbox Code Playgroud)