我正在将Python代码重写为Java代码(Android),但我不知道如何在图像上执行函数.shape
Python:
def getProcessedImage(srcImage):
image = copy.copy(srcImage)
print ("image.shape"), image.shape
r = 600.0 / image.shape[1]
dim = (600, int(image.shape[0] * r))
print ("dimension ="), dim
爪哇:
public Mat getProcessedImage(srcImage) {
Mat image = new Mat(srcImage);
srcImage.copyTo(image);
Object[] truple = new Object[Array.getLength(srcImage)] //Got stuck here and don't even think its correct
// Mat processedImage =.......
return processedImage;
}
java中的shape与python中的shape等价物是
srcImage.size().width
和srcImage.size().height
相关问题 更多 >
编程相关推荐