Mi piacerebbe sapere se avere variabili diverse per src (sorgente) e dst (destinazione) di una funzione OpenCV avrà un effetto sul tempo di elaborazione. Ho due funzioni sotto che fa la stessa cosa.Tempo di elaborazione OpenCV Mat
public static Mat getY(Mat m){
Mat mMattemp = new Mat();
Imgproc.cvtColor(m,mMattemp,Imgproc.COLOR_YUV420sp2RGB);
Imgproc.cvtColor(mMattemp,mMattemp, Imgproc.COLOR_RGB2HSV);
Core.inRange(mMattemp, new Scalar(20, 100, 100), new Scalar(30, 255, 255), mMattemp);
return mMattemp;
}
VERSUS
public static Mat getY(Mat m){
Mat mMattemp_rgb = new Mat();
Mat mMattemp_hsv = new Mat();
Mat mMattemp_ir = new Mat();
Imgproc.cvtColor(m,mMattemp_rgb,Imgproc.COLOR_YUV420sp2RGB);
Imgproc.cvtColor(mMattemp_rgb,mMattemp_hsv, Imgproc.COLOR_RGB2HSV);
Core.inRange(mMattemp_hsv, new Scalar(20, 100, 100), new Scalar(30, 255, 255), mMattemp_ir);
return mMattemp_ir;
}
Quale dei due è migliore? Qual è il vantaggio di uno rispetto all'altro?
http://codereview.stackexchange.com/ – ArtemStorozhuk
Per quanto ne so, ciò che è meglio dipende da ciascuna funzione. Penso che tu possa presumere che usare un dst diverso (se non lo crei apposta) sarà uguale o migliore di dst == src. –
Time it/profile it .. – volting