unsigned

一种快速简便优秀的全局曲线调整与局部信息想结合的非线性彩色增强算法(多图深度分析和探索)

孤街醉人 提交于 2019-12-01 07:42:13
  本文的分析基于《Adaptive and integrated neighborhood-dependent approach for nonlinear enhancement of color images》一文相关内容,但对其进行了深度的改良。   我们首先解读或者说翻译下这篇论文。   论文公布的时间是2005年了,已经是比较久远的了,我第一次看到该论文大概是在2014年,后面在2016年左右实现了该算法,这里还有当时开发留下的记录,居然是除夕左右做的。佩服自己。   以前没有特别注意到该算法的效果,觉得也就那样吧,所以没有怎么去发挥它,但是,最近再次审视,发现他除了实现实现简单、速度快,而且还具有效果佳、适应性广、不破坏本身就光照好的位置等等众多优点,似乎比目前我看到的低照度增强算法都好。   算法本身的步骤分为三步,第一步是根据的图像亮度分布建立一个自适应的全局映射函数,这一步大大的提高了图像中暗部像素的像素值,同时也压缩了图像的动态范围。第二步是所谓的自适应对比度增强,根据像素领域内的平均值和像素值本身的比例,做一个映射,提高整体的对比度。后续还有一个步骤是颜色恢复的过程。   第一步的全局曲线调整如下所示:   首先计算出彩色图像的亮度值,这个其实可以有很多方式,包括常用的YUV空间的Y通道,HSL空间的L分量,甚至可以使用我提到的对比度保留去色那种方式获取

How can I avoid gcc warning for plain “char” to : “unsigned char” OR “signed char” conversion?

梦想的初衷 提交于 2019-12-01 06:51:51
问题 My default char type is "unsigned char" as set in the gcc option (-funsigned-char gcc). So arguably I can use "char" when I need "unsigned char" in the code. But i am getting warning for conversion between (char*) and (unsigned char* or signed char*): "error: pointer targets in passing argument 1 of 'test2' differ in signedness" . How can I avoid warning when I pass unsigned char* variable to char* (knowing that my syetem has default unsigned char as set by compiler option)? static void test2

C语言无符号和有符号的区别

眉间皱痕 提交于 2019-12-01 06:48:50
C语言定义一个int类型时,默认是有符号数,关键字signed常省略,如: int a; signed int a; signed a; 这三句是一样的定义 定义无符号数时,必须加关键字unsigned,如: unsigned int a ; unsigned a; 无符号关键字unsigned,只适用于int short long char四种变量,浮点型数据只有有符号类型。 那么为什么float会没有无符号呢?C语言中,整型是采用二进制表示的,而浮点数却是按照整数部分,小数部分,指数部分存放的。 运算也是分开来运算的。这样的做法,使得浮点数可以表示很大的范围,所以unsigned无法作用于float,定义无符号的浮点型会出错。不够的话,可以用double,双精度。 以32位机为例,int 分为无符号 unsigned 和有符号 signed 两种类型,默认为signed。二者的区别就是无符号类型能保存2倍于有符号类型的数据。 32位下,signed int 的表示范围为:-2147483648 ~ 2147483647 (最高位做符号位)。 unsigned int 的表示范围为:0 ~ 4294967295 (不保留符号位)。我们都知道,两个不同的数据类型在进行混合使用时,会自动进行类型转换。 其转换原则就是:向着精度更高、长度更长的方向转换。也就是我们平常见到的 char

MySQL5.6 PERFORMANCE_SCHEMA 说明

陌路散爱 提交于 2019-12-01 05:08:56
背景: MySQL 5.5开始新增一个数据库:PERFORMANCE_SCHEMA,主要用于收集数据库服务器性能参数。并且库里表的存储引擎均为PERFORMANCE_SCHEMA,而用户是不能创建存储引擎为PERFORMANCE_SCHEMA的表。 MySQL 5.5默认是关闭的,需要手动开启,在配置文件里添加: view source print ? 1. [mysqld] 2. performance_schema=ON 查看是否开启: view source print ? 1. mysql>show variables like 'performance_schema' ; 2. +--------------------+-------+ 3. | Variable_name | Value | 4. +--------------------+-------+ 5. | performance_schema | <strong>ON</strong> | 6. +--------------------+-------+ 从MySQL5.6开始,默认打开,本文就从MySQL5.6来说明,在数据库使用当中PERFORMANCE_SCHEMA的一些比较常用的功能。具体的信息可以查看官方文档。 相关表信息: 一:配置(setup)表: view source print ?

一张图系列之函数重定位

痞子三分冷 提交于 2019-12-01 05:01:42
.dynmic .rel.plt typedef struct { Elf32_Addr r_offset; /* Address */ Elf32_Word r_info; /* Relocation type and symbol index */ } Elf32_Rel; typedef struct { Elf64_Addr r_offset; /* Address */ Elf64_Xword r_info; /* Relocation type and symbol index */ Elf64_Sxword r_addend; /* Addend */ } Elf64_Rela; .dynsym * Symbol table entry. */ typedef struct { Elf32_Word st_name; /* Symbol name (string tbl index) */ Elf32_Addr st_value; /* Symbol value */ Elf32_Word st_size; /* Symbol size */ unsigned char st_info; /* Symbol type and binding */ unsigned char st_other; /* Symbol visibility */ Elf32_Section

网络驱动之net_device结构体

房东的猫 提交于 2019-12-01 04:35:19
在Linux系统中,网络设备都被抽象为struct net_device结构体。它是网络设备硬件与上层协议之间联系的接口,了解它对编写网络驱动程序非常有益,所以本文将着手简要介绍linux-2.6.38.8/include/linux/netdevice.h文件中struct net_device结构体的所有成员(没有按照它们定义的顺序)。 1、网络设备相关信息 (1)、设备名 char name[IFNAMSIZ]; char *ifalias; //用于SNMP协议 在Linux系统中,每个网络设备都有一个唯一的设备名(如eth0,字母部分代表网络设备的类型,数字部分代表此类网络设备的数量)。 (2)、电源管理服务质量( power managementQuality Of Service) struct pm_qos_request_list pm_qos_req; 用于Wi-Fi和千兆以太网,可以帮助控制网络的延迟和带宽的需求,以达到在可用的前提下省电的目的。 (3)、硬件信息 //网络设备内存映射时在主机中的内存区域 unsigned long mem_end; unsigned long mem_start; //网络设备I/O基地址 unsigned long base_addr; //中断号 unsigned int irq; //传输介质,如双绞线、同轴电缆等

acceptable fix for majority of signed/unsigned warnings?

北城以北 提交于 2019-12-01 03:48:14
I myself am convinced that in a project I'm working on signed integers are the best choice in the majority of cases, even though the value contained within can never be negative. (Simpler reverse for loops, less chance for bugs, etc., in particular for integers which can only hold values between 0 and, say, 20, anyway.) The majority of the places where this goes wrong is a simple iteration of a std::vector, often this used to be an array in the past and has been changed to a std::vector later. So these loops generally look like this: for (int i = 0; i < someVector.size(); ++i) { /* do stuff */

C/C++ use of int or unsigned int

纵饮孤独 提交于 2019-12-01 02:07:15
In a lot of code examples, source code, libraries etc. I see the use of int when as far as I can see, an unsigned int would make much more sense. One place I see this a lot is in for loops. See below example: for(int i = 0; i < length; i++) { // Do Stuff } Why on earth would you use an int rather than an unsigned int ? Is it just laziness - people can't be bothered with typing unsigned ? Using unsigned can introduce programming errors that are hard to spot, and it's usually better to use signed int just to avoid them. One example would be when you decide to iterate backwards rather than

How to quadruple an unsigned number using bit-wise and logic operator in C

拥有回忆 提交于 2019-12-01 02:02:05
Goal: 4x ( 4.400000095 ) = 17.60000038 Legal ops: Any integer/unsigned operations incl. ||, &&. also if, while Max ops: 30 Return bit-level equivalent of expression x + x + x + x for floating point argument f. My code: unsigned 4x(unsigned uf) { unsigned expn = (uf >> 23) & 0xFF; unsigned sign = uf & 0x80000000; unsigned frac = uf & 0x007FFFFF; if (expn == 255 || (expn == 0 && frac == 0)) return uf; if (expn) { expn << 2; } else if (frac == 0x7FFFFF) { frac >> 2; expn << 2; } else { frac <<= 2; } return (sign) | (expn << 23) | (frac); } As you can guess, my code does not work. Instead of

C/C++网络编程3——地址族与数据序列

巧了我就是萌 提交于 2019-12-01 01:21:11
  C/C++网络编程2中介绍了套接字,这一节介绍给套接字分配ip和端口号。ip用于标识一台主机,端口号用于标识一个主机中的一个应用程序,端口号占16位,0到65535,其中0到1023是知名端口号。 表示IPv4的结构体: struct sockaddr_in { sa_family_t sin_family; // 地址族 uint16_t sin_port; // 端口号 struct in_addr sin_addr; // 32位ip地址 char sin_zero[8]; // 不使用 }; struct in_addr { in_addr_t s_addr; // 32位IPv4地址 }; sin_family: AF_INET : IPv4地址族 AF_INET6 : IPv6地址族 AF_LOCAL : 本地通信中采用的UNIX协议的地址族 字节序:   大端序:高位字节存放低位地址。存放0x12345678   小端序 :高位字节存放高位地址。   网络通信中采用大端序。 字节序转换: unsigned short htons(unsigned short); unsigned short ntohs(unsigned short); unsigned long htonl(unsigned long); unsigned long ntohl(unsigned