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

The LineIterator is not usable #319

Closed
Tnze opened this issue Jan 31, 2022 · 3 comments
Closed

The LineIterator is not usable #319

Tnze opened this issue Jan 31, 2022 · 3 comments

Comments

@Tnze
Copy link

Tnze commented Jan 31, 2022

In C++, this is the example of LineIterator usage:

// grabs pixels along the line (pt1, pt2)
// from 8-bit 3-channel image to the buffer
LineIterator it(img, pt1, pt2, 8);
LineIterator it2 = it;
vector<Vec3b> buf(it.count);
for(int i = 0; i < it.count; i++, ++it)
    buf[i] = *(const Vec3b*)*it;
// alternative way of iterating through the line
for(int i = 0; i < it2.count; i++, ++it2)
{
    Vec3b val = img.at<Vec3b>(it2.pos());
    CV_Assert(buf[i] == val);
}

The problem is the ++ operator has not bind to Rust.
I glanced at it and there seemed to be no relevant example. I appreciate it if anyone can help.

@twistedfall
Copy link
Owner

Thanks for the report, it looks like missing bindings indeed. I'll take a look and try to fix it!

@twistedfall
Copy link
Owner

Just realized that I closed the issue by accident, sorry!

@twistedfall
Copy link
Owner

This is fixed in v0.63.0, you can now use incr() method to advance the iterator.

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

No branches or pull requests

2 participants