- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
你能解释一下 matlab im2double
函数的不一致行为吗?
基本上,这个函数作为输入给出了一个 int 矩阵 A,它规范化了 0...1 范围内的值:
例子:
I1 = reshape(uint8(linspace(1,255,9)),[3 3])
I2 = im2double(I1)
I1 =
1 96 192
33 128 223
65 160 255
I2 =
0.0039 0.3765 0.7529
0.1294 0.5020 0.8745
0.2549 0.6275 1.0000
但是现在如果我提供一个double矩阵:
I1 =
0.1000 0.2000
1.5000 2.2000
im2double
的结果是相同的矩阵 I1(因此没有任何归一化)。我能理解这种不一致的行为吗?
最佳答案
输入 help im2double
.前几行是
IM2DOUBLE takes an image as input, and returns an image of class double. If the input image is of class double, the output image is identical to it. If the input image is not double, IM2DOUBLE returns the equivalent image of class double, rescaling or offsetting the data as necessary.
所以行为是有意的。的确,当打开im2double.m
在编辑器中,您会看到
function d = im2double(img, typestr)
...
if isa(img, 'double')
d = img;
...
end
它是否直观,好吧,这是值得商榷的:)
无论如何,这种行为是有充分理由的。输入类型为 int8
你知道天花板是多少(255
)。使用该信息,您可以重新缩放输出 ( values/255
)。类似于 int16 ( values/65535
) 等。
然而,当你得到一个 double
,您不再有现实的上限。对于大多数double
值,values/realmax << realmin
,所以重新缩放没有什么意义。
你可以争辩说 255
将是一个很好的默认缩放比例,警告说如果 16 位数据是预期的,你应该给出一个额外的参数。但是好吧......这变得丑陋并且使功能不必要地复杂化。我个人可以理解 Mathworks 在此类事件中保留原件的决定。
关于image - Matlab im2double 规范化不一致?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14442085/
Skype 如何在 imo.im 和 im+ 服务中工作?有什么猜测吗? 我认为只有3种方式: 为服务器上的每个连接客户端运行多个 Skype 客户端副本 为服务器上的每个客户端从 SkypeKit
目前我正在开发 XMPP Google talk 聊天应用程序。该应用程序运行良好,通过分析来自特定聊天客户端的传入数据包(消息),我得到发件人的用户名(电子邮件)为“xxx@public.talk.
概要 给定一个带有可变参数模板构造函数的类型,它将参数转发给一个实现类,是否可以限制使用 SFINAE 转发的类型? 细节 首先,考虑带有通用引用的构造函数的非可变参数情况。这里可以禁用通过 SFIN
一组人气很高的很火的聊天表情包又来啦,热门又很有趣的聊天表情哦,这组表情包的聊天使用频率也是超级的高的哦。
我刚刚阅读了以下命令: taskkill /f /im something.exe 我读到了 /f强制关闭任务,但是 /im 做什么?做? 最佳答案 它告诉 taskkill下一个参数somethin
我曾遇到过有关此主题的不同问题,但是,没有一个能消除我对通知服务器客户端 IM 应用程序客户端的最佳方法的疑虑。 问题:整个问题是如何通知客户端应用程序更新。我已经见过以下方法: 客户端不断检查更新:
我正在尝试这段代码: im = Image.open("myimage") colors = im.getcolors() print colors 它返回“无”。所以我尝试了这个: im = Ima
我为打印网页编写代码。我正在使用 javascript 打印网页,代码如下 function print() { window.print(); } 我在 Button 的 onclien
我正在为 android 编写一个 jabber messenger,我想查看潜在聊天伙伴的电话联系人列表;) 无法弄清楚如何获取联系人的特定属性。获取显示名称不是问题,问题在于获取 IM 用户名。
我有这个 php 代码,其中有很多 mysql_query 和 or die ( mysql_error() ) 我如何减少 mysql_query 或 or die ( mysql_error()
我需要从我的应用程序连接到 IMS apn。当我尝试连接到 IMS apn 时,它会在我的手机上连接和断开连接,即使在 kitkat 上使用彩信也会发生同样的情况。有人可以帮我解决这个问题吗?这是代码
我正在创建一个社交网络网站,我需要一个 IM/聊天解决方案。 对话只是一对一的,用户只能与他们的 friend 聊天(即 Facebook 聊天 - 没有 channel ,没有房间......)。
我不是专业的程序员,我更多的是在业务方面,真的有一段时间没有编码了。问题是我正计划为手机开发一项新的 IM 服务,并且想知道在您看来,我应该在此过程中使用哪些最佳编程语言(聘请具有这些知识的人!)。
目前我只是每 3 秒查询一次服务器,看看是否有任何使用 NSURLRequest 等的新消息。如果有,它会将它们保存到数据库中,如果没有,则发送 NSNotificationCenter 通知,然后等
我正在尝试创建一个 IM 机器人,但我无法找到必要的资源。 更新 Imified 存在一个问题,使 gtalk 机器人无法在线显示(并且没有响应),它现在可以正常工作,所以我要关闭它。 这个tutor
我们有几个分布式开发人员在几个项目上一起工作。我们一直在使用 Skype 与所有开发人员进行聊天,它工作正常,除了一件事: 它真的会破坏我们复制并粘贴到聊天中的任何代码——尤其是 Python 中的空
我是 QuickBlox 聊天新手.. 尝试使用 Javascript SDK。但这总是抛出 Uncaught ReferenceError: QB is not defined 不知道我错过了什么。
我尝试在 C:\Users[name]\AppData\Roaming\Skype 中查找,发现一个名为“chatsync”的文件夹,其中有一些神秘的文件夹,其中的文件以 .dat 结尾。我几乎可以肯
2G 和 3G 已经在少数国家停用,其他国家也将很快停用。 LTE 模块的 VoLTE 功能对于能够通过 4G 进行调用而无需 2G/3G 回退是必需的。 native SMS 可以通过 2G/3G
我正在尝试cv2.imshow我的图像进行透视变换。 但是,我的图像很大,所以我看不到全貌: 如何解决这个问题? 下面是我的代码: import cv2 import os import numpy
我是一名优秀的程序员,十分优秀!