Commit 22a12ccf authored by Andrey Filippov's avatar Andrey Filippov

Combining moving targets with running average

parent 6dd7be11
...@@ -4725,8 +4725,8 @@ public class GpuQuad{ // quad camera description ...@@ -4725,8 +4725,8 @@ public class GpuQuad{ // quad camera description
* works with the negative scales, so the result will be a negative image in the TD. * works with the negative scales, so the result will be a negative image in the TD.
* @param vector_field sparse array of motion vectors (may be longer, only Vx and Vy used). Null elements * @param vector_field sparse array of motion vectors (may be longer, only Vx and Vy used). Null elements
* are allowed, they will be skipped, resultin in null TpTask elements. * are allowed, they will be skipped, resultin in null TpTask elements.
* @param offset_scale multiply all vectors by this value when calculatingpixel offsets * @param offset_scale multiply all vectors by this value when calculating pixel offsets
* @param magnitude_scale Scale data for accumulation (here positive, will be negated * @param magnitude_scale Scale data for accumulation (here positive, will be negated). If 0 - will use scale=1.0 (no accumulation)
* @param image_width image width in tiles (80 for 640-wide images). * @param image_width image width in tiles (80 for 640-wide images).
* @return condensed array of TpTask * @return condensed array of TpTask
*/ */
...@@ -4735,7 +4735,7 @@ public class GpuQuad{ // quad camera description ...@@ -4735,7 +4735,7 @@ public class GpuQuad{ // quad camera description
final double offset_scale, final double offset_scale,
final double magnitude_scale, final double magnitude_scale,
final int tilesX) { final int tilesX) {
final float fmagnitude_scale = (float) -magnitude_scale; final float fmagnitude_scale = (magnitude_scale==0)? 1.0f : ((float) -magnitude_scale);
final int tiles = vector_field.length; final int tiles = vector_field.length;
final TpTask [] tp_tasks_full = new TpTask [tiles]; final TpTask [] tp_tasks_full = new TpTask [tiles];
final Thread[] threads = ImageDtt.newThreadArray(); final Thread[] threads = ImageDtt.newThreadArray();
......
...@@ -1495,7 +1495,7 @@ public class ImageDtt extends ImageDttCPU { ...@@ -1495,7 +1495,7 @@ public class ImageDtt extends ImageDttCPU {
public void setRectilinearReferenceTD( public void setRectilinearReferenceTD(
final int erase_clt, final int erase_clt,
final float [] fpixels_ref, final float [] fpixels_ref, // if null, assumes GPU memory is already loaded
final int [] wh, // null (use sensor dimensions) or pair {width, height} in pixels final int [] wh, // null (use sensor dimensions) or pair {width, height} in pixels
final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
final boolean use_reference_buffer, final boolean use_reference_buffer,
...@@ -1516,14 +1516,15 @@ public class ImageDtt extends ImageDttCPU { ...@@ -1516,14 +1516,15 @@ public class ImageDtt extends ImageDttCPU {
lpf_rgb, lpf_rgb,
globalDebugLevel > 2); globalDebugLevel > 2);
// gpuQuad.printConstMem("lpf_data", true); // gpuQuad.printConstMem("lpf_data", true);
gpuQuad.setTasks( // copy tp_tasks to the GPU memory gpuQuad.setTasks( // copy tp_tasks to the GPU memory
tp_tasks, // TpTask [] tile_tasks, tp_tasks, // TpTask [] tile_tasks,
false, // use_aux); // boolean use_aux) false, // use_aux); // boolean use_aux)
imgdtt_params.gpu_verify); // boolean verify imgdtt_params.gpu_verify); // boolean verify
gpuQuad.setBayerImage( if (fpixels_ref != null) {
fpixels_ref, // float [] bayer_image, gpuQuad.setBayerImage(
0); // int ncam) fpixels_ref, // float [] bayer_image,
0); // int ncam)
}
// allocate before execConvertDirect, so it will not be modified // allocate before execConvertDirect, so it will not be modified
boolean allocated = gpuQuad.reAllocateClt( boolean allocated = gpuQuad.reAllocateClt(
wh, // int [] wh, wh, // int [] wh,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment