Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv bad alignment hdr imaging

I use opencv 3.4 for android to make HDR image, there is my code :

Mat response = new Mat();
CalibrateDebevec calibrate = Photo.createCalibrateDebevec();
Mat matTimes = new Mat(times.size(), 1, CvType.CV_32F);
float[] arrayTimes = new float[(int) (matTimes.total() * matTimes.channels())];
for (int i = 0; i < times.size(); i++) {
    arrayTimes[i] = times.get(i);
}
matTimes.put(0, 0, arrayTimes);
calibrate.process(images, response, matTimes);
Mat fusion = new Mat();
MergeMertens mergeMertens = Photo.createMergeMertens();
mergeMertens.process(images, fusion);

Mat ldr = new Mat();
Tonemap tonemap = Photo.createTonemapReinhard(0.2f, 1.0f, 1.0f, 1.0f);
tonemap.process(fusion, ldr);
Core.multiply(ldr, new Scalar(255,255,255), response);

and now there is the result:

image description

as you can see there is a lot of offsets in the red square for exemple why the superposition of pictures is verry bad ?

I try to add the following alignment function before create HDR image but nothing work

AlignMTB alignMTB = Photo.createAlignMTB();
alignMTB.process(images, images);

anybody know how to fix this issue ?

opencv bad alignment hdr imaging

I use opencv 3.4 for android to make HDR image, there is my code :

Mat response = new Mat();
CalibrateDebevec calibrate = Photo.createCalibrateDebevec();
Mat matTimes = new Mat(times.size(), 1, CvType.CV_32F);
float[] arrayTimes = new float[(int) (matTimes.total() * matTimes.channels())];
for (int i = 0; i < times.size(); i++) {
    arrayTimes[i] = times.get(i);
}
matTimes.put(0, 0, arrayTimes);
calibrate.process(images, response, matTimes);
Mat fusion = new Mat();
MergeMertens mergeMertens = Photo.createMergeMertens();
mergeMertens.process(images, fusion);

Mat ldr = new Mat();
Tonemap tonemap = Photo.createTonemapReinhard(0.2f, 1.0f, 1.0f, 1.0f);
tonemap.process(fusion, ldr);
Core.multiply(ldr, new Scalar(255,255,255), response);

and now there is the result:

image description

as you can see there is a lot of offsets in the red square for exemple why the superposition of pictures is verry bad ?

I try to add the following alignment function before create HDR image but nothing work

AlignMTB alignMTB = Photo.createAlignMTB();
alignMTB.process(images, images);

anybody know how to fix this issue ?

opencv bad alignment hdr imaging

I use opencv 3.4 for android to make HDR image, there is my code :

Mat response = new Mat();
CalibrateDebevec calibrate = Photo.createCalibrateDebevec();
Mat matTimes = new Mat(times.size(), 1, CvType.CV_32F);
float[] arrayTimes = new float[(int) (matTimes.total() * matTimes.channels())];
for (int i = 0; i < times.size(); i++) {
    arrayTimes[i] = times.get(i);
}
matTimes.put(0, 0, arrayTimes);
calibrate.process(images, response, matTimes);
Mat fusion = new Mat();
MergeMertens mergeMertens = Photo.createMergeMertens();
mergeMertens.process(images, fusion);

Mat ldr = new Mat();
Tonemap tonemap = Photo.createTonemapReinhard(0.2f, 1.0f, 1.0f, 1.0f);
tonemap.process(fusion, ldr);
Core.multiply(ldr, new Scalar(255,255,255), response);

and now there is the result:

image description

as you can see there is a lot of offsets in the red square for exemple why the superposition of pictures is verry bad ?

I try to add the following alignment function before create HDR image but nothing work

AlignMTB alignMTB = Photo.createAlignMTB();
alignMTB.process(images, images);

anybody know how to fix this issue ?