in reply to Image Operation

Since your teacher asked you to do this, it is most appropriate for you to do some research yourself.   These days, “Google it” and work from there, or better yet find a book of image processing algorithms.   Then, put your teacher in the loop.   Discuss your ideas, ask for pointers and suggestions.   The whole idea of such an exercise is to help you to learn how to discover an algorithm that will address a non-trivial problem.   In order to get what you (or someone else) are paying for, you need to be the one to make the discovery and your teacher needs to be the one to help you as necessary to do it.   The day will soon come when you are asked to solve problems of this sort and you won’t have the valuable resource of a dedicated instructor at your disposal.

I have, of course, been a college instructor myself, and I can tell you that I was delighted when a student came to me with a well-prepared question.   I knew that such a student would succeed, in the class and in a lot of other things in life too.

Remember:   when dealing with a problem like this, you can assume that a suitable solution exists, and that your purpose (unless your instructor clearly states otherwise) is to discover your choices and then to select from among them.