简体   繁体   English

使用3种技术使用MATLAB进行数字图像处理

[英]Digital image processing with MATLAB using 3 techniques

I have a homework in MATLAB. 我在MATLAB中做了一个功课。 I must use 3 image processing techniques. 我必须使用3种图像处理技术。 So I should make a task and then solve it using 3 techniques(for example, thresholding, segmentation, morphology, restoration, histogram equalization, noise remove...). 所以我应该完成一项任务,然后使用3种技术解决它(例如,阈值处理,分割,形态学,恢复,直方图均衡,噪声消除......)。 I need some idea and how to solve it, will you help me? 我需要一些想法以及如何解决它,你会帮助我吗? :) :)

Thank you. 谢谢。

  • In edition: 在版本中:

I have found this in some book....Do you have any idea? 我在一本书中发现了这个......你有什么想法吗? Is it possible to restore picture a to picture i ? 是否有可能恢复一个图片到图片

Note : Some solution is indicated below.But to tell the truth I didn't understand :( Can you explain it to me? 注意 :有些解决方案如下所示。但说实话我不明白:(你能解释一下吗?

解??

You could for example try to isolate an object by three different methods. 例如,您可以尝试通过三种不同的方法隔离对象。

Let's do this in Mathematica. 我们在Mathematica中这样做。 (MATLAB is your homework). (MATLAB是你的功课)。

Let's call our image i : 我们打电话给我们的形象

i = 我= 在此输入图像描述

And let's try to isolate a mask called mask : 让我们尝试隔离一个名为mask的掩码

mask = mask = 在此输入图像描述

See the example codes: 请参阅示例代码:

(* First Method, by Image Correlation*)
x = ImageCorrelate[ i, mask, EuclideanDistance];
r = Position[ImageData@Binarize[x, 0.2], 0, Infinity];
(*Show that we found the right spot *)
ImageCompose[i, 
 ColorNegate@
  mask, {0, Dimensions[ImageData[i]][[1]]} - {-1, 1} Reverse[r[[1]]]]

Result: 结果:

在此输入图像描述

(* Second method, separating channels, 
   thresholding and deleting small components*)

r = DeleteSmallComponents@Binarize[#, .99] &@
   ColorNegate[ColorSeparate[i][[3]]];
ImageMultiply[i, r]

Result: 结果:

在此输入图像描述

(* Third method, extracting the exact color *)
Image[ImageData[i] /. {1., 0.6, 0.} -> {a} /. {_, _, _} -> {0, 0,0} /. 
                                       {a} -> {1., 0.6, 0.}]  

Result: 结果:

在此输入图像描述

HTH! HTH!

I am giving a try to the images you posted in the edit. 我正在尝试您在编辑中发布的图像。 The results are not perfect, but this is an approximation. 结果并不完美,但这是近似值。 Finding the right filters may take a while. 找到合适的过滤器可能需要一段时间。

First applying a Laplacian filter to remove noise, you get: 首先应用拉普拉斯滤波器去除噪声,你会得到:

TotalVariationFilter[image, 1, Method -> "Laplacian"]  

在此输入图像描述

And then you have to deconvolve the diagonal motion blur. 然后你必须去对角运动模糊去卷积。 You need a kernel like this one : 你需要一个像这样的内核:

在此输入图像描述

Which, when applied to the de-noised image gives: 当应用于去噪图像时,给出:

ImageDeconvolve[denoisedImage, kernel, Method -> "RichardsonLucy", 
 MaxIterations -> 15]

在此输入图像描述

The image is not perfect, but I hope this gives you an idea of what can be done. 图像并不完美,但我希望这可以让您了解可以做些什么。

Restoration of this picture is very difficult... So I decided to change the task. 恢复这张照片非常困难......所以我决定改变任务。

The task and solution are discussed here: 这里讨论任务和解决方案:

http://geogeeks.net/2011/03/18/digital-image-processing-using-matlab/ http://geogeeks.net/2011/03/18/digital-image-processing-using-matlab/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM