Using sample_points in calibrateDebevec (photo/src/calibrate.cpp) (Bug #3664)


Added by Márcio Macedo almost 11 years ago. Updated almost 10 years ago.


Status:Done Start date:2014-04-25
Priority:Low Due date:
Assignee:Alexander Shishkov % Done:

0%

Category:photo
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty:Easy HW Platform:x64
Pull request:

Description

Isn't the following code (which can be found at (photo/src/calibrate.cpp) incorrect?

            int eq = 0;
            for(size_t i = 0; i < sample_points.size(); i++) {
                for(size_t j = 0; j < images.size(); j++) {

                    int val = images[j].ptr()[3*(sample_points[i].y * images[j].cols + sample_points[j].x) + channel];
                    A.at<float>(eq, val) = w.at<float>(val);
                    A.at<float>(eq, LDR_SIZE + (int)i) = -w.at<float>(val);
                    B.at<float>(eq, 0) = w.at<float>(val) * log(times.at<float>((int)j));
                    eq++;
                }
            }

Because sample_points is accessed from the indices "i" (sample_points[i].y) and "j" (sample_points[j].x) at the same time?

Best Regards,
Márcio Macedo


Associated revisions

Revision d1a15097
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3664 from wangyan42164:ocl_cascasde_barrier

History

Updated by Alexander Shishkov almost 11 years ago

  • Category set to photo
  • Assignee set to Alexander Shishkov
  • Description changed from Isn't the following code (which can be found at (photo/src/calibrate.cpp)... to Isn't the following code (which can be found at (photo/src/calibrate.cpp)... More

Updated by Alexander Shishkov almost 11 years ago

Thanks for the report! It is a bug:-) The same indices should be used.

We would appreciate if you could describe this change in the form of pull request, so it could be reviewed and merged.
Here are some instructions on how to do it: http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute.

Updated by Andrew Senin almost 11 years ago

  • Status changed from New to Open

Updated by Vadim Pisarevsky almost 10 years ago

looks like the bug has been fixed

  • Status changed from Open to Done

Also available in: Atom PDF