Question

Resampling: Do not use any in-built functions from opencv and numpy. In general, you can use...

Resampling: Do not use any in-built functions from opencv and numpy. In general, you can use function from math library. Functions allowed for this part are: np.array(), np.matrix(), np.zeros(), np.ones(), cv2.imread(), cv2.namedWindow(), cv2.waitKey().

Write code for zooming and shrinking an image using the nearest neighbor and bilinear interpolation. The input to your program is: (i) image, (ii) transformation parameters, and (iii) interpolation method.

(Can I get more of an explanation and puesdocode of how you use nearest neighbor and bilinear interpolation to do this without built-in functions)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:
Any image is two dimensional array and with each element having a value .i.e. intensity of that pixel.
1 2 3
4 8 9
7 4 1
In above all the numbers are pixel values according to RGB scale.

Methods:
Nearest Neighbor method:

For any image, at any given co-ordinate or at any pixel set, finding the "Nearest pixel value" for zooming or shrinking operations.

Bilinear Interpolation:
Zoom or shrink, 2D array of the image is resized .i.e
Zoom: 3x3 image would be 9x9 or 12x12, new values of rows and colums can be calculated throught bilinear interpolation method.
Shrink: 10x10 image would be shrink to 5x5, then again finding the new values of that matrix using this method only.


Approach to solution:
For any given image, it's size can be known and pixel values can be calculated.
Above two are transformational parameters along with size to be achieved after conversion.
In Nearest neighbor method, each neighbors pixel value is calculated and image is created, whereas in bilinear interpolation, a random small size matrix is chosen and corresponding new matrix pixels are calculated.

Add a comment
Know the answer?
Add Answer to:
Resampling: Do not use any in-built functions from opencv and numpy. In general, you can use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You may import the following library functions in your module: from fractions import gcd from math...

    You may import the following library functions in your module: from fractions import gcd from math import floor from random import randint You may also use: • the built-in pow() function to compute modular exponents efficiently (i.e., ak mod n can be written in Python as pow(a,k,n)), • the sum() function returns the sum of a list of integers (sum(1,2,3,4) returns 10). problem 1 a. Implement a function invPrime(a, p) that takes two integers a and p > 1 where...

  • Can you do this in excel and show what functions you use to get the quarter...

    Can you do this in excel and show what functions you use to get the quarter totals and other totals. Can you also do the sales budget I need to create an entire master budget. The following data relate to the operations of Shilow Company, a wholesale distributor of consumer goods Current assets as of March 31: Cash Accounts receivable Inventory Building and equipment, net Accounts payable Common stock Retained earnings $ 8,500 $ 24,000 $ 45, 600 $ 121,200...

  • Hi, this is an intro to C Programming Class. Please do not use arrays, functions, math.h,...

    Hi, this is an intro to C Programming Class. Please do not use arrays, functions, math.h, or struct to store any data except to declare strings char strVar[20]. Furthermore, can you please do a good check to make sure the final program does not have any problems because when I copy and paste them the app I use says there are some problems and it won't run the program. So if you can double check to make sure that everything...

  • C++ Object Oriented assignment Can you please check the program written below if it has appropriately...

    C++ Object Oriented assignment Can you please check the program written below if it has appropriately fulfilled the instructions provided below. Please do the necessary change that this program may need. I am expecting to get a full credit for this assignment so put your effort to correct and help the program have the most efficient algorithm within the scope of the instruction given. INSTRUCTIONS Create a fraction class and add your Name to the name fraction and use this...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT