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 pfm converted by the "imgcmd" command does not match the submission format of ETH3D and Middlebury #20

Open
StereoResearcher opened this issue Jun 16, 2023 · 2 comments

Comments

@StereoResearcher
Copy link

Dear Professor:
Hello! I use the command "imgcmd delivery_area_1l.png -out delivery_area_1l.pfm" to convert the png format to pfm format, but the converted result fails to submit to ETH3D. The system thinks this pfm result is an invalid input.

@heikohimu
Copy link
Contributor

heikohimu commented Jun 16, 2023

Hi,

I am not a professor, I just have a PhD, but you can call me Heiko.

It should work. I can just guess that the disparities are out of range? PNG uses integer values, but disparities are usually given with sub-pixel accuracy. So usually, the sub-pixel disparity is multiplied with e.g. 16 and then stored as integer. PFM stores values as float. If you stored it in this way in the PNG, then you need to divide all values by e.g. 16. This can be done like this:

imgcmd delivery_area_1l.png -float -div 16 -out delivery_area_1l.pfm

@StereoResearcher
Copy link
Author

StereoResearcher commented Jun 20, 2023

Dear Dr.Heiko:
Thank you for answering my question, I tried changing the command to the form you suggested, but it still reported an error. With your reminder, I tried printing out the values before and after the conversion and found that my values were normal before the format conversion, but after executing the command, the values of the generated image became Nan (but looked normal from the monitor), I was using Python to call the cmd command, is it related to this?
image
image
image

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