android - OpenCv Core.add error -


I have a problem with this Metod the opencv library ...

  Imgproc CvtColor (Image, image, Improp. COLOR_RGBA2RGB); Mat prob_fgd = new mat (1, 1, CvType.CV_8U, new scalar (Igprok. Jisi_ PR_FGD)); Try IMGproc.grabCut (Image, Firstmask, Rect, BGModel, FGModel, 3, 0); } Hold (exception w) {System.out.println (w.getMessage ()); } Core.compare (firstmask, prob_fgd, firstmask, core.cmp_uk); Foreground = new matte (image size), cvtpcv_8 uc3, new scalar (255, 255, 255)); Image.copyTo (foreground, first mask); Imgproc.resize (background, background, image.size ()); Mask = new mat (image.size (), cvType.CV_8UC1, new scalar (100, 255, 100)); Foreground = overlay_colored_roi (foreground, new scalar (100, 255, 100)); Imgproke. CvtColor (foreground, mask, Improprop. COLOR_BGR2GRAY); Imgproc.threshold (Mask, Mask, 254, 255, Imgproke. THRESH_BINARY_INV); Mask.copyTo (referee); Vals = new matte (1, 1, CvType.CV_8UC3, new scalar (0.0)); Background.copyTo (DST); Background. Settau (Walls, Mask);   

Even code works. Here it stops.

Log that the input element of the core should be the same size but the background. Size ()) Foreground size ()) dst.size () Mask size ()) are equal.

  Core.add (background, foreground, DST, mask);    

They should channel at the same number. Since the code shown in the background starts I'm assuming that this check Try normal joint function thing.Welcome be a problem without a mask and output. If the problem still continues the whole code, then It helps.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -