Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 ) HW _ resize 1 D ( float * IN , float * OUT , int INlen, int OUTlen, int kernel _ type, double

1) HW_resize1D (float *IN, float *OUT,int INlen, int OUTlen, int kernel_type, double param) Function HW_resize1D scales the list of numbers stored in IN into a newlist OUT. IN has INlen elements of datatype float. OUT has OUTlen elements. If OUTLEN > INLEN, then magnification must be performed. Else, minification takes place. In either case, the user specifies the filter through argument kernel_type,which can be set to 0,1,2 to refer to nearest neighbor, linear interpolation, and cubic convolution, respectively. Incubic convolution, the free variable a is passed through param. V alues 3,4, and 5 for kernel_type are reserved for windowed sinc functions. The corresponding windowfunctions that should be used are: Hann, Hamming, and Lanczos windows. Note that parameter N for the Hann and Hamming windows (as used in the equations in the book) are passed through param.That is, param will store the width of the window. Inthe case of the Lanczos window, param is used to store the number of sinc lobes allowed to pass. For instance, the Lanczos2(x) windowwill be specified with param =2, the Lanczos3(x) windowwith param =3, etc. Test HW_resize1D for magnification for a 1-D impulse function. Initialize an array of 32 numbers with 100 everywhere, and 200 at the center (location 16). Then magnify this list by a scale factor of 8 using all the above kernels. The output list of 256 elements should match with the samples of the respective reconstruction kernels. Submit aplot of the output for each kernel. Remember to pad the input to avoid problems at the borders where the convolution kernel falls off the edge of the image. Use pixel replication for padding. Test HW_resize1D for minification for a 1-D sine wav e function having values lying between 0 and 255. Initialize an array of 128 numbers with a sine wav e having 16 cycles per scanline (or .125 cycles per pixel). Then minify this list by a scale factor of 8 using all the above kernels. The output list will have 16 elements. Submit aplot of the output for each kernel. Remember to pad the input to avoid problems at the borders where the convolution kernel falls off the edge of the image. Use pixel replication for padding. Also, note that unlikethe magnification case, minification will cause the kernel to be stretched wider and reduced in amplitude in proportion to the scale factor.
in c++ using visual studio and qt 5.14.2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Relational Contexts in Organizations

Answered: 1 week ago