You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
MxArray.cpp line 714:
Is:
return cv::Moments(
(isField("m00")) ? at("m00", index).toDouble() : 0,
(isField("m10")) ? at("m10", index).toDouble() : 0,
(isField("m01")) ? at("m01", index).toDouble() : 0,
(isField("m20")) ? at("m20", index).toDouble() : 0,
(isField("m11")) ? at("m11", index).toDouble() : 0,
(isField("m02")) ? at("m02", index).toDouble() : 0,
(isField("m30")) ? at("m30", index).toDouble() : 0,
(isField("m12")) ? at("m12", index).toDouble() : 0,
(isField("m21")) ? at("m21", index).toDouble() : 0,
(isField("m03")) ? at("m03", index).toDouble() : 0
);
Should be:
return cv::Moments(
(isField("m00")) ? at("m00", index).toDouble() : 0,
(isField("m10")) ? at("m10", index).toDouble() : 0,
(isField("m01")) ? at("m01", index).toDouble() : 0,
(isField("m20")) ? at("m20", index).toDouble() : 0,
(isField("m11")) ? at("m11", index).toDouble() : 0,
(isField("m02")) ? at("m02", index).toDouble() : 0,
(isField("m30")) ? at("m30", index).toDouble() : 0,
(isField("m21")) ? at("m21", index).toDouble() : 0,
(isField("m12")) ? at("m12", index).toDouble() : 0,
(isField("m03")) ? at("m03", index).toDouble() : 0
);
Alternatively, copy all input fields instead of recalculating the central and normalized moments:
cv::Moments mo;
mo.m00 = (isField("m00")) ? at("m00", index).toDouble() : 0;
mo.m10 = (isField("m10")) ? at("m10", index).toDouble() : 0;
mo.m01 = (isField("m01")) ? at("m01", index).toDouble() : 0;
mo.m20 = (isField("m20")) ? at("m20", index).toDouble() : 0;
mo.m11 = (isField("m11")) ? at("m11", index).toDouble() : 0;
mo.m02 = (isField("m02")) ? at("m02", index).toDouble() : 0;
mo.m30 = (isField("m30")) ? at("m30", index).toDouble() : 0;
mo.m12 = (isField("m12")) ? at("m12", index).toDouble() : 0;
mo.m21 = (isField("m21")) ? at("m21", index).toDouble() : 0;
mo.m03 = (isField("m03")) ? at("m03", index).toDouble() : 0;
mo.mu20 = (isField("mu20")) ? at("mu20", index).toDouble() : 0;
mo.mu11 = (isField("mu11")) ? at("mu11", index).toDouble() : 0;
mo.mu02 = (isField("mu02")) ? at("mu02", index).toDouble() : 0;
mo.mu30 = (isField("mu30")) ? at("mu30", index).toDouble() : 0;
mo.mu21 = (isField("mu21")) ? at("mu21", index).toDouble() : 0;
mo.mu12 = (isField("mu12")) ? at("mu12", index).toDouble() : 0;
mo.mu03 = (isField("mu03")) ? at("mu03", index).toDouble() : 0;
mo.nu20 = (isField("nu20")) ? at("nu20", index).toDouble() : 0;
mo.nu11 = (isField("nu11")) ? at("nu11", index).toDouble() : 0;
mo.nu02 = (isField("nu02")) ? at("nu02", index).toDouble() : 0;
mo.nu30 = (isField("nu30")) ? at("nu30", index).toDouble() : 0;
mo.nu12 = (isField("nu12")) ? at("nu12", index).toDouble() : 0;
mo.nu21 = (isField("nu21")) ? at("nu21", index).toDouble() : 0;
mo.nu03 = (isField("nu03")) ? at("nu03", index).toDouble() : 0;
return mo;
The text was updated successfully, but these errors were encountered: