ES2774013A1 - METHOD AND SYSTEM TO CONVERT A DIGITAL COLOR IMAGE TO GRAY SCALE (Machine-translation by Google Translate, not legally binding) - Google Patents

METHOD AND SYSTEM TO CONVERT A DIGITAL COLOR IMAGE TO GRAY SCALE (Machine-translation by Google Translate, not legally binding) Download PDF

Info

Publication number
ES2774013A1
ES2774013A1 ES201831253A ES201831253A ES2774013A1 ES 2774013 A1 ES2774013 A1 ES 2774013A1 ES 201831253 A ES201831253 A ES 201831253A ES 201831253 A ES201831253 A ES 201831253A ES 2774013 A1 ES2774013 A1 ES 2774013A1
Authority
ES
Spain
Prior art keywords
value
image
channels
pixel
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
ES201831253A
Other languages
Spanish (es)
Other versions
ES2774013B2 (en
Inventor
Zamorano Mariano Rincon
Cesteros Oscar Sanchez
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Universidad Nacional de Educacion a Distancia UNED
Original Assignee
Universidad Nacional de Educacion a Distancia UNED
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Universidad Nacional de Educacion a Distancia UNED filed Critical Universidad Nacional de Educacion a Distancia UNED
Priority to ES201831253A priority Critical patent/ES2774013B2/en
Publication of ES2774013A1 publication Critical patent/ES2774013A1/en
Application granted granted Critical
Publication of ES2774013B2 publication Critical patent/ES2774013B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration

Abstract

A method and system for converting a color image (31) to grayscale (43) applicable within the field of digital image processing is described, enabling its implementation in the form of hardware or software in both electronic devices and editing programs. of pictures. The system obtains the value of each pixel in the three channels R, G, and B in an input unit (32); in a processing unit (46) three normalized channels L, M, and S are calculated and a fourth normalized channel LM is generated, the activity, A, of each pixel is also determined according to the values of the normalized channels; by overweight said activity A for warm colors, and underweight for cold colors, the final value of each pixel, A', is determined in the grayscale image (43). A user interface (42) allows entering values of the weight constants. Finally, an output unit (44) is responsible for displaying the grayscale image. (Machine-translation by Google Translate, not legally binding)

Description

MÉTODO Y SISTEMA PARA CONVERTIR UNA IMAGEN DIGITAL DEMETHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE OF

COLOR A ESCALA DE GRISESCOLOR TO GRAY SCALE

Campo técnico de la invenciónTechnical field of the invention

La presente invención se encuadra en el campo del procesamiento de imágenes digitales y en concreto dentro de los conversores de RGB a escala de grises — comúnmente conocido como transformación de color a blanco y negro.The present invention falls within the field of digital image processing and specifically within converters from RGB to grayscale - commonly known as color to black and white transformation.

Estado de la TécnicaState of the art

El color es un tema de estudio antiguo, pero su tratamiento científico con el fin de tener métodos que lo analicen, clasifiquen o describan, es contemporáneo [1] [2] [3]. Newton, en su Óptica [4], ya hacía mención a él, y lo definía como una propiedad de la luz, y por lo tanto como un «efecto físico». Primero Goethe [5], y con mayor intensidad Schopenhauer [6], discutirían esta definición incluyendo varias categorías más, como el color químico (producido por la incidencia de la luz sobre las superficies y su transformación posterior) o el fisiológico (generado a partir de los procesos del sistema de percepción y que es causante de efectos o procesos como la post-imagen), e indicando que, si bien el color tiene su origen en la luz, el sistema de percepción visual tiene un papel activo, transformando la señal original en la expresión subjetiva final que entendemos por color. Schopenhauer llegaría al enfrentamiento con la teoría newtoniana indicando que el color es un efecto fisiológico del sistema de percepción, existiendo como tal, y únicamente, en el cerebro.Color is an ancient subject of study, but its scientific treatment in order to have methods that analyze, classify or describe it, is contemporary [1] [2] [3]. Newton, in his Optics [4], already mentioned it, and defined it as a property of light, and therefore as a "physical effect". First Goethe [5], and with greater intensity Schopenhauer [6], would discuss this definition including several more categories, such as chemical color (produced by the incidence of light on surfaces and its subsequent transformation) or physiological color (generated from of the processes of the perception system and that is the cause of effects or processes such as the post-image), and indicating that, although color has its origin in light, the visual perception system has an active role, transforming the signal original in the final subjective expression that we understand by color. Schopenhauer would come to a confrontation with Newtonian theory, indicating that color is a physiological effect of the perception system, existing as such, and only, in the brain.

Desde el inicio del siglo XIX y hasta mediados del XX existirían dos teorías principales centradas en dos posiciones científicas. Por un lado, la teoría tricromática, basada en Newton, elaborada por Thomas Young a principios del XIX y definida finalmente por Von Helmholtz [7] a finales de este siglo. Y por otro lado, la teoría de procesos opuestos, definida por Hering [8] en gran medida a partir de Goethe y Schopenhauer. Con el avance de la neurociencia se cerraría el debate incluyendo ambas teorías, donde la primera, la tricromática, se relaciona con la captación sensorial de la luz en la retina, y la segunda, procesos opuestos, con el procesamiento neuronal.From the beginning of the 19th century and until the middle of the 20th, there would be two main theories centered on two scientific positions. On the one hand, the trichromatic theory, based on Newton, developed by Thomas Young at the beginning of the XIX century and finally defined by Von Helmholtz [7] at the end of this century. And on the other hand, the theory of opposite processes, defined by Hering [8] largely from Goethe and Schopenhauer. With the advancement of neuroscience, the debate would be closed including both theories, where the first, trichromatic, is related to the sensory uptake of light in the retina, and the second, opposite processes, with neural processing.

En cuanto a la organización de los colores en una jerarquía, el tema es más amplio, y ha sido objeto de estudio inicialmente por artistas y, sobre todo a partir de mediados del siglo XX, por la psicología del arte [9]. Existen diferentes modelos para representar el color, y el consenso es más complejo, aunque se puede establecer que existen unos denominados colores primarios que, a través de la mezcla entre sí, dan los colores secundarios, estos, a su vez, a los terciarios, y así hasta llegar a millones de combinaciones. Desde la esfera de color de Runge [10], a la de Munsell [11], pasando por sistemas de ruedas o pirámides, pero en ningún caso se establece una jerarquía hasta llegar al modelo de hexágono de Krueppers [12] (ver figura 2). El modelo de Krueppers sí establece una jerarquía con su «romboedro» que va del blanco, pasando por el amarillo, rojo, verde y azul, hasta el negro. El determinar esta jerarquía es un paso necesario para obtener una escala donde las propiedades de cada color queden reflejadas en la transformación a niveles de gris, pero resulta difícil determinar una conversión efectiva desde el modelo RGB. En [6], Schopenhauer describe una relación entre la jerarquía y la división de la actividad de la retina, de tal manera que el blanco corresponde a la actividad plena y el negro a la ausencia total de actividad, mientras que el amarillo es % de actividad, el rojo y el verde / , y el azul 1% (ver figura 3). Schopenhauer indica que existe, además de esta división, que denomina cuantitativa, otra cualitativa que determina la presencia o la ausencia de actividad. En definitiva, si el amarillo es % de la actividad, es % de inactividad, y a su vez, el amarillo junto con su opuesto, el azul (con % de actividad), suman uno, la actividad plena de la retina. De esta manera, su sistema antecede al sistema de colores opuestos que después Hering desarrollaría, pero para nuestro fin, lo relaciona con una jerarquía.Regarding the organization of colors in a hierarchy, the subject is broader, and has been the object of study initially by artists and, especially from the middle of the 20th century, for the psychology of art [9]. There are different models to represent color, and the consensus is more complex, although it can be established that there are some so-called primary colors that, through mixing with each other, give secondary colors, these, in turn, to tertiary colors, and so on until reaching millions of combinations. From Runge's color sphere [10], to Munsell's [11], passing through wheel systems or pyramids, but in no case is a hierarchy established until reaching the Krueppers [12] hexagon model (see figure 2 ). Krueppers' model does establish a hierarchy with its "rhombohedron" that goes from white, through yellow, red, green and blue, to black. Determining this hierarchy is a necessary step to obtain a scale where the properties of each color are reflected in the transformation to gray levels, but it is difficult to determine an effective conversion from the RGB model. In [6], Schopenhauer describes a relationship between the hierarchy and the division of the activity of the retina, in such a way that the white corresponds to the full activity and the black to the total absence of activity, while the yellow is% of activity, red and green /, and blue 1% (see figure 3). Schopenhauer indicates that there is, in addition to this division, which he calls quantitative, another qualitative one that determines the presence or absence of activity. Ultimately, if yellow is% of activity, it is% of inactivity, and in turn, yellow together with its opposite, blue (with% of activity), add up to one, the full activity of the retina. In this way, his system precedes the system of opposite colors that Hering would later develop, but for our purpose, he relates it to a hierarchy.

Además, en las artes visuales, la distinción entre colores cálidos y fríos es muy común [1], lo cual permite establecer el contraste de color también por categorías. Berlin and Kay [13], después de estudiar distintos lenguajes alrededor del mundo, demostraron que los colores son universales e independientes a sensibilidades culturales. E. Rosch [14] descubrió una tribu en Nueva Guinea (Los Danis) con solamente dos categorías: clarocálido y frío-oscuro. Ellos aprendieron los colores rojo, verde, azul y amarillo (los colores primarios para los procesos opuestos) mucho más rápido que los otros. Una justificación de este hecho es que existe una estructura neuronal que analiza las relaciones entre colores opuestos y, por tanto, la percepción visual del contraste entre las categorías cálido y claro opuestas a frío y oscuro.Furthermore, in the visual arts, the distinction between warm and cold colors is very common [1], which allows to establish the color contrast also by category. Berlin and Kay [13], after studying different languages around the world, showed that colors are universal and independent of cultural sensitivities. E. Rosch [14] discovered a tribe in New Guinea (Los Danis) with only two categories: light-warm and cold-dark. They learned the colors red, green, blue, and yellow (the primary colors for the opposite processes) much faster than the others. A justification for this fact is that there is a neural structure that analyzes the relationships between opposite colors and, therefore, the visual perception of the contrast between the categories warm and light as opposed to cold and dark.

Schopenhauer conocía el efecto final del procesamiento de los colores por el cerebro, pero no cómo se producía, aunque intuía que era un problema fisiológico. Sin embargo, hoy en día, el conocimiento de todos los órganos implicados en la visión es amplio. Schopenhauer knew the final effect of the brain's processing of colors, but not how it was produced, although he sensed that it was a physiological problem. However, today, the knowledge of all the organs involved in vision is wide.

Davida Teller [15] definió la estructura de la retina en dos arquitecturas, la primera tricromática y la segunda de procesos opuestos— por lo tanto, ambas teorías sobre el tratamiento del color no eran excluyentes, sino que eran parte de un mismo proceso, pero en distintas fases del mismo.Davida Teller [15] defined the structure of the retina in two architectures, the first trichromatic and the second of opposite processes— therefore, both theories on the treatment of color were not exclusive, but were part of the same process, but in different phases of it.

Con el surgimiento de las cámaras y los televisores digitales, y después de los monitores para equipos informáticos durante el siglo XX, el procesamiento de las imágenes se estableció como un campo multidisciplinar, en donde encontraba cobijo un amplio abanico de especialistas, científicos y técnicos, pero también de creativos, diseñadores y artistas. Uno de los problemas con el que se encontraron fue el de la conversión a escala de grises (blanco y negro para el gran público) de imágenes en color sin que se perdieran las propiedades de luminosidad, matiz y saturación que este elemento visual ofrece en la percepción [16]. Los primeros conversores utilizaban la intensidad de luz, eliminando información tanto de la saturación como del matiz. Como primera solución se determinó el uso de «pesos» en cada canal RGB — el sistema de color RGB es el estándar de facto, aunque existen otros como CIE LAB— de tal manera que se le daba un mayor protagonismo al canal R sobre el G o el B, siendo este último el que tenía un peso menor, manteniendo de este modo las diferencias del matiz junto a las de luminosidad. Este tipo de conversores asumían cuestiones de la percepción humana para su desarrollo y establecían cálculos científicos para determinar los pesos.With the emergence of digital cameras and televisions, and after monitors for computer equipment during the 20th century, image processing was established as a multidisciplinary field, where a wide range of specialists, scientists and technicians found shelter, but also of creatives, designers and artists. One of the problems they encountered was that of converting color images to grayscale (black and white for the general public) without losing the lightness, hue and saturation properties that this visual element offers in the perception [16]. The first converters used light intensity, removing information from both saturation and hue. As a first solution, the use of "weights" in each RGB channel was determined - the RGB color system is the de facto standard, although there are others such as CIE LAB - in such a way that the R channel was given greater prominence over the G or B, the latter being the one that had a lower weight, thus maintaining the differences in hue together with those in luminosity. This type of converters assumed questions of human perception for their development and established scientific calculations to determine the weights.

Existe una segunda línea de conversores que ponderan el valor del color RGB original por el contraste en cada región de la imagen para establecer una diferenciación según la relación de cada píxel con su entorno [17]. El contraste local de cada píxel nos indica su relevancia dentro de la imagen con el fin de determinar su posición en la escala de grises final. Para llevar a cabo esta tarea es necesario aplicar algoritmos y procesamientos concretos en cada píxel (o en cada grupo de píxeles) que dependen de circunstancias locales, y en algunos casos globales con el resto de la imagen.There is a second line of converters that weight the value of the original RGB color by the contrast in each region of the image to establish a differentiation according to the relationship of each pixel with its environment [17]. The local contrast of each pixel indicates its relevance within the image in order to determine its position in the final gray scale. To carry out this task, it is necessary to apply specific algorithms and processing in each pixel (or in each group of pixels) that depend on local circumstances, and in some cases global with the rest of the image.

Conversores que utilizan «pesos»:Converters using "pesos":

• Métodos como CIECAM97, L*a*b* lum, XYZ lum o YC1-Cb Lum.• Methods such as CIECAM97, L * a * b * lum, XYZ lum or YC 1- Cb Lum.

• Patentes:• Patents:

o Method and device for use in converting a colour image into a grayscale image. (US8355566B2) o Method and device for use in converting a color image into a grayscale image. (US8355566B2)

o Method and apparatus for converting a color image to grayscale (US8594419B2). o Method and apparatus for converting a color image to grayscale (US8594419B2).

o Method of converting color image into grayscale image and recording médium storing program for performing the same (US8526719B2). o Method of converting color image into grayscale image and recording medium storing program for performing the same (US8526719B2).

o Method and device for use in converting a colour image into a grayscale image (US7382915B2). Utiliza máscaras en forma de filtro. o Method and device for use in converting a color image into a grayscale image (US7382915B2). Use filter-shaped masks.

Conversores que analizan el contraste en cada región (de una manera local, global o ambas):Converters that analyze the contrast in each region (locally, globally, or both):

• Métodos como Color2Gray [18].• Methods such as Color2Gray [18].

• Patentes:• Patents:

o Color to monochrome conversion (US4977398A). o Color to monochrome conversion (US4977398A).

o Mapping of color images to black-and-white textured images (US5153576A). o Mapping of color images to black-and-white textured images (US5153576A).

o Image processing for converting color images into monochrome pattern images (US5726781A). o Image processing for converting color images into monochrome pattern images (US5726781A).

o System for black and white printing of colored pages (US5898819A). o System for black and white printing of colored pages (US5898819A).

o Printing black and white reproducible color documents (US5701401A) o Printing black and white reproducible color documents (US5701401A)

o Color transforming method (US6101272A). o Color transforming method (US6101272A).

Otras opciones:Other options:

• Method for converting a video signal into a black/white signal (US4257070A ).• Method for converting a video signal into a black / white signal (US4257070A).

Utiliza canales con propiedades visuales: intensidad, matiz, textura y efecto pictórico y aplica umbrales.It uses channels with visual properties: intensity, hue, texture and painterly effect and applies thresholds.

Resumen de los principales problemas:Summary of the main problems:

• La conversión del color a partir de sus tres dimensiones: matiz, luminosidad y saturación. Con la combinación de los tres canales RGB se obtiene una escala de grises que mide la luminosidad. Con el uso de pesos en cada canal se introduce además el matiz, pero la combinación final no es fácil partiendo del sistema RGB y sin incluir la saturación. .• The conversion of color from its three dimensions: hue, lightness and saturation. With the combination of the three RGB channels, a gray scale is obtained that measures the luminosity. With the use of weights in each channel, the hue is also introduced, but the final combination is not easy starting from the RGB system and without including saturation. .

• Establecer una escala de luminosidad, e incluso de saturación, a priori es fácil, pero determinar la del matiz es mucho más compleja.• Establishing a scale of luminosity, and even saturation, a priori is easy, but determining the hue is much more complex.

• El análisis local del contraste es eficaz cuando éste es alto, pero no cuando es medio o bajo. Esto provoca que los colores, en regiones donde el contraste no es muy alto, se encuentren en valores bajos en la escala de grises final, aunque sus colores originales tengan un valor mayor en sus propiedades de luminosidad, matiz o saturación. • Local contrast analysis is effective when it is high, but not when it is medium or low. This causes that the colors, in regions where the contrast is not very high, are in low values in the final grayscale, although their original colors have a higher value in their lightness, hue or saturation properties.

• La valoración local o global donde se compara cada pixel con su entorno establece una escala final ligada a la propia estructura de la composición de colores de la imagen, pero es complejo comparar los resultados entre varias imágenes, sobre todo por sus propiedades.• The local or global assessment where each pixel is compared with its environment establishes a final scale linked to the structure of the color composition of the image, but it is complex to compare the results between several images, especially due to their properties.

Breve descripción de la invenciónBrief description of the invention

La presente invención se refiere a un método y a un sistema definido de acuerdo con las reivindicaciones. La invención propone realizar la conversión de color a escala de grises a nivel de pixel gracias a un sistema de color que está basado en los estudios sobre el color de Schopenhauer, la teoría de colores opuestos de Hering y los avances recientes en el conocimiento de la fisiología y funcionamiento de la retina proporcionados por la neurociencia. Este sistema de color permite generar una jerarquía relacionada con la actividad neuronal de la retina y, además, determina la categoría de cada color, bien cálida o bien fría, con el fin de diferenciar los valores semejantes en la jerarquía — como el rojo con el verde— y poder diferenciarlos para mantener el contraste. Ese contraste, que existe en las propiedades originales de color (luminosidad, matiz y saturación), se suele perder en la conversión. La transformación se realiza en dos pasos: en primer lugar, se obtiene el valor de cada pixel en la jerarquía y, en segundo lugar, se aumenta o disminuye el valor según la categoría de cálido o frío a la que pertenece.The present invention relates to a method and a system defined according to the claims. The invention proposes to carry out the conversion of color to grayscale at the pixel level thanks to a color system that is based on the studies on the color of Schopenhauer, the theory of opposite colors of Hering and the recent advances in the knowledge of the physiology and function of the retina provided by neuroscience. This color system allows the generation of a hierarchy related to the neuronal activity of the retina and, in addition, determines the category of each color, either warm or cold, in order to differentiate similar values in the hierarchy - such as red with green— and be able to differentiate them to maintain contrast. That contrast, which exists in the original color properties (lightness, hue, and saturation), is often lost in conversion. The transformation is carried out in two steps: first, the value of each pixel in the hierarchy is obtained and, secondly, the value is increased or decreased according to the category of warm or cold to which it belongs.

La invención tiene diversas aplicaciones en herramientas informáticas de edición para diseñadores gráficos, artistas y expertos en imagen donde se usa el color con estrategias de comunicación y con necesidad de objetividad. Además, teniendo en cuenta que la accesibilidad es una cuestión clave en nuestra sociedad y que más del 70% de la comunicación es visual, se establece también como un importante campo de aplicación el de los sistemas o soportes para personas con problemas para distinguir los colores (acromatopsia, discromatopsia, en especial el daltonismo: protanopia, deuteronopsia, etc.).The invention has various applications in computer editing tools for graphic designers, artists and image experts where color is used with communication strategies and in need of objectivity. In addition, taking into account that accessibility is a key issue in our society and that more than 70% of communication is visual, it is also established as an important field of application that of systems or supports for people with problems to distinguish colors (achromatopsia, dyschromatopsia, especially color blindness: protanopia, deuteronopsia, etc.).

La presente invención puede implementarse con componentes físicos de hardware o con software en un programa informático ejecutable en el procesador de un ordenador o dispositivo similar. La invención emplea dos vías complementarias bioinspiradas, denominadas ON y OFF. Por vía se debe entender la ruta que siguen el conjunto de señales que transportan una determinada información. La vía ON describe la actividad y la vía OFF la inactividad (aunque, por simplificación, en este documento sólo se usará la vía ON).The present invention can be implemented with physical hardware components or with software in a computer program executable on the processor of a computer or similar device. The invention employs two complementary bio-inspired pathways, called ON and OFF. By road, the route followed by the set of signals that carry certain information. The ON pathway describes activity and the OFF pathway describes inactivity (although, for simplicity, only the ON path will be used in this document).

En la presente invención, cada vía consta de cuatro canales, denominados L, M, S y LM, todos con valores entre 0 y 1. El primero recibe la señal del canal R (señal de onda larga, que informa de la actividad en el rango de baja frecuencia del espectro visible), el segundo de G (señal de onda media, que informa de la actividad en el rango de media frecuencia del espectro visible), el tercero de S (señal de onda corta, que informa de la actividad en el rango de alta frecuencia del espectro visible), y el último, LM, es la suma con saturación de la actividad en R y G. La actividad total de la vía, de acuerdo con la presente invención, se define como la suma ponderada de las actividades parciales en cada canal y se asume que todos los canales aportan por igual. El resultado es una jerarquía o escala que ordena los colores en consonancia con la actividad de la retina según Schopenhauer. En esta escala, normalizada en el rango [0,1], los colores principales tienen los siguientes valores:In the present invention, each channel consists of four channels, named L, M, S and LM, all with values between 0 and 1. The first receives the signal from the R channel (long wave signal, which reports the activity in the low-frequency range of the visible spectrum), the second from G (medium-wave signal, which reports activity in the mid-frequency range of the visible spectrum), the third from S (short-wave signal, which reports activity in the high frequency range of the visible spectrum), and the last, LM, is the sum with saturation of the activity in R and G. The total activity of the pathway, according to the present invention, is defined as the weighted sum of partial activities in each channel and it is assumed that all channels contribute equally. The result is a hierarchy or scale that orders colors in accordance with the activity of the retina according to Schopenhauer. In this scale, normalized in the range [0,1], the main colors have the following values:

Blanco=1, Amarillo = 3/4, Rojo = 1/2, Verde = 1/2, Azul: 1/4, Negro = 0.White = 1, Yellow = 3/4, Red = 1/2, Green = 1/2, Blue: 1/4, Black = 0.

Sin embargo, no existe una diferenciación de los colores cálidos y fríos, como ejemplo, los colores básicos rojo y verde se encuentran en el mismo punto de la escala, con valor 1/2, por lo que es necesario una segunda transformación que los diferencie. La propuesta es aumentar el valor de actividad cuando es un color cálido y reducirlo cuando es un color frío a través de una segunda etapa de transformación dependiente de la categoría del color:However, there is no differentiation of warm and cold colors, as an example, the basic colors red and green are at the same point on the scale, with a value of 1/2, so a second transformation is necessary to differentiate them. . The proposal is to increase the activity value when it is a warm color and reduce it when it is a cold color through a second transformation stage depending on the color category:

• Definimos que un píxel tiene asociado un color cálido cuando su valor en el canal L es superior a 0,5 en la vía ON.• We define that a pixel has a warm color associated with it when its value in the L channel is greater than 0.5 in the ON way.

• Definimos que un píxel tiene asociado un color frío cuando su valor en el canal L es igual o inferior a 0,5 en la vía ON.• We define that a pixel has a cold color associated with it when its value in the L channel is equal to or less than 0.5 in the ON way.

Esta segunda etapa determina el valor final en escala de grises de la conversión. Las mejoras y ventajas técnicas de este conversor en relación a otros son principalmente las siguientes:This second stage determines the final greyscale value of the conversion. The improvements and technical advantages of this converter in relation to others are mainly the following:

• La capacidad de convertir las propiedades de luminosidad, matiz y saturación a la escala de grises a partir de una jerarquía de colores bioinspirada, donde se relacionan las tres propiedades y no sólo una o dos de ellas. • The ability to convert lightness, hue, and saturation properties to grayscale from a bio-inspired color hierarchy, where all three properties are related and not just one or two of them.

• La distinción de las categorías de cálido y frío y la determinación de su nivel de intensidad establecen la distinción entre colores opuestos que tienen el mismo nivel de la escala jerárquica de conversión, mejorando la conversión final.• The distinction of the categories of warm and cold and the determination of their intensity level establish the distinction between opposite colors that have the same level of the hierarchical conversion scale, improving the final conversion.

• Reducción de la complejidad computacional: al realizar el procesamiento a nivel de pixel, sin necesidad de analizar su contexto, lo que consigue una reducción muy significativa del cómputo necesario para transformar el color RGB en niveles de gris.• Reduction in computational complexity: when processing at the pixel level, without the need to analyze its context, which achieves a very significant reduction in the computation required to transform RGB color into gray levels.

Solución de los principales problemas:Solution of the main problems:

• La conversión del color a partir de sus tres dimensiones: matiz, luminosidad y saturación. Con la combinación de los tres canales RGB se obtiene una escala de grises que mide la luminosidad. Con el uso de pesos en cada canal se introduce además el matiz, pero la combinación final no es fácil partiendo del sistema RGB y sin incluir la saturación. El paso de un modelo de tres canales homogéneos a otro de cuatro canales facilita la definición de una jerarquía cuantitativa en consonancia con la teoría de colores opuestos que tiene en cuenta las propiedades de luminosidad, matiz y saturación.• The conversion of color from its three dimensions: hue, lightness and saturation. With the combination of the three RGB channels, a gray scale is obtained that measures the luminosity. With the use of weights in each channel, the hue is also introduced, but the final combination is not easy starting from the RGB system and without including saturation. The transition from a homogeneous three-channel model to a four-channel model facilitates the definition of a quantitative hierarchy in line with the theory of opposite colors that takes into account the properties of lightness, hue and saturation.

• E l análisis local del contraste es eficaz cuando éste es alto, pero no cuando es medio o bajo. Esto provoca que los colores, en regiones donde el contraste no es muy alto, se encuentren en valores bajos en la escala de grises final, aunque sus colores originales tengan un valor expresivo mayor. En la presente propuesta no hay análisis local del contraste, sino que se utilizan las categorías excluyentes de cálido y frío, que se obtienen a partir de uno de los canales.• T he local contrast analysis is effective when it is high, but not when it is medium or low. This causes that the colors, in regions where the contrast is not very high, are in low values in the final gray scale, although their original colors have a greater expressive value. In the present proposal there is no local analysis of the contrast, but the exclusive categories of hot and cold are used, which are obtained from one of the channels.

• La valoración local o global donde se compara cada pixel con su entorno establece una escala final ligada a la propia estructura de la composición de colores de la imagen, pero es complejo comparar los resultados entre varias imágenes, sobre todo en la comparación de cada color. La conversión en la presente invención es puntual, se centra en el análisis de los valores RGB del propio píxel, con lo cual no hay ningún ajuste determinado por la relación con otros píxeles de la imagen.• The local or global assessment where each pixel is compared with its environment establishes a final scale linked to the structure of the color composition of the image, but it is complex to compare the results between several images, especially when comparing each color . The conversion in the present invention is specific, it focuses on the analysis of the RGB values of the pixel itself, with which there is no adjustment determined by the relationship with other pixels in the image.

En definitiva, se solucionan los principales problemas de la conversión de RGB a niveles de gris con un modelo universal en el que se realza el contraste entre colores según la categoría del propio color (cálida/fría), y no dependiendo de análisis locales de contraste. El hecho de no depender de la propia estructura de la composición de la imagen y de las relaciones locales facilita la relación entre imágenes — todas tiene el mismo criterio de conversión— y, por lo tanto, su comparación. Además, la propuesta incluye dos constantes que controlan el aumento (en la categoría cálida) o reducción (en la fría) de la intensidad final en la conversión, lo que permite ajustar el resultado final.In short, the main problems of converting RGB to gray levels are solved with a universal model in which the contrast between colors is enhanced according to the category of the color itself (warm / cold), and not depending on local contrast analysis. . The fact of not depending on the structure of the composition of the image and the local relationships facilitates the relationship between images - all have the same same conversion criteria — and therefore their comparison. In addition, the proposal includes two constants that control the increase (in the warm category) or decrease (in the cold category) of the final intensity in the conversion, which allows adjusting the final result.

Breve descripción de las figurasBrief description of the figures

Fig. 1. Esquema general de las etapas del conversor de color aplicado a cada píxel de la imagen.Fig. 1. General diagram of the stages of the color converter applied to each pixel of the image.

Figs. 2. Sistemas de color conocidos. Fig. 2A esfera de color de Runge; Fig. 2B esfera de Munsell; Fig. 2C rueda de colores con colores primarios y secundarios; y Fig. 2D hexágono de Kueppers.Figs. 2. Known color systems. Fig. 2A Runge's color sphere; Fig. 2B Munsell sphere; Fig. 2C color wheel with primary and secondary colors; and Fig. 2D Kueppers hexagon.

Fig. 3. Relación entre colores básicos y escala de grises en relación a la actividad de la retina según Schopenhauer.Fig. 3. Relationship between basic colors and gray scale in relation to the activity of the retina according to Schopenhauer.

Fig. 4. Esquema de la estructura neuronal de la retina en relación al color. Transformación de la captación de información en un sistema tricromático a uno de cuatro canales de acuerdo con la invención.Fig. 4. Scheme of the neuronal structure of the retina in relation to color. Transformation of the information capture in a trichromatic system to one of four channels according to the invention.

Fig. 5. Esquema básico de la primera etapa de conversión de acuerdo con la invención. Fig. 6. Espacio de color generado con la primera etapa de la invención y su relación con el valor «A» de actividad.Fig. 5. Basic diagram of the first conversion stage according to the invention. Fig. 6. Color space generated with the first stage of the invention and its relationship with the "A" value of activity.

Fig. 7. Espacio de color generado con la primera etapa de la invención y su relación con las categorías de color (claro-cálido, cálido, frío y frío-oscuro).Fig. 7. Color space generated with the first stage of the invention and its relationship with the color categories (light-warm, warm, cold and cold-dark).

Fig. 8. Esquema básico de las etapas de la invención.Fig. 8. Basic diagram of the steps of the invention.

Figs. 9A-9E. Conversión según la invención de una imagen Fig. 9A y los resultados obtenidos con diferentes configuraciones: Fig. 9B con W=0 y C=0, sin aumento o decremento en zonas cálidas y frías; Fig. 9C con W=0.32 y C=0.16; Fig. 9D contraste alto aplicado para zonas cálidas W=1 ,y C=0; y Fig. 9E contraste alto aplicado en zonas frías, W=0 y C=1.Figs. 9A-9E. Conversion according to the invention of an image Fig. 9A and the results obtained with different configurations: Fig. 9B with W = 0 and C = 0, without increase or decrease in hot and cold areas; Fig. 9C with W = 0.32 and C = 0.16; Fig. 9D high contrast applied for warm areas W = 1, and C = 0; and Fig. 9E high contrast applied in cold areas, W = 0 and C = 1.

Figs. 10A-10D. Cartas de color Ishihara para detección de la ceguera de color y su conversión con cieY y según la invención.Figs. 10A-10D. Ishihara color charts for the detection of color blindness and its conversion with cieY and according to the invention.

Figs. 11A-11I. Comparativa de la conversión final con conversores de pesos y por contrastes. Fig. 11A ilustra la imagen original: «Sol naciente» de Monet; Fig. 11B conversión primera según la escala jerárquica; Fig. 11C muestra la determinación de las áreas de categorías de cálido y frío; Figs. 11D-11G muestran los resultados obtenidos con conversores por pesos, Fig. 11E muestra los resultados obtenidos con conversor por contraste local, y Fig. 11F muestra los resultados obtenidos con el conversor propuesto.Figs. 11A-11I. Comparison of the final conversion with weight and contrast converters. Fig. 11A illustrates the original image: Monet's "Rising Sun"; Fig. 11B first conversion according to the hierarchical scale; Fig. 11C shows the determination of the hot and cold category areas; Figs. 11D-11G show the results obtained with weight converters, Fig. 11E shows the results obtained with converter by local contrast, and Fig. 11F shows the results obtained with the proposed converter.

Fig. 12. Diagrama de bloques de un ejemplo de realización del sistema.Fig. 12. Block diagram of an embodiment of the system.

Descripción detallada de la invenciónDetailed description of the invention

a) Paso del m odelo tric rom ático a uno de cuatro canalesa) Change from the attic trichromatic model to one of four channels

En la presente invención se combinan la teoría de colores opuestos y la teoría tricromática para pasar de un modelo tricromático (RGB) a uno de procesos opuestos con cuatro canales que facilita el paso de color RGB a escala de grises.In the present invention, the theory of opposite colors and the trichromatic theory are combined to go from a trichromatic model (RGB) to one of opposite processes with four channels that facilitates the transition from RGB color to grayscale.

El paso de tres a cuatro canales está inspirado en las estructuras neuronales de la retina y el núcleo geniculado lateral, las cuales están implicadas en las primeras etapas de procesamiento del color (ver figura 4):The passage from three to four channels is inspired by the neural structures of the retina and the lateral geniculate nucleus, which are involved in the first stages of color processing (see figure 4):

* Conos 21 Los primeros implicados en el reconocimiento del color, se encuentran en la retina y están divididos en tres tipos según su respuesta a tres longitudes de onda en la luz: L(larga), M(media) y S(corta). Los tres tipos de conos se corresponden respectivamente con los canales R, G y B del sistema tricromático,* Cones 21 The first ones involved in color recognition are found in the retina and are divided into three types according to their response to three wavelengths in light: L (long), M (medium) and S (short). The three types of cones correspond respectively to the R, G and B channels of the trichromatic system,

* Células ganglionales 22. Se establecen en dos vías, una que determina la intensidad y otra su ausencia, denominadas ON 23 y OFF 24 , respectivamente, y existen tres tipos de células en cada una: magnocélulas 26, parvocélulas 25 y koniocélulas 27. Mientras que las células ganglionales 22 se configuran de la siguiente manera:* Ganglion cells 22. They are established in two ways, one that determines the intensity and the other its absence, called ON 23 and OFF 24, respectively, and there are three types of cells in each: magnocells 26, parvocells 25 and koniocells 27. While that ganglion cells 22 are configured as follows:

• Magnocélulas 26: denominadas como LM, realizan la suma con saturación de las señales L y M.• Magnocells 26: known as LM, they perform the sum with saturation of the L and M signals.

• Parvocélulas 25: hay dos grupos, unas transportan la señal del canal L y otras la del M.• Parvocells 25: there are two groups, some carry the L channel signal and others the M channel.

• Koniocélulas 27: transportan la señal del canal S.• Koniocells 27: carry the S channel signal.

b) Im plem entación de un conversorb) Implementation of a converter

b.1) Primera etapa de conversiónb.1) First stage of conversion

La idea principal es obtener el valor de intensidad de cada pixel transformando los valores RGB según una escala que permite mantener las propiedades del color. Nos basamos en el valor de actividad definido en la teoría del color de Schopenhauer y el modelo de cuatro canales obtenido en el paso anterior para establecer el valor inicial en escala de grises. Este valor se obtiene como:The main idea is to obtain the intensity value of each pixel by transforming the RGB values according to a scale that allows maintaining the color properties. Us We based on the activity value defined in Schopenhauer's color theory and the four-channel model obtained in the previous step to establish the initial value in gray scale. This value is obtained as:

Ecuación 1: A = LM+L+M+S donde LM = min(L M, 1)Equation 1: A = LM + L + M + S where LM = min ( LM, 1)

Siendo L=R, M=G, S=B y LM=L+M , y usando A como valor en escala de grises inicial, según la primera etapa de esta conversión (ver figura 5). Todos los valores están normalizados en el intervalo [0,1]. Así, por ejemplo, el color amarillo, codificado como (1,1,0) en RGB, pasa a (1,1,0,1) en cuatro canales (L,M,S,LM) y el valor de actividad asociado es A=3/4=0.75.Being L = R, M = G, S = B and LM = L + M , and using A as the initial gray scale value, according to the first stage of this conversion (see figure 5). All values are normalized in the interval [0,1]. Thus, for example, the yellow color, coded as (1,1,0) in RGB, becomes (1,1,0,1) in four channels (L, M, S, LM) and the associated activity value is A = 3/4 = 0.75.

Como hemos indicado anteriormente, se establecen dos vías visuales opuestas, denominadas ON y OFF, relacionadas con el valor de actividad o su ausencia respectivamente. Este sistema se relaciona con la división cualitativa de Schopenhauer, donde se establecen dos partes opuestas. Para explicar el funcionamiento según la presente invención de un conversor de RGB a niveles de gris, no es necesario el uso de ambas vías y se simplifica usando solamente la vía ON.As we have indicated previously, two opposing visual pathways are established, called ON and OFF, related to the activity value or its absence respectively. This system is related to Schopenhauer's qualitative division, where two opposite parts are established. To explain the operation according to the present invention of a converter from RGB to gray levels, it is not necessary to use both ways and it is simplified by using only the ON way.

Segunda etapa de conversión: Diferenciación entre cálido y frío.Second stage of conversion: Differentiation between warm and cold.

El valor A, obtenido con la etapa anterior, determina la posición de cada color en una jerarquía inicial, donde los canales R y G originales se sitúan de una manera simétrica (ver figura 6). Esto quiere decir que un color rojo y su opuesto verde, obtendrán el mismo valor A . Por ejemplo, para RGB( 1,0,0 ) y RGB( 0,1,0 ) A = 0.5 en ambos casos, para RGB(0.5,0,0) y RGB(0,0.5,0), A = 0.375 , ó para RGB(0,5,0.2,0) y RGB( 0.2,0,5,0 ), A = 0.35 . Para obtener una conversión más efectiva, es necesario establecer la diferenciación entre ambos canales, para lo que utilizamos la característica cálido-frío, aumentando el valor en escala de grises para colores cálidos y reduciéndolo para colores fríos. La relación entre los canales y ambas categorías es:The value A, obtained with the previous stage, determines the position of each color in an initial hierarchy, where the original R and G channels are located in a symmetrical manner (see figure 6). This means that a red color and its green opposite will obtain the same A value. For example, for RGB ( 1,0,0 ) and RGB ( 0,1,0 ) A = 0.5 in both cases, for RGB (0.5,0,0) and RGB (0,0.5,0), A = 0.375 , or for RGB (0,5,0.2,0) and RGB ( 0.2,0,5,0 ), A = 0.35 . To obtain a more effective conversion, it is necessary to establish the differentiation between both channels, for which we use the warm-cool characteristic, increasing the value in grayscale for warm colors and reducing it for cold colors. The relationship between the channels and both categories is:

• Cálido: preponderancia de L y LM.• Warm: preponderance of L and LM.

• Frío: preponderancia de M y S• Cold: preponderance of M and S

En la conversión, el canal L controla tanto la influencia del LM como la del L, por lo que se implementa la definición de la categoría cálido como:In the conversion, the L channel controls both the influence of the LM and the L, so the definition of the warm category is implemented as:

L>0.5 L> 0.5

y de la categoría frío como:and from the cold category as:

-L>0.5-L> 0.5

El canal -L es el perteneciente a la vía OFF, aunque, por motivos de simplificación, se decide no usar la vía OFF y utilizar la siguiente relación para la categoría frio:Channel -L is the one belonging to the OFF channel, although, for simplification reasons, it was decided not to use the OFF channel and to use the following relationship for the cold category:

L<=0.5L <= 0.5

Sobre la esfera donde se representa el espacio de color tras la primera etapa de la conversión, se muestran los límites de ambas categorías a través de la influencia del canal L (ver figura 7). Las subcategorías de claro-cálido y oscuro-frío quedan definidas cuando los valores de actividad son superiores a 0.75 o inferiores a 0.25 y no aportan mayor funcionalidad a este modelo — el primero queda dentro de la categoría de cálido y el segundo dentro de la categoría de frío.On the sphere where the color space is represented after the first stage of the conversion, the limits of both categories are shown through the influence of the L channel (see figure 7). The subcategories of light-warm and dark-cold are defined when the activity values are higher than 0.75 or lower than 0.25 and do not provide greater functionality to this model - the first falls within the category of warm and the second within the category of cold.

Una vez definidos qué colores son cálidos y cuáles fríos, se aplica ahora un factor aditivo que aumente el valor en la conversión a escala de grises para los primeros y lo reduzca para los segundos. La ecuación 2 formaliza la operación: preferiblemente, se utiliza una función sigmoide para obtener una transición suave y aumentar de manera no lineal los valores cálidos (cuando L>0.5) y reducirlos para colores fríos (cuando L<=0.5) y se acota el valor final al intervalo [0,1]. Se utiliza cualquier otra función que aproxime a ésta.Having defined which colors are warm and which are cold, an additive factor is now applied that increases the value in the conversion to grayscale for the former and reduces it for the latter. Equation 2 formalizes the operation: preferably, a sigmoid function is used to obtain a smooth transition and increase in a non-linear way the warm values (when L> 0.5) and reduce them for cold colors (when L <= 0.5) and the final value to the interval [0,1]. Any other function that approximates this is used.

Ecuación 2:

Figure imgf000012_0001
Equation 2:
Figure imgf000012_0001

Para poder ajustar el cambio debido a la calidez/frialdad del color por separado, se introduce el parámetro a, el cual puede tomar dos valores configurables: W si el color es cálido y C si es frío, ambos en el intervalo [0,1]:To be able to adjust the change due to the warmth / coldness of the color separately, the parameter a is introduced, which can take two configurable values: W if the color is warm and C if it is cold, both in the interval [0,1 ]:

si L > 0.5 a = / ; 0<=W<=1if L> 0.5 a = /; 0 <= W <= 1

si L < 0.5 a = C; 0<=C<=1if L <0.5 a = C; 0 <= C <= 1

De esta manera, A’ (ver figura 8) será el valor final en la escala de grises, obtenido tras la segunda etapa de la conversión.In this way, A '(see figure 8) will be the final value in the gray scale, obtained after the second stage of the conversion.

En la fig. 9A se ilustra una imagen con colores cálidos y fríos diferenciados para comprobar cómo ajustar la configuración para obtener un resultado adecuado. En la fig. In fig. 9A illustrates an image with differentiated warm and cool colors to check how to adjust the settings for a suitable result. In fig.

9B, el resultado tras la primera etapa de la conversión, sin aumentar o reducir las zonas cálidas y frías. Se aprecia que la expresividad del color es baja, el amarillo destaca, y el cian y el magenta se diferencian poco. En la fig. 9C, se realiza un ajuste para obtener un resultado equilibrado, donde el naranja y el magenta destacan en niveles altos sobre el verde (que permanece en un nivel medio), y el azul y cian se reducen un poco en niveles inferiores. En las figs. 9D y 9E, se aplica un factor de realce alto para zonas cálidas y frías respectivamente. Se aprecian las diferencias de aplicar un criterio u otro y la ventaja del ajuste para obtener la conversión más adecuada dependiendo de la imagen y los objetivos, aunque es posible determinar configuraciones por defecto.9B, the result after the first stage of the conversion, without increasing or reducing the hot and cold zones. It is appreciated that the expressiveness of the color is low, yellow stands out, and cyan and magenta differ little. In fig. 9C, an adjustment is made to obtain a balanced result, where orange and magenta stand out at high levels over green (which remains at a medium level), and blue and cyan are slightly reduced at lower levels. In figs. 9D and 9E, a high enhancement factor is applied for hot and cold areas respectively. The differences of applying one criterion or another and the advantage of adjusting to obtain the most suitable conversion depending on the image and the objectives are appreciated, although it is possible to determine default settings.

En la fig. 10, se muestra la aplicación del conversor en varias cartas de color del test de Ishihara para la detección de la ceguera en el color (en la primera columna), y cómo el conversor cieY, ilustrado en la segunda columna, es incapaz de detectar las diferencias entre el color rojo y el verde, mientras que la transformación según la invención sí determina esa diferencia y muestra el número correspondiente en la tercera columna. Más concretamente: En la fig. 10A se muestra la carta 1, el número 12 es visible para todos los casos, con o sin ceguera del color. En las figs. 10B y 10C se muestran las cartas 9 y 11, donde no son visibles los números 74 y 6, cuando hay problemas en la detención de rojos y/o verdes. En la fig. 10D se muestra la carta 17, donde, si sólo es visible el 4 y poco o nada el 2, muestra problemas con el rojo, y si es al revés, con el verde. Un conversor clásico como cieY es incapaz de mostrar ninguno de los números (ver segunda columna), mientras que la presente invención lo hace en todos los casos (ver tercera columna), manteniendo, por lo tanto, las propiedades del color en la conversión.In fig. 10, the application of the converter is shown in various color charts of the Ishihara test for the detection of color blindness (in the first column), and how the CIY converter, illustrated in the second column, is unable to detect the differences between red and green, while the transformation according to the invention does determine that difference and displays the corresponding number in the third column. More specifically: In fig. 10A shows card 1, number 12 is visible for all cases, with or without color blindness. In figs. 10B and 10C show cards 9 and 11, where numbers 74 and 6 are not visible, when there are problems in stopping red and / or green. In fig. 10D shows card 17, where, if only 4 is visible and little or no 2, it shows problems with red, and if it is the other way around, with green. A classical converter like cieY is unable to display any of the numbers (see second column), whereas the present invention does so in all cases (see third column), thus maintaining the properties of the color in the conversion.

Finalmente, en la fig. 11A se muestra la imagen de la pintura «Sol naciente» de Monet. En la fig. 11B se realiza la conversión según la primera etapa de la conversión, donde se utiliza la escala jerárquica. En la fig. 11C se muestran las áreas de la imagen de las categorías cálido y frío. Después, se comparan los resultados de varios conversores: conversores con «pesos» en las figs. 11D-11G; conversores por contraste en la fig. 11H y la segunda etapa de la conversión en la fig. 11I. Si nos fijamos en el sol, que claramente destaca del resto de la imagen en color, podemos ver las diferencias entre los distintos conversores. De una manera general, del resto de conversores, sólo el que utiliza el contraste local, color2gray como muestra la fig. 11H, consigue que aparezca en la conversión destacado. Si vemos la conversión de la primera etapa, el resultado es mejor que los demás conversores de «pesos» (se destaca algo más), pero es inferior al de contraste Color2gray de la fig. 11H, pero al aplicar las categorías cálido-frío de la segunda etapa de la conversión mejora el resultado (se destaca del fondo claramente) como se aprecia en la fig. 111. Además, si nos fijamos en el resto de elementos donde hay menos contraste local (sobre todo los barcos del fondo), color2gray de la fig. 11H apenas los diferencia, mientras que aplicando la presente invención, como prueba la fig.Finally, in fig. 11A shows the image of the painting "Rising Sun" by Monet. In fig. 11B the conversion is carried out according to the first stage of the conversion, where the hierarchical scale is used. In fig. 11C shows the image areas of the warm and cold categories. Next, the results of various converters are compared: converters with "weights" in figs. 11D-11G; contrast converters in fig. 11H and the second stage of the conversion in FIG. 11I. If we look at the sun, which clearly stands out from the rest of the color image, we can see the differences between the various converters. In a general way, of the rest of the converters, only the one that uses the local contrast, color2gray as shown in fig. 11H, get it to appear in the featured conversion. If we see the conversion of the first stage, the result is better than the other converters of «pesos» (something else stands out), but it is lower than contrast Color2gray of FIG. 11H, but applying the warm-cold categories of the second stage of the conversion improves the result (it stands out from the background clearly) as shown in fig. 111. Furthermore, if we look at the rest of the elements where there is less local contrast (especially the boats in the background), color2gray in fig. 11H hardly differentiates them, while applying the present invention, as evidenced by fig.

11I, sí.11I, yes.

La utilidad práctica de la presente invención es muy considerable. Se puede implementar tanto en hardware como en software en cámaras digitales, aplicaciones de móviles, tabletas y ordenadores, para el tratamiento de imágenes y la edición de las mismas en el análisis científico y también con fines creativos y artísticos. Además, su campo de acción se puede extender a la visión artificial y en general a aplicaciones donde sea necesario obtener una representación en escala de grises sin perder las propiedades básicas del color de luminosidad, matiz y saturación, e incluso donde existan problemas de detección del color (acromatopsia, discromatopsia, en especial el daltonismo: protanopia, deuteronopsia, etc.).The practical utility of the present invention is very considerable. It can be implemented in both hardware and software in digital cameras, mobile applications, tablets and computers, for the treatment of images and their editing in scientific analysis and also for creative and artistic purposes. In addition, its field of action can be extended to artificial vision and in general to applications where it is necessary to obtain a representation in gray scale without losing the basic properties of the color of luminosity, hue and saturation, and even where there are problems of detection of the color (achromatopsia, dyschromatopsia, especially color blindness: protanopia, deuteronopsia, etc.).

De una manera global y comparativa con otras soluciones, esta invención tiene como mejoras técnicas:In a global and comparative way with other solutions, this invention has as technical improvements:

• En relación a los conversores que van pixel a pixel: mantiene en la conversión las propiedades de luminosidad, matiz y saturación, lo cual se puede demostrar aplicando el test de Ishihara sobre la ceguera del color, donde el conversor pasa las pruebas (ver figura 10).• In relation to converters that go pixel to pixel: it maintains in the conversion the properties of luminosity, hue and saturation, which can be demonstrated by applying the Ishihara test on color blindness, where the converter passes the tests (see figure 10).

• En relación a los conversores que evalúan el contraste: al evaluar pixel a pixel, el rendimiento se mejora, obteniendo resultados similares en la conversión (ver figura 11).• In relation to the converters that evaluate contrast: when evaluating pixel by pixel, performance is improved, obtaining similar results in conversion (see figure 11).

En la fig. 12 se ilustra un ejemplo de diagrama de bloques funcionales de un sistema que implementa la invención. El sistema puede ser implementado en ordenador, entendiéndose en sentido amplio cualquier dispositivo electrónico con capacidad de proceso y de almacenamiento digital (por ejemplo, una FPGA).In fig. 12 an example functional block diagram of a system implementing the invention is illustrated. The system can be implemented in a computer, understood in a broad sense any electronic device with digital storage and processing capacity (for example, an FPGA).

El sistema para convertir una imagen digital en color a una imagen digital en escala de grises dispone de una unidad de entrada 32 que obtiene a partir de píxeles de una imagen en color 31, el valor de cada píxel en los tres canales primarios R 33, G 34, y B 35. El sistema cuenta con una unidad de proceso 46, que puede incluir un microprocesador, para realizar las tareas y operaciones de conversión. En concreto, la arquitectura funcional de la unidad de proceso 46 puede incorporar un módulo de conversión de canales 36 y un módulo de cómputo de actividad 41.The system for converting a digital color image to a digital grayscale image has an input unit 32 that obtains, from pixels of a color image 31, the value of each pixel in the three primary channels R 33, G 34, and B 35. The system has a process unit 46, which may include a microprocessor, to carry out conversion tasks and operations. Specifically, the functional architecture of the processing unit 46 may incorporate a channel conversion module 36 and an activity counting module 41.

El módulo de conversión de canales 36 normaliza los tres canales primarios R, G, y B para obtener el correspondiente canal normalizado L 37, M 38 , y S 39. 32 también genera un cuarto canal LM 40 sumando, con saturación a 1, los canales primarios normalizados L 37 y M 38.The channel conversion module 36 normalizes the three primary channels R, G, and B to obtain the corresponding normalized channel L 37, M 38, and S 39. 32 also generates a fourth channel LM 40 by adding, with saturation to 1, the L 37 and M 38 normalized primary canals.

En la unidad de proceso 46, el valor en escala de grises se obtiene inicialmente como la suma ponderada de los cuatro canales 37-40 y, para conseguir mayor calidad en la conversión, como se ha indicado anteriormente, se incrementa el valor cuando el canal normalizado L 37 es mayor que 0.5 y se decrementa cuando es menor que 0.5. Una interfaz de usuario 42 permite introducir valores de las constantes W, C. La constante W modifica el contraste para los colores cálidos de la imagen 31, mientras que la constante C lo hace para colores fríos. Estas constantes se transmiten al módulo de cómputo de actividad 41 de la unidad de proceso 46 para realizar las operaciones ya indicadas en las ecuaciones anteriores.In the processing unit 46, the gray scale value is initially obtained as the weighted sum of the four channels 37-40 and, to achieve higher quality in the conversion, as indicated above, the value is increased when the channel normalized L 37 is greater than 0.5 and decreases when it is less than 0.5. A user interface 42 allows you to enter values for the constants W, C. The constant W modifies the contrast for the warm colors of the image 31, while the constant C modifies the contrast for cool colors. These constants are transmitted to the activity counting module 41 of the processing unit 46 to carry out the operations already indicated in the previous equations.

El sistema dispone además de una unidad de salida 44 para reproducir el valor de actividad de gris calculado en la unidad de proceso 46 para los píxeles de la imagen en color original 31 y con ello puede mostrar una imagen en escala de grises 43. The system also has an output unit 44 for reproducing the gray activity value calculated in the processing unit 46 for the pixels of the original color image 31 and can thereby display a grayscale image 43.

Esquema del algoritmoAlgorithm scheme

Image=new OBimage('RGB'); //objeto imagen en RGB, es la imagen de entradaImage = new OBimage ('RGB'); // image object in RGB, is the input image

imagen_grayscale=new OBimage('grayscale'); //objeto imagen en escala de grises, es la imagen de salidaimage_grayscale = new OBimage ('grayscale'); // grayscale image object, is the output image

for(_i=0;_i<image.width;_i++){for (_i = 0; _i <image.width; _i ++) {

for(_j=0;_j<image.height;_j++){for (_j = 0; _j <image.height; _j ++) {

_pixel=getPixel(image.data, _i,_j); //función para extraer los canales RGB del pixel_pixel = getPixel (image.data, _i, _j); // function to extract the RGB channels from the pixel

//1. extraer los valores RGB y pasarlos a L,M,LM y S//one. extract RGB values and pass them to L, M, LM and S

L=_pixel.rgb.R/255; '/canal R normalizado en el intervalo[0,1]L = _pixel.rgb.R / 255; '/ R channel normalized in the interval [0,1]

M=_pixel.rgb.G/255; //canal G normalizado en el intervalo[0,1]M = _pixel.rgb.G / 255; // G channel normalized in the interval [0,1]

S=_pixel.rgb.B/255; //canal B normalizado en el intervalo[0,1]S = _pixel.rgb.B / 255; // channel B normalized in the interval [0,1]

LM=max(L+M,1);LM = max (L + M, 1);

//2. calcular el valor A para L,M,LM y S//two. calculate the A value for L, M, LM and S

A=(L+M+S+LM)/4; //valor AA = (L + M + S + LM) / 4; // value A

//3. calcular el valor A' para L,M,LM y S//3. calculate the value A 'for L, M, LM and S

//3.1 Establecer las constantes W y C//3.1 Set the constants W and C

W=0.8; //por ejemplo un valor altoW = 0.8; // for example a high value

C=0.2; //po r ejemplo un valor bajoC = 0.2; // for example a low value

//3.2 Determinar la categoría de color: cálido o frío, y su nivel.//3.2 Determine the color category: warm or cold, and its level.

if(L>0.5) then a=W else a=C;if (L> 0.5) then a = W else a = C;

//3.3 Aplicar la ecuación 2 que amplía(cálido) o reduce (frío) el valor A A'=max(min(A+(_rangeC*((1/(1+exp(-3*((2*L)-1))))-0.5))),1),0);//3.3 Apply equation 2 that extends (warm) or reduces (cold) the value A A '= max (min (A + (_ rangeC * ((1 / (1 + exp (-3 * ((2 * L) - 1)))) - 0.5))), 1), 0);

//4. Cargar valor A' en la imagen//4. Load value A 'in image

_pixel.grayscale=A'*255; //pasar al valor de pixeles en la escala 0-255 putPixel(imagen_grayscale.data, _pixel.grayscale, _i,_j); //función para cargar el valor del pixel }_pixel.grayscale = A '* 255; // pass to the value of pixels in the scale 0-255 putPixel (imagen_grayscale.data, _pixel.grayscale, _i, _j); // function to load the pixel value}

} }

BibliografíaBibliography

[1] R. Arnheim, Art and visual perception: A psychology of the Creative eye, Univ of California Press, 1956.[1] R. Arnheim, Art and visual perception: A psychology of the Creative eye, Univ of California Press, 1956.

[2] D. A. Dondis, A primer of visual literacy, Mit Press, 1974.[2] D. A. Dondis, A primer of visual literacy, Mit Press, 1974.

[3] E. H. Gombrich, Illusion and art. A study in the psychology of pictorial representation, Oxford, 1959.[3] E. H. Gombrich, Illusion and art. A study in the psychology of pictorial representation, Oxford, 1959.

[4] I. Newton, Optics: or a treatise of the refections, refractions, inflections and colours of light, William Innys at the West-End of St. Paul’s, 1730.[4] I. Newton, Optics: or a treatise of the refections, refractions, inflections and colors of light, William Innys at the West-End of St. Paul’s, 1730.

[5] J. W. Goethe, Theory of colours, MIT press, 1840.[5] J. W. Goethe, Theory of colors, MIT press, 1840.

[6] A. Schopenhauer, On Vision and Colors, Pricenton Architectural Press, 2010.[6] A. Schopenhauer, On Vision and Colors, Pricenton Architectural Press, 2010.

[7] H. V. Helmholtz, "LXXXI. on the theory of compound colours," Philosophical Magazine A, vol. 4, pp. 519-534, 1852.[7] H. V. Helmholtz, "LXXXI. On the theory of compound colors," Philosophical Magazine A, vol. 4, pp. 519-534, 1852.

[8] E. Hering, Ueber individuelle Verschiedenheiten des Farbensinnes, 1885.[8] E. Hering, Ueber individuelle Verschiedenheiten des Farbensinnes, 1885.

[9] J. Pawlik, Theorie der Farbe, 1976.[9] J. Pawlik, Theorie der Farbe, 1976.

[10] P. O. Runge, Color Sphere, Pricenton Architectural Press, 2010.[10] P. O. Runge, Color Sphere, Pricenton Architectural Press, 2010.

[11] A. H. Munsell, Atlas of the Munsell color system, Wadsworth, Howland & Company, Incorporated, Printers., 1915.[11] A. H. Munsell, Atlas of the Munsell color system, Wadsworth, Howland & Company, Incorporated, Printers., 1915.

[12] H. Kueppers, The basic law of color theory, Barrons Educational Series Incorporated., 1982.[12] H. Kueppers, The basic law of color theory, Barrons Educational Series Incorporated., 1982.

[13] B. Berlin and P. Kay, Basic color terms: Their universality and evolution, 1991.[13] B. Berlin and P. Kay, Basic color terms: Their universality and evolution, 1991.

[14] E. Rosch, "The nature of mental codes for color categories," Journal of experimental psychology: Human perception and performance, vol. 1, p. 303, 1975.[14] E. Rosch, "The nature of mental codes for color categories," Journal of experimental psychology: Human perception and performance, vol. 1 p. 303, 1975.

[15] D. Teller, "Vision and the Visual System," E. John Palmer, Ed., 2014.[15] D. Teller, "Vision and the Visual System," E. John Palmer, Ed., 2014.

[16] R. Bala and R. Eschbach, "Spatial color-to-grayscale transform preserving chrominance edge information," Color and Imaging Conference, vol. 1, pp. 82-86, 2004.[16] R. Bala and R. Eschbach, "Spatial color-to-grayscale transform preserving chrominance edge information," Color and Imaging Conference, vol. 1, pp. 82-86, 2004.

[17] J. G. Kuk, J. H. Ahn and N. I. Cho, "A color to grayscale conversion considering local and global contrast," Asian Conference on Computer Vision, pp. 513-524.[17] J. G. Kuk, J. H. Ahn and N. I. Cho, "A color to grayscale conversion considering local and global contrast," Asian Conference on Computer Vision, pp. 513-524.

[18] A. A. Gooch, S. C. Olsen, J. Tumblin and B. Gooch, "Color2gray: saliencepreserving color removal," ACM Trans. on Graphics, vol.24, pp.634-639, 2005. [18] A. A. Gooch, S. C. Olsen, J. Tumblin and B. Gooch, "Color2gray: salience preserving color removal," ACM Trans. on Graphics, vol.24, pp.634-639, 2005.

Claims (6)

REIVINDICACIONES 1. Método implementado en ordenador para convertir una imagen digital en color (31) a una imagen digital en escala de grises (43) que comprende los pasos:1. Computer-implemented method to convert a digital color image (31) to a digital grayscale image (43) comprising the steps: - obtener, para una pluralidad de píxeles de la imagen en color (31), el valor de cada píxel en los tres canales R, G, y B (33,34,35);- obtaining, for a plurality of pixels of the color image (31), the value of each pixel in the three channels R, G, and B (33,34,35); - normalizar los tres canales primarios R, G, y B para obtener los canales normalizados L, M, y S (37,38,39);- normalize the three primary channels R, G, and B to obtain the normalized channels L, M, and S (37,38,39); - generar un cuarto canal normalizado adicional LM (40) mediante la suma con saturación de los canales L (37) y M (38), donde la suma con saturación es la suma del canal L (37) y del canal M (38), si dicha suma es menor que la unidad, o la unidad en caso contrario;- generate an additional fourth normalized channel LM (40) by adding the channels L (37) and M (38) with saturation, where the sum with saturation is the sum of the L channel (37) and the M channel (38) , if said sum is less than unity, or unity otherwise; - determinar la actividad, A, como el valor de cada píxel en una escala de grises de acuerdo con los valores de los canales L, M, S y LM (37,38,39,40);- determining the activity, A, as the value of each pixel in a gray scale according to the values of the L, M, S and LM channels (37,38,39,40); - determinar el valor final de cada píxel, A', en la imagen de escala de grises (43), sobreponderando la actividad A para colores cálidos si L es mayor que 0.5, e infraponderando la actividad A en caso contrario, para colores fríos si L es menor o igual que 0.5.- determine the final value of each pixel, A ', in the grayscale image (43), overweighting activity A for warm colors if L is greater than 0.5, and underweighting activity A otherwise, for cold colors if L is less than or equal to 0.5. 2. Método, según la reivindicación 1, donde, para calcular el valor final en escala de 2. Method according to claim 1, where, to calculate the final scale value of grises, se aplica una función A' = max( m in(
Figure imgf000018_0001
grays, a function A '= max (m in (
Figure imgf000018_0001
donde A = ------$------ donde LM = m in(L M, 1), donde el valor del parámetro a se corresponde con una de las constantes, W: para modificar el contraste en la región de colores cálidos en la imagen (31), o C: para modificar el contraste en la región de colores fríos en la imagen (31); de forma que se cumple:where A = ------ $ ------ where LM = m in (LM, 1), where the value of the parameter a corresponds to one of the constants, W: to modify the contrast in the region of warm colors in the image (31), or C: to modify the contrast in the region of cold colors in the image (31); so that: si L > 0.5 a = / ; 0<=W <=1; y si L < 0.5 a = C ; 0<=C<=1.if L> 0.5 a = /; 0 <= W <= 1; and if L <0.5 a = C; 0 <= C <= 1.
3. Sistema para convertir una imagen digital en color (31) a una imagen digital en escala de grises (43) que comprende:3. System to convert a digital color image (31) to a digital image in grayscale (43) comprising: - una unidad de entrada (32) configurada para obtener, para una pluralidad de píxeles de la imagen en color (31), el valor de cada píxel en los tres canales R, G, y B (33,34,35); - una unidad de proceso (46) configurada para:- an input unit (32) configured to obtain, for a plurality of pixels of the color image (31), the value of each pixel in the three channels R, G, and B (33,34,35); - a processing unit (46) configured to: - normalizar los tres canales primarios R, G, y B para obtener los canales normalizados L, M, y S (37,38,39); - normalize the three primary channels R, G, and B to obtain the normalized channels L, M, and S (37,38,39); - generar un cuarto canal normalizado adicional LM (40) mediante la suma con saturación del canal L (37) y del canal M (38), donde la suma con saturación es la suma del canal L (37) y del canal M (38), si dicha suma es menor que la unidad, o la unidad en caso contrario;- generate a fourth additional normalized channel LM (40) by adding saturation of channel L (37) and channel M (38), where the sum with saturation is the sum of channel L (37) and channel M (38 ), if said sum is less than unity, or unity otherwise; - determinar la actividad, A, de cada píxel de acuerdo con los valores de los canales L, M, S y LM (37,38,39,40) como un valor de escala de grises inicial; - determinar el valor final de cada píxel, A', en la imagen de escala de grises (43), sobreponderando la actividad A, para colores cálidos si L es mayor que 0.5, e infraponderando la actividad A, en caso contrario, para colores fríos.- determining the activity, A, of each pixel according to the values of the L, M, S and LM channels (37,38,39,40) as an initial gray scale value; - determine the final value of each pixel, A ', in the grayscale image (43), overweighting activity A, for warm colors if L is greater than 0.5, and underweighting activity A, otherwise, for colors cold. - una unidad de salida (44) configurada para mostrar la imagen en escala de grises (43).- an output unit (44) configured to display the grayscale image (43). 4. Sistema según la reivindicación 3, donde para calcular el valor de cada píxel en escala de grises se modifica el valor de actividad A según una función A':4. System according to claim 3, wherein to calculate the value of each pixel in grayscale, the activity value A is modified according to a function A ': A' = max( m in( A (a * ( i+e_31(2¿_1) - ° .5) ) , V), 0 )A '= max (m in (A (a * (i + e_31 (2¿_1) - ° .5)), V), 0) donde A = LM+L$+M+S , donde LM = m in(L M, 1), donde el valor del parámetro a se corresponde con una de las constantes, W: para modificar el contraste de regiones con colores cálidos en la imagen de color (31), o C: para modificar el contraste en regiones con colores fríos; de forma que se cumple:where A = LM + L $ + M + S, where LM = m in (LM, 1), where the value of the parameter a corresponds to one of the constants, W: to modify the contrast of regions with warm colors in the color image (31), or C: to modify the contrast in regions with cold colors; so that: si L > 0.5 a = / ; 0<=W <=1; y si L < 0.5 a = C ; 0<=C<=1.if L> 0.5 a = /; 0 <= W <= 1; and if L <0.5 a = C; 0 <= C <= 1. 5. Sistema según la reivindicación 4, que comprende además una interfaz de usuario (42) para recibir e introducir los valores de las constantes W, C y para transmitirlos a la unidad de proceso (46).System according to claim 4, further comprising a user interface (42) for receiving and inputting the values of the constants W, C and for transmitting them to the processing unit (46). 6. Producto de programa informático para ordenador que comprende instrucciones para llevar a cabo el método definido en las reivindicaciones 1 o 2, cuando las instrucciones del programa se ejecutan en un procesador de un ordenador. A computer program product comprising instructions for carrying out the method defined in claims 1 or 2, when the program instructions are executed on a processor of a computer.
ES201831253A 2018-12-20 2018-12-20 METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE Active ES2774013B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
ES201831253A ES2774013B2 (en) 2018-12-20 2018-12-20 METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
ES201831253A ES2774013B2 (en) 2018-12-20 2018-12-20 METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE

Publications (2)

Publication Number Publication Date
ES2774013A1 true ES2774013A1 (en) 2020-07-16
ES2774013B2 ES2774013B2 (en) 2021-08-11

Family

ID=71528135

Family Applications (1)

Application Number Title Priority Date Filing Date
ES201831253A Active ES2774013B2 (en) 2018-12-20 2018-12-20 METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE

Country Status (1)

Country Link
ES (1) ES2774013B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0500327A2 (en) * 1991-02-20 1992-08-26 Canon Kabushiki Kaisha Image processing apparatus
US20100254601A1 (en) * 2009-04-03 2010-10-07 Hong Kong Baptist University Method and device for use in converting a colour image into a grayscale image
US20110110584A1 (en) * 2009-11-09 2011-05-12 Peter Majewicz Method And Apparatus For Converting A Color Image To Grayscale
CN106856001A (en) * 2016-12-08 2017-06-16 彭志勇 The store method of gray level image and the acquisition methods of gray level image original pixels
CN108230405A (en) * 2017-11-30 2018-06-29 中原智慧城市设计研究院有限公司 Image white balancing treatment method based on gray processing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0500327A2 (en) * 1991-02-20 1992-08-26 Canon Kabushiki Kaisha Image processing apparatus
US20100254601A1 (en) * 2009-04-03 2010-10-07 Hong Kong Baptist University Method and device for use in converting a colour image into a grayscale image
US20110110584A1 (en) * 2009-11-09 2011-05-12 Peter Majewicz Method And Apparatus For Converting A Color Image To Grayscale
CN106856001A (en) * 2016-12-08 2017-06-16 彭志勇 The store method of gray level image and the acquisition methods of gray level image original pixels
CN108230405A (en) * 2017-11-30 2018-06-29 中原智慧城市设计研究院有限公司 Image white balancing treatment method based on gray processing

Also Published As

Publication number Publication date
ES2774013B2 (en) 2021-08-11

Similar Documents

Publication Publication Date Title
Zhang et al. Underwater image enhancement via extended multi-scale Retinex
Jefferson et al. Accommodating color blind computer users
Rizzi et al. From retinex to automatic color equalization: issues in developing a new algorithm for unsupervised color equalization
Rockcastle et al. Contrast measures for predicting perceptual effects of daylight in architectural renderings
Čadík et al. Evaluation of HDR tone mapping methods using essential perceptual attributes
WO2018201662A1 (en) Lip color rendering method, apparatus, and electronic device
EP2798830B1 (en) Spectral synthesis for image capture device processing
JP2016512613A (en) Method and apparatus for color rendering
Ananto et al. Color transformation for color blind compensation on augmented reality system
Yeonan-Kim et al. Retinal lateral inhibition provides the biological basis of long-range spatial induction
Provenzi Computational Color Science: Variational Retinex-like Methods
Albers et al. An independent contribution of colour to the aesthetic preference for paintings
Durmus Spatial frequency and the performance of image-based visual complexity metrics
JP6765519B2 (en) Color processing program, color processing method, color sensation inspection system, output system, color vision correction image processing system and color vision simulation image processing system
US9426333B2 (en) Illusion analyzing apparatus, apparatus for generating illusion-considered image for which illusion is taken into consideration to allow perception according to original image, illusion analyzing method, method of generating illusion-considered image for which illusion is taken into consideration to allow perception according to original image, and program
Meylan Tone mapping for high dynamic range images
ES2774013B2 (en) METHOD AND SYSTEM TO CONVERT A DIGITAL IMAGE FROM COLOR TO GRAY SCALE
CN112215808A (en) Method and related device for generating human face skin sensitive image
Spieringhs et al. Road marking contrast threshold revisited
Ulucan et al. BIO-CC: Biologically inspired color constancy.
JP6949795B2 (en) Image processing equipment, image processing system, image processing method, and program
Provenzi A differential geometry model for the perceived colors space
Rathee et al. Daltonizer: a CNN-based framework for monochromatic and dichromatic color-blindness
Simon-Liedtke et al. Multiscale daltonization in the gradient domain
CN112686800B (en) Image processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
BA2A Patent application published

Ref document number: 2774013

Country of ref document: ES

Kind code of ref document: A1

Effective date: 20200716

FG2A Definitive protection

Ref document number: 2774013

Country of ref document: ES

Kind code of ref document: B2

Effective date: 20210811