.NET Runtime uses third-party libraries or other resources that may be
distributed under licenses different than the .NET Runtime software.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
dotnet@microsoft.com
The attached notices are provided for information only.
License notice for ASP.NET
-------------------------------
Copyright (c) .NET Foundation. All rights reserved.
Licensed under the Apache License, Version 2.0.
Available at
https://github.com/dotnet/aspnetcore/blob/main/LICENSE.txt
License notice for Slicing-by-8
-------------------------------
http://sourceforge.net/projects/slicing-by-8/
Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
This software program is licensed subject to the BSD License, available at
http://www.opensource.org/licenses/bsd-license.html.
License notice for Unicode data
-------------------------------
https://www.unicode.org/license.html
Copyright © 1991-2020 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
License notice for Zlib
-----------------------
https://github.com/madler/zlib
http://zlib.net/zlib_license.html
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.11, January 15th, 2017
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
*/
License notice for Mono
-------------------------------
http://www.mono-project.com/docs/about-mono/
Copyright (c) .NET Foundation Contributors
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for International Organization for Standardization
-----------------------------------------------------------------
Portions (C) International Organization for Standardization 1986:
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in
ISO 8879, provided this notice is included in all copies.
License notice for Intel
------------------------
"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License notice for Xamarin and Novell
-------------------------------------
Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LI
【OpenCv基础】第六十三讲 LUT 图像灰度调整.zip
需积分: 0 201 浏览量
更新于2022-07-13
收藏 159.35MB ZIP 举报
在本讲【OpenCv基础】第六十三讲中,我们主要探讨了如何使用OpenCV库进行LUT(查找表)图像灰度调整。OpenCV是一个强大的计算机视觉库,支持多种编程语言,包括C#、Python和C++。下面将详细阐述LUT技术以及在OpenCV中如何应用这一技术进行图像处理。
LUT,全称Look-Up Table,查找表是一种快速的数值转换方法。在图像处理中,LUT常用于色彩空间转换、色调映射和图像增强等任务。它通过创建一个预定义的索引表,将输入像素的值映射到新的输出值,实现对图像的快速修改。例如,在灰度调整中,LUT可以将彩色图像转换为灰度图像,或者调整灰度图像的亮度和对比度。
在OpenCV中,我们可以通过`cv::LUT`函数来应用LUT。这个函数接受两个参数:一个是原始图像,另一个是LUT表。LUT表是一个二维数组,通常大小为256x1,因为8位无符号整型像素的最大值是255。对于每个输入像素,OpenCV会查找LUT表中的相应索引并返回对应的新值。
在C#中,我们可以这样使用LUT:
```csharp
using System;
using OpenCvSharp;
// 创建LUT表,例如将RGB图像转换为灰度
byte[] lut = new byte[256];
for (int i = 0; i < 256; i++)
{
lut[i] = (byte)(0.21 * i + 0.72 * i + 0.07 * i);
}
Mat src = ...; // 原始图像
Mat dst = new Mat(); // 输出图像
Cv2.Lut(src, lut, dst);
```
在Python中,代码类似,但语法稍有不同:
```python
import cv2
# 创建LUT表,例如将RGB图像转换为灰度
lut = [0.21 * i + 0.72 * i + 0.07 * i for i in range(256)]
src = ... # 原始图像
dst = cv2.LUT(src, lut)
```
而在C++中,我们可以这样操作:
```cpp
#include <opencv2/opencv.hpp>
// 创建LUT表,例如将RGB图像转换为灰度
uchar lut[256];
for (int i = 0; i < 256; i++)
{
lut[i] = static_cast<uchar>(0.21 * i + 0.72 * i + 0.07 * i);
}
cv::Mat src = ...; // 原始图像
cv::Mat dst;
cv::LUT(src, cv::Mat(1, 256, CV_8UC1, lut), dst);
```
以上代码片段展示了如何创建一个LUT表,然后用它来将RGB图像转换为灰度图像。LUT表中的计算公式是基于YUV色彩空间的灰度转换,其中0.21、0.72和0.07是R、G、B三个分量的权重系数。
需要注意的是,LUT的使用可以极大地提高处理速度,特别是在处理大量图像或实时视频流时。然而,它也有限制,例如不能处理浮点型像素和超过256级的索引。此外,LUT不适用于复杂的颜色校正或复杂的非线性转换。
通过学习和应用OpenCV中的LUT功能,我们可以更有效地实现图像灰度调整,以及其他各种图像处理任务,为图像分析和计算机视觉项目提供强大的工具。
激萌の小宅
- 粉丝: 249
- 资源: 78
最新资源
- 基于MPC的永磁同步电机非线性终端滑模控制仿真研究 matlab simulink 无参考文件
- 本科生课程设计封面.doc
- 基于动物群体行为优化的多椭圆检测算法及其在图像处理的应用
- 适用方向:基于LQR控制算法的直接横摆力矩控制(DYC)的四轮独立电驱动汽车的横向稳定性控制研究 主要内容:利用carsim建模,在simulink中搭建控制器,然后进行联合 实现汽车在高速低附着路
- 永磁同步电机模型预测电流控制Simulink仿真,单矢量控制,带一份报告介绍
- Sim-EKB-Install-2024-12-08
- 跟网型逆变器小干扰稳定性分析与控制策略优化simulink仿真模型和代码 现代逆变技术 阻抗重塑 双锁相环 可附赠参考文献(英文) 和一份与模型完全对应的中文版报告
- 冲压废料收集装置sw18可编辑全套技术资料100%好用.zip
- 【西门子1500吉利(柯马)汽车SICAR项目程序源码】西门子PLC&HMI整套设计资料(源码+注释) 西门子1500 PLC, TP1200触摸屏HMI 非常标准的汽车行业程序(SICAR),修改套
- C++ 基于opencv 4.5 仿halcon 基于形状的模板匹配 ,支持目标缩放以及旋转,支持亚像素精度,源码,支持C#
- 深度学习技术中混沌时间序列预测-基于LSTM、Transformer与CNN的多专家混合模型应用-含详细代码及解释
- 双馈风机惯性控制+下垂控制参与系统一次调频的Matlab Simulink模型,调频结束后转速回复,造成频率二次跌落 系统为三机九节点模型,所有参数已调好且可调,可直接运行,风电渗透率19.4% 风机
- iOS 7.0 ~ 16.7 DeviceSupport.zip
- 软件工程期末复习总结.xmind
- Kriging代理模型 克里金模型 回归预测 根据样本数据建立代理模型,进行预测 Matlab编程
- 高速永磁同步电机的电磁设计 高速永磁电机的体积远小于同等功率的中低速电机,且功率密度高,近年来得到了广泛的发展,在离心压缩机、新能源汽车、航空航天、医疗器械等领域备受青睐 但高速永磁电机的研究主要集