Skip to content
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

More efficient at<T>() and set<T>()? #53

Closed
rainyl opened this issue May 15, 2024 Discussed in #44 · 2 comments · Fixed by #58
Closed

More efficient at<T>() and set<T>()? #53

rainyl opened this issue May 15, 2024 Discussed in #44 · 2 comments · Fixed by #58
Labels
enhancement New feature or request

Comments

@rainyl
Copy link
Owner

rainyl commented May 15, 2024

Discussed in #44

Originally posted by msmartin4470 May 8, 2024
What is the best way to loop though a Mat in dart? In C I did this using pointers as follows. Thanks in advance.

for (int i = 0; i < mat.rows; i++)
{
	uint16_t* matRow = mat.ptr<uint16_t>(i);
	for (int j = 0; j < mat.cols; j++)
	{
		uint16_t value = matRow[j];
		matRow[j] = lut.at<uint16_t>(value);
	}
}

```</div>
@rainyl rainyl added the enhancement New feature or request label May 15, 2024
@rainyl
Copy link
Owner Author

rainyl commented May 15, 2024

@rainyl
Copy link
Owner Author

rainyl commented May 17, 2024

Confirmed, current at() and set() is very slow, explicitly povide type like at<cv.U8> or atU8 will improve the performance significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant