V plane is actually the 3rd array entry, not the 4th

This commit is contained in:
Isaac Connor 2022-02-03 08:19:08 -05:00
parent bd68b9e3af
commit fd7f7f851a
1 changed files with 5 additions and 5 deletions

View File

@ -2020,7 +2020,7 @@ bool Monitor::Analyse() {
) ) { ) ) {
Debug(1, "assigning refimage from v-channel"); Debug(1, "assigning refimage from v-channel");
Image v_image(snap->in_frame->width, Image v_image(snap->in_frame->width,
snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[3], 0); snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
ref_image.Assign(v_image); ref_image.Assign(v_image);
} else if (snap->image) { } else if (snap->image) {
Debug(1, "assigning refimage from snap->image"); Debug(1, "assigning refimage from snap->image");
@ -2110,7 +2110,7 @@ bool Monitor::Analyse() {
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P) ((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
) ) { ) ) {
Debug(1, "assigning refimage from v-channel"); Debug(1, "assigning refimage from v-channel");
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[3], 0); Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
ref_image.Assign(v_image); ref_image.Assign(v_image);
} else { } else {
Debug(1, "assigning refimage from snap->image"); Debug(1, "assigning refimage from snap->image");
@ -2125,7 +2125,7 @@ bool Monitor::Analyse() {
|| ||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P) ((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
) ) { ) ) {
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[3], 0); Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
snap->score = DetectMotion(v_image, zoneSet); snap->score = DetectMotion(v_image, zoneSet);
} else { } else {
snap->score = DetectMotion(*(snap->image), zoneSet); snap->score = DetectMotion(*(snap->image), zoneSet);
@ -2350,7 +2350,7 @@ bool Monitor::Analyse() {
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P) ((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
) ) { ) ) {
Debug(1, "Assigning from vchannel"); Debug(1, "Assigning from vchannel");
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[3], 0); Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
ref_image.Assign(v_image); ref_image.Assign(v_image);
} else if (snap->image) { } else if (snap->image) {
Debug(1, "Assigning"); Debug(1, "Assigning");
@ -2365,7 +2365,7 @@ bool Monitor::Analyse() {
) )
) { ) {
Debug(1, "Blending from vchannel"); Debug(1, "Blending from vchannel");
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[3], 0); Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
ref_image.Blend(v_image, ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc )); ref_image.Blend(v_image, ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc ));
} else if (snap->image) { } else if (snap->image) {
Debug(1, "Blending because %p and format %d != %d, %d", snap->in_frame, Debug(1, "Blending because %p and format %d != %d, %d", snap->in_frame,