楼主: QueenieV
跳转到指定楼层
上一主题 下一主题
收起左侧

哈工大、哈工程被禁用MATLAB

 
全局:
不提高基础学科科研工作者待遇,喉咙永远被别人捏着。炒房没有用,双11卖了多少货没有用,搞共享单车也没有用(谁要自行车了)
回复

使用道具 举报

全局:
原来matlab是高大上的科技啊。大家赶紧跳mathworks
回复

使用道具 举报

🔗
yourdoraemon 2020-6-12 10:10:59 | 只看该作者
全局:
第一口吃肉 发表于 2020-6-12 03:56
所以现在matlab都用正版了?

不然 咋发 文章? 又不是写作业🤣
回复

使用道具 举报

🔗
zhang3x7 2020-6-12 10:27:12 | 只看该作者
全局:
kk_mich 发表于 2020-6-12 10:03
是的,同学。底层是c++写的,会比MATLAB慢

不是opencv-python自己的问题 而是你怎么使用的问题。在特定情况下python写的opencv会明显比C++的慢,我自己就出现过这种情况。当然我并不知道能不能跑过MATLAB,因为我用python+mathematica(处理符号)

Python is significantly slower than C++ with opencv, even for trivial programs.

The most simple example I could think of was to display the output of a webcam on-screen and display the number of frames per second. With python, I achieved 50FPS (on an Intel atom). With C++, I got 65FPS, an increase of 25%. In both cases, the CPU usage was using a single core, and to the best of my knowledge, was bound by the performance of the CPU. Additionally this test case about aligns with what I have seen in projects I've ported from one to the other in the past.

Where does this difference come from? In python, all of the openCV functions return new copies of the image matrices. Whenever you capture an image, or if you resize it - in C++ you can re-use existing memory. In python you cannot. I suspect this time spent allocating memory is the major difference, because as others have said: the underlying code of openCV is C++.

Before you throw python out the window: python is much faster to develop in, and if long as you aren't running into hardware-constraints, or if development speed it more important than performance, then use python. In many applications I've done with openCV, I've started in python and later converted only the computer vision components to C++ (eg using python's ctype module and compiling the CV code into a shared library).
回复

使用道具 举报

🔗
gjomhkb 2020-6-12 10:33:13 | 只看该作者
全局:
kk_mich 发表于 2020-6-12 10:03
是的,同学。底层是c++写的,会比MATLAB慢

能解释一下为什么c++会比Matlab慢吗?因为我知道的很多ml algorithm为了提高效率都是用c写的。这里非内行所以很好奇matlab为什么会快呢?是因为什么原理呢?
回复

使用道具 举报

全局:
zhang3x7 发表于 2020/06/12 10:27:12
不是opencv-python自己的问题 而是你怎么使用的问题。在特定情况下python写的opencv会明显比C++的...
可能我没说清楚,就算是用C++,也是比MATLAB慢
回复

使用道具 举报

🔗
zhang3x7 2020-6-12 10:39:49 | 只看该作者
全局:
kk_mich 发表于 2020-6-12 10:36
可能我没说清楚,就算是用C++,也是比MATLAB慢

thanks for the input.
回复

使用道具 举报

🔗
zhang3x7 2020-6-12 10:51:00 | 只看该作者
全局:
gjomhkb 发表于 2020-6-12 10:33
能解释一下为什么c++会比Matlab慢吗?因为我知道的很多ml algorithm为了提高效率都是用c写的。这里非内行 ...

1. LAPACK
https://www.mathworks.com/compan ... porates-lapack.html

2. MLK
https://en.wikipedia.org/wiki/Math_Kernel_Library

算法层面有根本差异 不是语言的原因
回复

使用道具 举报

全局:
gjomhkb 发表于 2020/06/12 10:33:13
能解释一下为什么c++会比Matlab慢吗?因为我知道的很多ml algorithm为了提高效率都是用c写的。这里非内行...
是这样的,算法大致是一样的。但是就象你发现的那样,MATLAB很多function是用C写的。总得的来说,C的速度会比C++快一些(一般低级语言快一些),除了某些特定的算法,比如sort。看单个算法方程,处理速度不会有明显的区别的,但是图形里面都是处理涉及到一系列不同方程的叠加,速度差就出来了。我的经验都是来自于deep learning的图形信号前处理,在处理极大图片的时候,MATLAB比C++写的opencv有优势。最后还有他们的优化,参数的优化在open source里面都是dirty work,但是商业软件愿意花大量时间实践不同的参数并进行优化。
回复

使用道具 举报

🔗
hayden 2020-6-12 11:07:57 | 只看该作者
全局:
gjomhkb 发表于 2020-6-12 10:33
能解释一下为什么c++会比Matlab慢吗?因为我知道的很多ml algorithm为了提高效率都是用c写的。这里非内行 ...

因为MATLAB叫MAT LAB,优化的好。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表