processing images

UESTC uestc-gla 2017 盛以恒

The main purpose of processing images is threefold:
(1) Improve the visual quality of the image, such as brightness, color conversion, enhancement, suppression of certain components, geometric transformation of the image, etc., to improve the image quality.

(2) Extracting certain features or special information contained in the image, which are often convenient for computer analysis of images. The process of extracting features or information is a pre-processing of computer or computer vision. The extracted features may include many aspects such as frequency domain features, grayscale or color features, boundary features, region features, texture features, shape features, topological features, and relationship structures.

(3) Transformation, encoding and compression of image data to facilitate image storage and transmission. Regardless of the purpose of image processing, an image processing system composed of a computer and an image-dedicated device is required to input, process, and output image data. Digital image processing

  1. Digitization of images A sample that exists in its natural form is transformed into a digital form suitable for computer processing by sampling and quantification. The various forms of the image are represented in the form of a matrix.

  2. The purpose of the image is to compress the amount of information on the image without changing the quality of the image to meet the requirements of transmission and storage. The coding mostly uses digital coding technology to process the image point by point.

3, image enhancement and recovery

The purpose of image enhancement is to transform the image into a form that is more suitable for human and machine analysis. Commonly used enhancement methods are: gray level histogram processing; interference rejection; edge sharpening; pseudo color processing.

The purpose of image restoration is the same as image enhancement. The main principle is to eliminate or reduce image damage and degradation caused by image acquisition and transmission, including image blur, image interference and noise, etc. Real image.

Regardless of image enhancement or image restoration, all pixels of the entire image must be operated. For the large number of image pixels, the calculation is also very large.

The purpose of encoding is to compress the amount of information of an image without changing the quality of the image to meet the requirements of transmission and storage. The coding mostly uses digital coding technology to process the image point by point.

  1. Image segmentation Image segmentation is the division of images into non-overlapping regions. Each region is a contiguous set of pixels. Using the texture characteristics of the image, the image is segmented by dividing the pixels into specific regions and seeking boundaries between the regions.

  2. Image analysis

Extract some useful metrics, data, and information from the image to a numerical result. Image analysis The image segmentation method extracts the features of the image and then symbolizes the image. This description not only answers the image whether a specific object exists, but also describes the image content in detail.

There are three methods to process the images:
(1) Average method

The average values of the luminances of the three components R, G, and B corresponding to each pixel point are respectively obtained, and then the average value in the color image can be given to the three components of red, green, and blue, so that a grayscale image can be obtained. It is equivalent to taking the weights of the three components of red, green, and blue, so that while reducing the amount of computation, it can also convert floating-point operations into integer operations.

(2) Component method

The gray values of the three grayscale images of red, green and blue can be determined by the brightness of the three components R, G and B in the color image, and a grayscale image is selected according to actual needs, for example, when considering the red component, You can think of the weight of the red component in the grayscale image formula as 1, and the weight of the blue and green components as 0, as well as other components.

(3) Maximum method

The maximum value of the three component luminances of the R, G, and B in the color image is used as the gray value of the grayscale image, so that the three component values of the red, green, and blue colors of the color are equal and maximum [3]. The weight of the maximum method is not fixed during the change process, and the speed is faster. But it can make the compatibility of the computer processing images larger, and finally make the image clearer.

With images process, we can see small things with Cryo-electron microscope. And Currently used in the medical field is medical image segmentation technology.

这是一个 PyTorch 中的数据集类,用于加载并处理 ImageNet 数据集。下面是对该类中各个方法的解释: - `__init__(self, config=None):` 构造函数,接受一个配置参数 `config`,默认为 `None`。如果 `config` 为 `None`,则使用 `OmegaConf.create()` 创建一个空配置。如果 `config` 不是字典类型,则使用 `OmegaConf.to_container` 将其转换为字典类型。然后设置 `self.keep_orig_class_label` 为 `config` 中的 `keep_orig_class_label` 值,如果没有指定则为 `False`。设置 `self.process_images` 为 `True`,表示需要加载和处理图像数据。最后,调用 `_prepare()`、`_prepare_synset_to_human()`、`_prepare_idx_to_synset()`、`_prepare_human_to_integer_label()` 和 `_load()` 方法进行数据集的准备和加载。 - `_prepare(self):` 准备数据集,设置数据集路径、文件名、数据集大小等参数。如果数据集路径不存在,则会抛出异常。 - `_prepare_synset_to_human(self):` 准备同义词集到类别名称的映射。使用 `synset2name` 函数从 `config` 中指定的 YAML 文件中加载同义词集到类别名称的映射,并将其保存在 `self.synset_to_human` 字典中。 - `_prepare_idx_to_synset(self):` 准备索引到同义词集的映射。使用 `synset2idx` 函数从 `config` 中指定的 YAML 文件中加载同义词集到索引的映射,并将其保存在 `self.idx_to_synset` 字典中。 - `_prepare_human_to_integer_label(self):` 准备类别名称到整数标签的映射。遍历 `self.synset_to_human` 字典,为每个类别名称分配一个唯一的整数标签,并将其保存在 `self.human_to_integer_label` 字典中。 - `_load(self):` 加载数据集。如果 `self.process_images` 为 `False`,则不会加载和处理图像数据,而是只使用文件路径。否则,使用 `PIL.Image.open` 加载图像,并使用 `self.transform` 对其进行数据增强和预处理,然后将其保存在 `self.data` 和 `self.targets` 中。如果 `self.keep_orig_class_label` 为 `True`,则将类别名称保存在 `self.classes` 中,否则将整数标签保存在 `self.classes` 中。 这些方法在数据集的准备和加载过程中发挥了重要作用。在将数据集传递给模型进行训练或推理之前,需要调用这些方法来确保数据集正确加载,并且每个样本都有正确的标签和预处理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值