-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method for image transformation matrix generation (more evualtion needed) #2057
Open
mark-p4
wants to merge
25
commits into
apache:main
Choose a base branch
from
mark-p4:image_transform
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
80b5d0b
added test for transformation of linearized images
mark-p4 3288c00
added a dml file to calculate the image transformation matrix, the bu…
mark-p4 a616ba7
added a dml file img_transform_matrix.dml
mark-p4 5205e87
added a builtin for img_transform_matrix.dml
mark-p4 875c75f
added function img_transform_matrix, CP and Lop missing? maybe hop too?
mark-p4 36c8597
rewritten for img_transform_matrix.dml to be used
mark-p4 42a38a7
intermediate commit, added new test script, reimplemented function to…
mark-p4 9ae2b23
solid path to executing the necessary steps, throwing not implemented…
mark-p4 1ea9b08
added some multi return parameters
mark-p4 9a2a375
we made it to a state were the function itself can be implemented in …
mark-p4 9a4c921
first steps of implementation of the algorithm for the transformation…
mark-p4 e533dee
intermediate commit for transformation matrix implementation
mark-p4 ef83ba2
almost completed the transformation matrix implementation
mark-p4 36926ac
ctable is not working in any meaningful way
mark-p4 620e71e
image_transform_matrix.dml is now working, some testing and evaluatio…
mark-p4 bf120d2
cleanup of existing code for pull request
mark-p4 e35ea84
added approriate licences to new dml and java files
mark-p4 a2d0ee9
improved documentation based on automated tests
mark-p4 e3e06d3
disabled the transform linearized test for now, aim is to enable late…
mark-p4 ba4322c
changes to BuiltinImageTransformLinearizedTest.java and image_transfo…
mark-p4 3e2cb7d
various changes
mark-p4 fa7d7c1
added changes to tests and cleaned up LibMatrixIMGTransform
mark-p4 e32ca44
improved tests and looking into bug with the img_transform_linearized…
mark-p4 3ba7e55
everything seems to work, nice
mark-p4 e825ca1
added improvements based on feedback and cleaned up code
mark-p4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -672,6 +672,31 @@ | |
|
||
break; | ||
} | ||
//implement the calculation of the transformation matrix for affine transformation of images | ||
case IMG_TRANSFORM_MATRIX: | ||
//transformation matrix must be 3x3 matrix | ||
Expression expressionOne_IMG = getFirstExpr(); | ||
//dimension matrix must be a 2x2 matrix | ||
Expression expressionTwo_IMG = getSecondExpr(); | ||
checkMatrixFrameParam(expressionOne_IMG); | ||
checkMatrixFrameParam(expressionTwo_IMG); | ||
|
||
if ((expressionOne_IMG.getOutput().getDim1() != expressionOne_IMG.getOutput().getDim2()) && expressionOne_IMG.getOutput().getDim1() != 3) { | ||
raiseValidateError("The first argument to " + _opcode + " must be a square 3x3 matrix.", false, LanguageErrorCodes.INVALID_PARAMETERS); | ||
} else if ((expressionTwo_IMG.getOutput().getDim1() != expressionTwo_IMG.getOutput().getDim2()) && expressionOne_IMG.getOutput().getDim1() != 2) { | ||
raiseValidateError("The second argument to " + _opcode + " must be a square 2x2 matrix.", false, LanguageErrorCodes.INVALID_PARAMETERS); | ||
} | ||
|
||
DataIdentifier img_transfrom_matrix_Out1 = (DataIdentifier) getOutputs()[0]; | ||
DataIdentifier img_transfrom_matrix_Out2 = (DataIdentifier) getOutputs()[1]; | ||
|
||
//describe the matrix characteristics type and value | ||
img_transfrom_matrix_Out1.setDataType(DataType.MATRIX); | ||
img_transfrom_matrix_Out1.setValueType(ValueType.FP64); | ||
img_transfrom_matrix_Out2.setDataType(DataType.MATRIX); | ||
img_transfrom_matrix_Out2.setValueType(ValueType.FP64); | ||
//the output dimensions are not known beforehand and vary based on input values | ||
break; | ||
case REMOVE: { | ||
checkNumParameters(2); | ||
checkListParam(getFirstExpr()); | ||
|
@@ -1325,7 +1350,6 @@ | |
output.setBlocksize(0); | ||
output.setValueType(ValueType.BOOLEAN); | ||
break; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. avoid this formatting. |
||
// Contingency tables | ||
case TABLE: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,6 +138,15 @@ else if(parts.length == 8 && opcode.equalsIgnoreCase("stft")) { | |
|
||
return new MultiReturnComplexMatrixBuiltinCPInstruction(null, in1, in2, windowSize, overlap, outputs, opcode, | ||
str, threads); | ||
// 2 inputs and two outputs | ||
} else if (opcode.equalsIgnoreCase("img_transform_matrix")) { | ||
CPOperand in1 = new CPOperand(parts[1]); //transformation matrix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move comments to line above. |
||
CPOperand in2 = new CPOperand(parts[2]); //dimension matrix [[orig_w, orig_h],[out_w, out_h]] | ||
|
||
outputs.add(new CPOperand(parts[3], ValueType.FP64, DataType.MATRIX)); | ||
outputs.add(new CPOperand(parts[4], ValueType.FP64, DataType.MATRIX)); | ||
int threads = Integer.parseInt(parts[5]); | ||
return new MultiReturnComplexMatrixBuiltinCPInstruction(null, in1, in2, outputs, opcode, str, threads); | ||
} | ||
else if ( opcode.equalsIgnoreCase("rcm") ) { | ||
CPOperand in1 = new CPOperand(parts[1]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the test function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be removed after benchmarking