Use MATLAB for image processing

Source: Internet
Author: User

Write this articleArticleThe purpose is not to recommend a software, butProgramPersonnel, as long as we change our thinking, we can take advantage of our professional advantages in many places, not just to help mm to kill viruses in our spare time, but to install the system to show our professionalism and uniqueness; secondly, I hope to summarize myself through the form of sharing. If it is useful to one or two friends at the same time, it will be even more gratifying.

When it comes to image processing software, most people first think of Photoshop. The power of Photoshop is without question, and Photoshop is the best choice for most users. But for us all dayCodeA more effective tool for dealing with people is Matlab. When it comes to MATLAB, there may not be many people who know it, that is, many people who have used it as a mathematical tool, but those who are engaged in image research know that, MATLAB is far more powerful in image processing than Photoshop. But why are there so few users? The reason is simple: there is no visualized operation interface, and all processing must be done through function calls. This is an insurmountable obstacle for general users, but it is not a problem for programmers.

Before you begin to introduce how to use MATLAB for common image processing, let's take a look at the following issues:

1. The differences between MATLAB and Photoshop are similar to those in Linux and Windows. Therefore, if you are not familiar with command operations, please skip this article.

2. Like all software, Matlab requires a period of learning to be familiar with it. Because there is no visual graphic operation interface, many may think it is difficult. My own experience is that for programmers, it will never take more time to master the most basic MATLAB Image Processing than to learn Photoshop, once you have mastered the method, you will find it a great thing. More importantly, you can use your own programming capabilities to do something interesting.

3. What makes MATLAB powerful is that it can accurately operate on each area or even pixel of an image, which requires a certain foundation for image processing, just like playing Linux, if you have a certain understanding of the kernel, it will be easier to play, but believe me, this is far from as difficult as you think.

Below are some image processing functions that are frequently used in MATLAB:

Read image: IMG = imread ('filename'); // supports file formats such as tiff, JPEG, GIF, BMP, PNG, and xwd.

Display image: imshow (IMG, g); // G indicates the gray level of the image. If this parameter is omitted, the default value is 256.

Save the image: imwrite (IMG, 'filename'); // The GIF format is not supported. Others are the same as imread.

Brightness conversion: imadjust (IMG, [low_in, high_in], [low_out, high_out]); // maps values between low_in and high_in to low_out and high_out, return to zero if low_in or lower than high_in.

Draw a histogram: imhist (IMG );

Histogram equalization: histeq (IMG, newlevel); // newlevel indicates the specified gray level of the output image.

Image smoothing and sharpening (spatial filtering): W = fspecial ('type', parameters); imfilter (IMG, W); // the combination of these two functions will become very powerful, any filters in Photoshop can be implemented.

Image Restoration: deconvlucy (IMG, PSF); // It can be used for image noise reduction and deblurring.

The above are the most basic operations. It seems to be just a few simple functions, but it actually contains a lot of Photoshop functions. For example, the filter functions in Photoshop can be implemented using imfilter, I will introduce more features and usage in future articles. If you want to know how to use MATLAB to implement various functions in Photoshop, you can leave a message below or send it to me. I will try my best to help you.

I didn't expect this article to attract so much controversy. It seems that I didn't express my meaning clearly. I have already explained it in the comments, but some friends haven't seen it yet, I have to explain it here.

1. This article does not mean to belittle Photoshop. I am the fans of Photoshop myself. I dare not speak to Photoshop, but at least I am an old bird, I have a deeper understanding of Photoshop than most people, and most of itAlgorithmI have studied it carefully.

2. My intention is not to compare the advantages and disadvantages of MATLAB with Photoshop or other image processing software. I just want to express a point of view. As a programmer, we can have different practices for the same thing. In terms of image processing, Matlab and Photoshop both have their own irreplaceable features, but at the same time there are many commonalities. Using MATLAB does not mean that Photoshop should be abandoned, this is like installing another Linux instance when you are using Windows. They are not in conflict. You can enjoy the convenience of Photoshop operations, experience the differences between MATLAB, and even use your own programming capabilities to build more distinctive tools. The main job of programmers is to deal with various types of software. If we can think more and see more further when using or developing these software, will there be more opportunities?

 

3. I would like to say a few more words about MATLAB. Some of my friends commented that MATLAB is only used in scientific computing and is not suitable for image processing. This can only be said that these friends are not familiar with MATLAB or image processing, you just need to check what tools are used in the world's most popular digital image processing books.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.