首页 \ 问答 \ 在java中使用opencv的图像直方图(Histogram of image with opencv in java)

在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
更新时间:2022-03-16 07:03

最满意答案

你需要在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().

相关问答

更多
  • 如果我是对的, public void onResponse(Call> call, Response> response) { textData.setText(String.valueOf(response.body())); Log.e("--success--", String.valueOf(response.body())); } 您在响应中阅读的正文是一个Model对象列表。 如果要获取标题和消息 ...
  • 你需要在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上)都会有所不同。 事实上,转换甚至可能会失败并触发实现特定的 ...
  • 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”之后 ...
  • 如果在添加完所有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 ...
  • 发生这种情况是因为您的第二个循环使用数组本身作为循环变量,覆盖最后一个值。 它应该是这样写的: 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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。