在java中使用opencv的图像直方图(Histogram of image with opencv in java)
我需要比较视频帧的直方图来检测场景变化。 我试图使用opencv 3.1.0的库Imgproc的方法
calcHist
与另一个问题(我在Eclipse中使用Java)中建议的这些参数:Imgproc.calcHist(matList,new MatOfInt(0),new Mat(),histogram,new MatOfInt(25),ranges);
有人可以解释一下所有参数的含义吗? 它编译但我不理解输出的含义,例如:
Histogram frame 0=[684213;291263;126683;78313;50989;30860;93541;76835;154938;55532;38304;93131;479949345;34612;34889;39014;25014;13223;14521;9534;5310;3310;2650;19581]
这个东西的意思是什么? 我该如何绘制直方图? 非常感谢你
I need to compare histogram of video's frame to detect scene changes. I have tried to use the method
calcHist
of the library Imgproc of opencv 3.1.0 with these parameters as suggested in another question (I'm working in Eclipse with Java):Imgproc.calcHist(matList,new MatOfInt(0),new Mat(),histogram,new MatOfInt(25),ranges);
Someone can explain me the meaning of all parameters? It compile but I don't understand the meaning of the output, for example:
Histogram frame 0=[684213;291263;126683;78313;50989;30860;93541;76835;154938;55532;38304;93131;479949345;34612;34889;39014;25014;13223;14521;9534;5310;3310;2650;19581]
what's the meaning of this? how can I plot the histogram? thank you very much
原文:https://stackoverflow.com/questions/36203220
最满意答案
你需要在
Champion
覆盖toString()
,因为对super.toString()
中的Mage.toString()
调用将调用Object.toString()
。You need to override
toString()
inChampion
as the call tosuper.toString()
inMage.toString()
will be callingObject.toString()
.
相关问答
更多-
获得奇怪的输出(Getting weird output)[2023-04-25]
如果我是对的, public void onResponse(Call- > call, Response
- > response) {
textData.setText(String.valueOf(response.body()));
Log.e("--success--", String.valueOf(response.body()));
}
您在响应中阅读的正文是一个Model对象列表。 如果要获取标题和消息 ...
-
为什么我会得到这个奇怪的输出?(Why do I get this weird output?)[2023-05-01]
你需要在Champion覆盖toString() ,因为对super.toString()中的Mage.toString()调用将调用Object.toString() 。 You need to override toString() in Champion as the call to super.toString() in Mage.toString() will be calling Object.toString(). -
这个奖金问题是一个诡计问题: printf("%d",(int)"printf("%d);被解析为 printf( "%d", ((int)"printf(") % d ); 字符串"printf("的地址被转换为int并且计算模数运算。由于d = 1 ,所以模数总是0 ,因此printf输出0 。 第二次调用只是打印转换为int的字符串的地址,这些地址会因环境而异,从一次运行到另一次运行(它在我的Mac上)都会有所不同。 事实上,转换甚至可能会失败并触发实现特定的 ...
-
奇怪的输出说明(Weird Output Explanation)[2022-01-08]
while(*ptr++); 当ptr指向传递的字符串的终止0时仍然递增ptr ,所以在它之后它指向0终止符。 以"Princess Leia"为参数, ptr增加14倍,所以返回值为14 - 1 = 13 。 打印的是 - 未定义的行为,因为解除引用ptr通常是未定义的行为,当它指向0结束符(它在这里)时,实际上是 - 传入的字符串以及0结束符后面的字节。 这里"%d\n" ,因为格式字符串"%d\n" happened to be stored just after “Princess Leia”之后 ... -
Java并发性:奇怪的输出(Java concurrency: weird output)[2022-06-01]
如果在添加完所有Runnable之前Runnable完成,CachedThreadPoolExecutor将重新使用线程。 如果发生这种情况,该线程的ThreadLocal也将被重用。 The CachedThreadPoolExecutor reuses threads if a Runnable finishes before you have added all Runnables. If this happens the ThreadLocal of that thread will also be ... -
您必须更改您发送的标题。 将您的内容类型设置为多部分数据。 HTTP / 1.1 200 OK \ r \ ncontent-type:multipart \ r \ ncontent-length:%ld \ r \ nConnnection:Close; 我认为这应该可以解决你的问题。 You have to changes the header that you are sending. Set you content-type as Multi-part data. HTTP/1.1 200 OK\ ...
-
好的,我今天有时间。 我运行了你的代码,它的工作非常好。 这是我的输出。 我使用的是最新的Arduino IDE,我的主板是Arduino Nano。 我认为垃圾值是由于旧的ide串行监视器。 只需使用升级的IDE。 Okay, I got time today. I ran your code and its working perfectly fine. Here is my output. I am using the latest Arduino IDE and my board is Arduin ...
-
奇怪的python数组输出(Weird output of python array)[2023-05-13]
发生这种情况是因为您的第二个循环使用数组本身作为循环变量,覆盖最后一个值。 它应该是这样写的: for x in arr: print x PS。 既然您刚刚开始使用Python:立即切换到Python 3! This happens because your second loop is using the array itself as the loop variable, overwriting the last value. It should have been written like ... -
您的代码没有任何问题。 问题是Excel将输出解释为一系列时间值。 因此,第一列1:8.035156值被读取为1分钟,8.035156秒。 如果查看实际数据输出,您会看到它与所需格式匹配。 要使Excel将值视为文本,您需要将它们格式化为 ="1:8.035156",="2:7.619141",="3:7.105469",="4:7.072266", 在CSV文件中。 前导=和周围的引号可以解决问题。 另请参阅停止Excel自动将某些文本值转换为日期 There is nothing wrong with ...
-
问题在于你的while循环附加到ip_address_list,它追加添加1个附加,循环然后再添加相同的ip,添加1追加,依此类推,这就是为什么你得到双打,只需移动第一个追加在循环之外修复它。 你的for循环真的是多余的,我在2行中做了同样的事情 import subprocess ipfirst=input("1st ip:") iplast=input("2nd ip:") currentip="144.122.152.13" ip_adresses_list=[] """this function ...