Merge pull request #17813 from hannesa2:FixTypo

This commit is contained in:
Alexander Alekhin 2020-07-11 19:20:49 +00:00
commit 3d50bde46e
2 changed files with 5 additions and 5 deletions

View File

@ -159,7 +159,7 @@ public class ColorBlobDetectionActivity extends CameraActivity implements OnTouc
for (int i = 0; i < mBlobColorHsv.val.length; i++)
mBlobColorHsv.val[i] /= pointCount;
mBlobColorRgba = converScalarHsv2Rgba(mBlobColorHsv);
mBlobColorRgba = convertScalarHsv2Rgba(mBlobColorHsv);
Log.i(TAG, "Touched rgba color: (" + mBlobColorRgba.val[0] + ", " + mBlobColorRgba.val[1] +
", " + mBlobColorRgba.val[2] + ", " + mBlobColorRgba.val[3] + ")");
@ -182,7 +182,7 @@ public class ColorBlobDetectionActivity extends CameraActivity implements OnTouc
if (mIsColorSelected) {
mDetector.process(mRgba);
List<MatOfPoint> contours = mDetector.getContours();
Log.e(TAG, "Contours count: " + contours.size());
Log.i(TAG, "Contours count: " + contours.size());
Imgproc.drawContours(mRgba, contours, -1, CONTOUR_COLOR);
Mat colorLabel = mRgba.submat(4, 68, 4, 68);
@ -195,7 +195,7 @@ public class ColorBlobDetectionActivity extends CameraActivity implements OnTouc
return mRgba;
}
private Scalar converScalarHsv2Rgba(Scalar hsvColor) {
private Scalar convertScalarHsv2Rgba(Scalar hsvColor) {
Mat pointMatRgba = new Mat();
Mat pointMatHsv = new Mat(1, 1, CvType.CV_8UC3, hsvColor);
Imgproc.cvtColor(pointMatHsv, pointMatRgba, Imgproc.COLOR_HSV2RGB_FULL, 4);

View File

@ -101,7 +101,7 @@ class ViewController: UIViewController, CvVideoCameraDelegate2 {
let pointCount = touchedRect.width*touchedRect.height
blobColorHsv = blobColorHsv.mul(Scalar.all(1.0/Double(pointCount)))
blobColorRgba = converScalarHsv2Rgba(hsvColor: blobColorHsv)
blobColorRgba = convertScalarHsv2Rgba(hsvColor: blobColorHsv)
NSLog("Touched rgba color: (\(blobColorRgba.val[0]), \(blobColorRgba.val[1]), \( blobColorRgba.val[2]), \(blobColorRgba.val[3])")
@ -113,7 +113,7 @@ class ViewController: UIViewController, CvVideoCameraDelegate2 {
}
}
func converScalarHsv2Rgba(hsvColor:Scalar) -> Scalar {
func convertScalarHsv2Rgba(hsvColor:Scalar) -> Scalar {
let pointMatRgba = Mat()
let pointMatHsv = Mat(rows: 1, cols: 1, type: CvType.CV_8UC3, scalar: hsvColor)
Imgproc.cvtColor(src: pointMatHsv, dst: pointMatRgba, code: .COLOR_HSV2RGB_FULL, dstCn: 4)