Skip to content

Codereview #2 of 6 from 0#109

Open
GiovanniFurlan wants to merge 84 commits intoCommonDemofrom
TestFromLastImage
Open

Codereview #2 of 6 from 0#109
GiovanniFurlan wants to merge 84 commits intoCommonDemofrom
TestFromLastImage

Conversation

@GiovanniFurlan
Copy link
Copy Markdown
Collaborator

Hi Giovanni Fasan,
i ask you to review my code please.
The code is the file ManualTestOnSinglePhoto.
This class receive an angle by user. Then rotate the last image taken by this angle and use OCR on it. Then compare the text from normal and rotated photo and gave back similarity between text.
If you have some suggestion please tell me.
Thanks you.

thomasporro and others added 30 commits November 23, 2018 16:20
Merge photo_testing and common demo to solve UI problems
…() will return a report which includes the evaluation of any alteration of a test. Plus improved specs and jUnit tests
…to_testing_alterationImplementation

# Conflicts:
#	app/src/main/java/unipd/se18/ocrcamera/AdapterTestElement.java
* added test photo alteration compatibility - PhotoTester.testAndReport() will return a report which includes the evaluation of any alteration of a test. Plus improved specs and jUnit tests

* added get alteration tag method in TestElement

* First commit

* First commit

* details

* Forced portrait mode to TestAlterationsActivity

* better exception handling, improved specs

* fixed null pointer exception in method run()

* Merge with AdapterAlterationsTest

* removed try - catch block

* removed try - catch block

* OnClickListener

* Removed button in adapterTestAlterations

* Log

* fixed setting bitmap alteration

* Optimized PhotoTester constructor

* Removed hardcoded strings

* Updated javadoc and simplified code
lucamoroz and others added 27 commits December 12, 2018 11:59
…tructuring

# Conflicts:
#	README.md
#	app/build.gradle
#	app/src/main/java/unipd/se18/ocrcamera/TextExtractor.java
# Conflicts:
#	app/src/main/java/unipd/se18/ocrcamera/PhotoTester.java
#	app/src/main/java/unipd/se18/ocrcamera/ResultActivity.java
#	app/src/main/java/unipd/se18/ocrcamera/TestListener.java
#	app/src/main/res/values/strings.xml
Add ManualTestOnSinglePhoto class
Add a case in menu in result activity
-delete worker and InformationEntry class
-delete countDownLatch
-slim the code
-add input layout
-now test works on given value
Finished class and wrote last comments
Add test on class
Correction of hardcoding
String in strings.xml
Comments
* @param length int of length of starting string
* @return warnings
*/
private String findWarning(java.lang.String text, int length) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use java.lang.String when it is enough to write String?

warnings = getResources().getString(R.string.lessThen30CharWarning);
}

return warnings;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it useful to return an empty string when you do not enter in any of the cases proposed by you?

{
Matrix matrix = new Matrix();
matrix.postRotate(angle);
return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to add the structure of the createBitmap function to understand what 0 and true are for

* @param string1 string to split and search in string2
* @param string2 string where to search
* @return percentage of similarity
* see the link for more information {@link <a https://github.com/tdebatty/java-string-similarity/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent idea to add the link


public class ManualTestOnSinglePhoto extends AppCompatActivity {

private String startingOCRText;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to explain the variable would help to understand better.

final int secondBound=20;
final int thirdBound=30;
final int toleranceValue=4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you choose the bounds and tolerance?

final correction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants