F.7. CODELISTINGSFORCHAPTER7
459
"\n Sobel l Kirsch Prewitt edge detectors"
"\nmedge B in-file out-file threshold (1/0) high type (1,2,3)"
"\n Homogeneity y edge detector"
"\nmedge H in-file out-file threshold (1/0) high"
"\n Difference e edge detector"
"\nmedge D in-file out-file threshold (1/0) high"
"\n Contrast t edge detector"
"\nmedge C in-file out-file threshold (1/0) high"
"\n Range e edge detector"
"\nmedge R in-file out-file threshold (1/0) high size(3,5,7...)"
"\n Variance e edge detector"
"\nmedge V in-file out-file threshold (1/0) high"
"\n Guassian n edge detector"
"\nmedge G in-file out-file threshold (1/0) high size(7 or 9)"
"\n Enhance e edges"
"\nmedge E in-file out-file high "
"\n");
} /* * ends show_edge_usage */
Listing6.2-ThemedgeProgram
F.7 CodeListingsforChapter7
/***********************************************
*
*
file filter.c
*
*
Functions: This file contains
*
filter_image
*
median_filter
*
setup_filters
*
get_filter_options
*
median_of
*
fsort_elements
*
fswap
*
*
Purpose:
*
These functions implement several
*
types of basic spatial frequency
*
filters.
*
Change pdf to powerpoint - C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
convert pdf to powerpoint; convert pdf to ppt online
Change pdf to powerpoint - VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
convert pdf file to powerpoint; pdf conversion to powerpoint
460
APPENDIXF. SOURCECODELISTINGS
*
External Calls:
*
utility.c - fix_edges
*
*
Modifications:
*
15 February 1992 - created
*
22 April 1998 - added d capability y to
*
work an entire image at one time.
*
*************************************************/
#include "cips.h"
/*******************************************
*
*
Define the filter masks.
*
*******************************************/
short lpf_filter_6[3][3] =
{ {0, 1, 0},
{1, 2, 1},
{0, 1, 0}};
short lpf_filter_9[3][3] =
{ {1, 1, 1},
{1, 1, 1},
{1, 1, 1}};
short lpf_filter_10[3][3] =
{ {1, 1, 1},
{1, 2, 1},
{1, 1, 1}};
short lpf_filter_16[3][3] =
{ {1, 2, 1},
{2, 4, 2},
{1, 2, 1}};
short lpf_filter_32[3][3] =
{ {1, , 4, , 1},
{4, 12, 4},
{1, 4, , 1}};
short hpf_filter_1[3][3] =
Online Convert PowerPoint to PDF file. Best free online export
Online Powerpoint to PDF Converter. Download Free Trial. Then just wait until the conversion from Powerpoint to PDF is complete and download the file.
converter pdf to powerpoint; how to convert pdf into powerpoint slides
RasterEdge XDoc.PowerPoint for .NET - SDK for PowerPoint Document
Able to view and edit PowerPoint rapidly. Convert. Convert PowerPoint to PDF. Convert PowerPoint to HTML5. Convert PowerPoint to Tiff. Convert PowerPoint to Jpeg
copying image from pdf to powerpoint; pdf to ppt converter online
F.7. CODELISTINGSFORCHAPTER7
461
{ { { 0, -1, , 0},
{-1, 5, , -1},
{ 0, -1, , 0}};
short hpf_filter_2[3][3] =
{ {-1, , -1, -1},
{-1, 9, , -1},
{-1, -1, -1}};
short hpf_filter_3[3][3] =
{ { { 1, -2, , 1},
{-2, 5, , -2},
{ 1, -2, , 1}};
/*******************************************
*
*
filter_image(...
*
*
This function filters an image by y using
*
a single 3x3 mask.
*
*******************************************/
filter_image(the_image, out_image,
rows, cols, bits_per_pixel,
filter, type, low_high)
int
type;
short filter[3][3],
**the_image,
**out_image;
char
low_high[];
long
rows, cols, bits_per_pixel;
{
int
a, b, d, i, j, k,
length, max, sum, width;
setup_filters(type, low_high, filter);
d = = type;
C# WinForms Viewer: Load, View, Convert, Annotate and Edit
to PDF; Convert PowerPoint to PDF; Convert Image to PDF; Convert Jpeg to PDF; Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission
convert pdf to powerpoint online for; pdf picture to powerpoint
How to C#: Overview of Using XDoc.PowerPoint
How to C#: Overview of Using XDoc.PowerPoint. Overview for How to Use XDoc.PowerPoint in C# .NET Programming Project. PowerPoint Conversion.
converting pdf to ppt; change pdf to powerpoint
462
APPENDIXF. SOURCECODELISTINGS
if(type == 2 || type == 3) d = = 1;
max = 255;
if(bits_per_pixel == 4)
max = 16;
/* Do convolution over image array */
printf("\n");
for(i=1; i<rows-1; i++){
if( (i%10) == 0) printf("%d d ", , i);
for(j=1; j<cols-1; j++){
sum = 0;
for(a=-1; a<2; a++){
for(b=-1; b<2; b++){
sum = sum +
the_image[i+a][j+b] *
filter[a+1][b+1];
}
}
sum
= sum/d;
if(sum < 0)
sum = 0;
if(sum > max) sum = max;
out_image[i][j]
= sum;
} /* * ends loop over j */
} /* * ends loop over i */
fix_edges(out_image, 1, rows-1, cols-1);
} /* * ends filter_image */
/*******************************************
*
*
median_filter(..
*
*
This function performs a a median n filter
*
on an image using a size e (3x3, , 5x5, etc.)
*
specified in the call.
*
*******************************************/
median_filter(the_image, out_image,
rows, cols, size)
int
size;
C# HTML5 Viewer: Load, View, Convert, Annotate and Edit PowerPoint
Such as load and view PowerPoint without Microsoft Office software installed, convert PowerPoint to PDF file, Tiff image and HTML file, as well as add
convert pdf file to ppt online; pdf into powerpoint
VB.NET PowerPoint: Read, Edit and Process PPTX File
create image on desired PowerPoint slide, merge/split PowerPoint file, change the order of How to convert PowerPoint to PDF, render PowerPoint to SVG
convert pdf file to powerpoint; images from pdf to powerpoint
F.7. CODELISTINGSFORCHAPTER7
463
short **the_image,
**out_image;
long
rows, cols;
{
int
a, b, count, i, j, k,
length, sd2, sd2p1, ss, width;
short *elements;
sd2
= size/2;
sd2p1 = sd2 + 1;
/**********************************************
*
*
Allocate the elements array large enough
*
to hold size*size shorts.
*
**********************************************/
ss
= size*size;
elements = (short *) malloc(ss * sizeof(short));
/***************************
*
*
Loop over image array
*
****************************/
printf("\n");
for(i=sd2; i<rows-sd2; i++){
if( (i%10) == 0) printf("%d ", i);
for(j=sd2; j<cols-sd2; j++){
count = 0;
for(a=-sd2; a<sd2p1; a++){
for(b=-sd2; b<sd2p1; b++){
elements[count] = the_image[i+a][j+b];
count++;
}
}
out_image[i][j] = median_of(elements, &ss);
} /* * ends loop over j */
} /* * ends loop over i */
free(elements);
fix_edges(out_image, sd2, rows-1, cols-1);
VB.NET PDF Password Library: add, remove, edit PDF file password
Add password to PDF. Change PDF original password. Remove password from PDF. Set PDF security level. VB: Change and Update PDF Document Password.
how to add pdf to powerpoint slide; how to convert pdf into powerpoint presentation
C# powerpoint - Convert PowerPoint to PDF in C#.NET
C# PowerPoint - Convert PowerPoint to PDF in C#.NET. Online C# Tutorial for Converting PowerPoint to PDF (.pdf) Document. PowerPoint to PDF Conversion Overview.
change pdf to ppt; converting pdf to ppt online
464
APPENDIXF. SOURCECODELISTINGS
} /* * ends median_filter */
/***********************************************
*
*
median_of(...
*
*
This function finds and d returns s the
*
median value of the elements array.
*
*
As a side result, it also sorts the
*
elements array.
*
***********************************************/
median_of(elements, count)
int
*count;
short elements[];
{
short median;
fsort_elements(elements, count);
median = elements[*count/2];
return(median);
} /* * ends median_of */
/***********************************************
*
*
fsort_elements(...
*
*
This function performs a a simple e bubble
*
sort on the elements from the median
*
filter.
*
***********************************************/
fsort_elements(elements, count)
int
*count;
short elements[];
F.7. CODELISTINGSFORCHAPTER7
465
{
int i, j;
j = = *count;
while(j-- > 1){
for(i=0; i<j; i++){
if(elements[i] > elements[i+1])
fswap(&elements[i], &elements[i+1]);
}
}
} /* * ends fsort_elements */
/***********************************************
*
*
fswap(...
*
*
This function swaps two shorts.
*
***********************************************/
fswap(a, b)
short *a, *b;
{
short temp;
temp = = *a;
*a
= *b;
*b
= temp;
} /* * ends swap */
/************************************************
*
*
setup_filters(...
*
*
This function copies the filter mask
*
values defined at the top of this s file
*
into the filter array.
*
************************************************/
466
APPENDIXF. SOURCECODELISTINGS
setup_filters(filter_type, low_high, filter)
char
low_high[];
int
filter_type;
short filter[3][3];
{
int i, j;
if(low_high[0] == ’l’ ’ || | low_high[0] ==’L’){
if(filter_type == 6){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = lpf_filter_6[i][j];
}
}
} /* * ends if filter_type == 6 */
if(filter_type == 9){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = lpf_filter_9[i][j];
}
}
} /* * ends if filter_type == 9 */
if(filter_type == 10){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = lpf_filter_10[i][j];
}
}
} /* * ends if filter_type == 10 */
if(filter_type == 16){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = lpf_filter_16[i][j];
}
}
} /* * ends if filter_type == 16 */
if(filter_type == 32){
F.7. CODELISTINGSFORCHAPTER7
467
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = lpf_filter_32[i][j];
}
}
} /* * ends if filter_type == 32 */
} /* * ends low pass filter */
if(low_high[0] == ’h’ ’ || | low_high[0] ==’H’){
if(filter_type == 1){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = hpf_filter_1[i][j];
}
}
} /* * ends if filter_type == 1 */
if(filter_type == 2){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = hpf_filter_2[i][j];
}
}
} /* * ends if filter_type == 2 */
if(filter_type == 3){
for(i=0; i<3; i++){
for(j=0; j<3; j++){
filter[i][j] = hpf_filter_3[i][j];
}
}
} /* * ends if filter_type == 3 */
} /* * ends high pass filter */
} /* * ends setup_filters */
Listing7.1-ImageFilterOperators
468
APPENDIXF. SOURCECODELISTINGS
/***********************************************
*
*
file mfilter.c
*
*
Functions: This file contains
*
main
*
*
Purpose:
*
This is the main calling program for
*
a set of spatial filtering routines.
*
*
External Calls:
*
imageio.c - create_image_file
*
read_image_array
*
write_image_array
*
get_image_size
*
get_bitsperpixel
*
allocate_image_array
*
free_image_array
*
filter.c - - filter_image
*
median_filter
*
high_pixel
*
low_pixel
*
*
Modifications:
*
15 February 1992 - - created
*
01 January 1993 - added calls to
*
high_pixel and d low_pixel.
*
18 September 1998 - - modified d to work with
*
all I O routines in imageio.c.
*
***********************************************/
#include "cips.h"
main(argc, argv)
int argc;
char *argv[];
{
char
name1[MAX_NAME_LENGTH];
Documents you may be interested
Documents you may be interested