Skip to Main Content
Programming in MATLAB ®: A Problem-Solving Approach by Pearson
book

Programming in MATLAB ®: A Problem-Solving Approach by Pearson

by Ram N. Patel, Ankush Mittal
May 2024
Intermediate to advanced content levelIntermediate to advanced
433 pages
13h 7m
English
Pearson India
Content preview from Programming in MATLAB ®: A Problem-Solving Approach by Pearson
Operations on Images É 389
3. Run the filter over image g using imfilter function and display the output image.
>> g_edge = imfilter(g,h); imshow(g_edge)
Thus, we see that the sobel filter has detected edges as shown in g_edge image in Figure 13.14.
Sobel filter is nothing but a 3 × 3 filter, which can be viewed by simply typing h after step 2,
and pressing return.
>> h
h =
1 2 1
0 0 0
-1 -2 -1
There are several other linear spatial filters predefined in IPT, such as gaussian, prewitt, average,
which can be used through fspecial function.We can similarly define our own filter as an m × n
matrix with certain values and use it with imfilter
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Numerical Methods Using MATLAB, 2nd Edition

Applied Numerical Methods Using MATLAB, 2nd Edition

Won Y. Yang, Wenwu Cao, Jaekwon Kim, Kyung W. Park, Ho-Hyun Park, Jingon Joung, Jong-Suk Ro, Han L. Lee, Cheol-Ho Hong, Taeho Im
MATLAB Recipes: A Problem-Solution Approach

MATLAB Recipes: A Problem-Solution Approach

Michael Paluszek, Stephanie Thomas
Practical MATLAB Deep Learning: A Projects-Based Approach

Practical MATLAB Deep Learning: A Projects-Based Approach

Michael Paluszek, Stephanie Thomas, Eric Ham

Publisher Resources

ISBN: 9781306983440Publisher Website