Hello everyone, dear readers and forum users!
It's a great idea to start posting tests for those who want to test themselves before an interview. Started this threadHere I will set only the condition of the task, in the comments you can discuss the solution algorithm. The task, as usual, will be in English.
Nice to have
- It should be possible to exclude certain parts of the image from comparison, for example a clock or dynamically generated number. They will be provided by the caller as a list of rectangles to exclude.
- Provide some sort of UI either as a web page or GUI that allows the user to select the images and view differences as an overlay on either of the images.
Expected Deliverables
- source code.
- Binary version of the algorithm that runs and produces output of comparison. No build should be required.
- Output image showing the result of comparison.
Tips and Hints
- Use javax.imageio.ImageIO to read/write images.
- Consider java.awt.image.BufferedImage#createGraphics() to draw on in-memory images.
From myself I want to add that it would be good practice to write JUnit tests for all this stuff. To do this, you will need to use some kind of Ant / Maven / Gradle project build system to pull up the lib for JUnit.
We put "+" on the article if it was useful. We solve it, pump our skills. She came across in two companies! See also my other articles:
Quiz: "Write a BrainFuck Interpreter"
Quiz "Image Comparison" Java - faster, stronger and higher! Salaries of Ukrainian programmers. Success story after 1.5 years from the start of training
Technical questions at the interview.
How to find a job? Sending resumes
Professional burnout. How to resist?
English for IT and for interviews
Pattern Command in your own words.
Singleton pattern in your own words.
How to create an executable jar in Intellij IDEA / how to create jar in IDEA
Help, I need some motivation!
Subscribe to my blog Design Patterns and write articles in it!">
GO TO FULL VERSION