Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in jupyter notebook (python) Write two functions: set_triple that does the following: takes as arguments an image array, a row, a column and a bitstring
in jupyter notebook (python)
Write two functions: set_triple that does the following: takes as arguments an image array, a row, a column and a bitstring modifies the 3 pixels at the array location (row, col) to (row, col+3) the modification changes the parity as discussed for the values in the pixels based on the bitstring returns the array of the updated three pixels (not the whole array, just the array of the 3 pixels). get_triple that does the following takes as an argument an image array, a row and a column it reads the parity of the 3 pixels at (row, col) to (row.col+3) as a bitstring returns the integer value of the decoded bitstring Getting these two correct is key Getting set_triple and get_triple right is the key here. If you get those correct you can more easily code the functions below using these functions. # your code here # test yourself set_test = np.array([[ [5,5,5), (5,5,5),(5,5,5), (5,5,5], [5,5,5], [5,5,5], [5,5,5], [5,5,5] ]]) print (set_triple (set_test, 0,0, '00001111')) get_test = np.array([[[6,6,6],[6,5,5),(5,5,5],[5,5,5], [5,5,5], [5,5,5],[5,5,5], [5,5,5] ]]) print (get_triple(get_test, 0, 0)) Write two functions: set_triple that does the following: takes as arguments an image array, a row, a column and a bitstring modifies the 3 pixels at the array location (row, col) to (row, col+3) the modification changes the parity as discussed for the values in the pixels based on the bitstring returns the array of the updated three pixels (not the whole array, just the array of the 3 pixels). get_triple that does the following takes as an argument an image array, a row and a column it reads the parity of the 3 pixels at (row, col) to (row.col+3) as a bitstring returns the integer value of the decoded bitstring Getting these two correct is key Getting set_triple and get_triple right is the key here. If you get those correct you can more easily code the functions below using these functions. # your code here # test yourself set_test = np.array([[ [5,5,5), (5,5,5),(5,5,5), (5,5,5], [5,5,5], [5,5,5], [5,5,5], [5,5,5] ]]) print (set_triple (set_test, 0,0, '00001111')) get_test = np.array([[[6,6,6],[6,5,5),(5,5,5],[5,5,5], [5,5,5], [5,5,5],[5,5,5], [5,5,5] ]]) print (get_triple(get_test, 0, 0))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started