-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
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
imquery() and overloaded imread() functions #17753
base: 4.x
Are you sure you want to change the base?
Conversation
@sturkmen72, thank you for the contribution! I think, we should discuss the API. Can you provide a little code snippet how people would use this new functionality? In C++ one of the best approaches would be to create an image iterator. For Python it could be possible to use a similar approach, even though it would not look as idiomatic. Something like that:
of course, it would also be possible to create more Pythonic wrapper on top of it, like suggested here, for example: |
@vpisarev thank you for your feedback. let me work on the PR a bit more |
@sturkmen72 Do you have a chance to finish the PR in meantime? |
@asmorkalov , @vpisarev i am still thinking of an effective usage way considering #8511 |
f993d08
to
8613543
Compare
A simple review is required before continuing. please forgive my sloppiness i did not look codes of #8511 before. now i am aware both PR has basely similar changes. @brian-armstrong-discord do you have time to look my changes |
0b598c7
to
fd04510
Compare
618f9dd
to
0fa2201
Compare
@vpisarev, @alalek please take a look at this PR. I know it still need more work but i need to know if i am on the right path. sample usage C++
Python
|
@sturkmen72, thank you for keep working on it. Could you, please, provide some sample code and the test for the functionality? |
@sturkmen72, yes, let's discuss it. I sent you e-mail |
12a9896
to
854c1c4
Compare
samples/python/imquery.py
Outdated
row = int((page_info1.height - page_info3.height)/2) | ||
|
||
roi = img1[row:row+page_info3.height, column:column+page_info3.width] | ||
#ret,roi = cv.imread("images.tif", None, cv.IMREAD_REDUCED_COLOR_2, 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.
you can try the following:
ret,roi = cv.imread("images.tif", None, cv.IMREAD_REDUCED_COLOR_2, i)
img1[row:row+page_info3.height, column:column+page_info3.width] = roi
modules/imgcodecs/src/loadsave.cpp
Outdated
} | ||
return !mats.empty(); |
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.
mats shoud not be empty before calling this function
} | ||
return !mats.empty(); | ||
return counter == count; |
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.
If we asked for more images than multipage page count and we successfully read existing images should this be false ?
modules/imgcodecs/src/grfmt_gdal.cpp
Outdated
/** | ||
* try to go to next page | ||
*/ | ||
bool GdalDecoder::nextPage(){ |
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 think GDAL driver loads only first page of multipage images. i will try to implement GdalDecoder::nextPage()
after actual changes seems good.
@vpisarev I think I've made significant progress after our meeting. could you review the actual code. |
e3d2d0e
to
3e968af
Compare
7025ed2
to
36a618e
Compare
1a020a1
to
e9ed1e8
Compare
7e8ef09
to
eb33df1
Compare
proposed solution to #6574 #17862
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.