-
Notifications
You must be signed in to change notification settings - Fork 17
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
added code for iterating over point cloud #10
Conversation
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.
I have only these two 'cosmetic' fixes. @knatten can you please check the important stuff (code)? :)
I was thinking about suggesting to rename the sample to something that describes this addition but I don't have a good idea. Do you? readZDFExtractData, readZDFIterate, readZDFGetData don't sound nice to me. Also, the sample description needs to be modified and the README.md updated. |
Will do these changes now. |
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.
I added some suggestions for improvements to the code.
As for the commit messages, check my post on Teams from last week. In particular they should be capitalized and in an imperative mood.
There are also some spelling errors both in the branch name ("interate") and commit messages ("improved").
These two commits should be squashed, but you can wait with that until you've done the rest of the fixes I suggested. I can help you with that if you want, or @SatjaSivcev might be able to help you.
Finally, the commit from #11 should be part of this PR. Either as a separate commit, or just squashed in with the other changes, that's up to you.
ebe0f54
to
f0a9ac8
Compare
Ready for next round |
This doesn't build. The file name needs to be capitalized, and |
Let me know when you're ready to start working on this PR again, and I'll help you rebase on master after the formatting change we did in #12. |
@chrisasc let's look at this next week when I am back. It should be a quick fix. |
This needs another rebase after we merge #23 |
@chrisasc now that you are on a C++ coding spree maybe it's a good idea to resolve this branch and merge it? |
bc68158
to
3f35436
Compare
I made some fixes here. It builds now and should be ready for merging. @knatten please check if all is good? |
3f35436
to
b2206e9
Compare
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.
Looks good! Just some nitpicks and a suggested improvement for output.
|
||
std::string Filename = "Zivid3D.zdf"; | ||
std::cout << "Reading " << Filename << " point cloud" << std::endl; | ||
Zivid::Frame frame = Zivid::Frame(Filename); |
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.
Can be const
, and would be good to use the same convention for declaring variables which we use elsewhere:
const Zivid::Frame frame(Filename);
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.
done
Zivid::CloudVisualizer vis; | ||
zivid.setDefaultComputeDevice(vis.computeDevice()); | ||
|
||
std::string Filename = "Zivid3D.zdf"; |
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.
Can be const
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.
done
<< "Height: " << pointCloud.height() << ", Width: " << pointCloud.width() << std::endl; | ||
|
||
// Iterating over the point cloud and displaying (X, Y, Z, R, G, B, Contrast) | ||
for(int i = 0; i < pointCloud.height(); i++) |
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.
Should use size_t
for i
and j
since that is what height()
and witdh()
return
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.
done
<< "Height: " << pointCloud.height() << ", Width: " << pointCloud.width() << std::endl; | ||
|
||
// Iterating over the point cloud and displaying (X, Y, Z, R, G, B, Contrast) | ||
for(int i = 0; i < pointCloud.height(); i++) |
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.
I suggest to do i += 100
instead (and the same for j
), to avoid extremely long output to console. What do you think?
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.
done
|
||
std::cout << "Values at pixel (" << i << ", " << j << "):" | ||
<< " X:" << point.x << " Y:" << point.y << " Z:" << point.z | ||
<< " R:" << (int)point.red() << " G:" << (int)point.green() << " B:" << (int)point.blue() |
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.
Prefer static_cast
over C-style casts.
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.
done
Fixed comments. However, master has a problem. Maybe rebasing will fix them. But first: ready for next round |
Which problem does master have?
Do you think you could rebase first? It's currently very hard to review this PR due to the git history. Have a look at the diff to understand what I mean. |
3ded8cf
to
aff3a44
Compare
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.
Looks very good! I think your idea for limiting output is better than mine.
Looks like we're just missing some formatting to be green, then we're good to merge. You can just merge when green, no need for re-approval. |
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.
Something went wrong in a rebase here, I think?
Indeed it did! I'm not sure what I did wrong... Could we quickly go through this later today? |
Of course! :) Let me know whenever is a good time for you. |
2b88ca8
to
1df9237
Compare
1df9237
to
3c19de4
Compare
I've rebased this branch. @chrisasc if it is green, plase merge it. |
3c19de4
to
9755b4b
Compare
ReadZDF.cpp is modified and renamed to ReadIterateZDF.cpp
9755b4b
to
458f81c
Compare
Extended the existing code with a loop to iterate over point cloud and display every value