Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedin 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

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

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

=+. What impediments have political origins?

Answered: 1 week ago