小编Hua*_*ang的帖子

Android camera2镜头内在校准

我下载了一个Android camera2 演示版,运行良好.

现在我想通过查询CameraCharacteristics来获取相机的内在矩阵.

我的代码是

private void setUpCameraOutputs(int width, int height) {
    Activity activity = getActivity();
    CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);
    try {
        for (String cameraId : manager.getCameraIdList()) {
            CameraCharacteristics characteristics
                    = manager.getCameraCharacteristics(cameraId);
            float[] intrinsic = new float[5];
            intrinsic = characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION);
    //...... leave out the following part
        }
    }
Run Code Online (Sandbox Code Playgroud)

内部函数应该是一个5元素数组,但intrinsic = characteristics.get(CameraCharacteristics.LENS_INTRINSIC_CALIBRATION)返回null.

java android android-hardware android-camera android-camera2

1
推荐指数
1
解决办法
1210
查看次数

将半定程序从 CVX 转换为 CVXPY

我想将以下 SDP(它只是验证约束的可行性)从 CVX (MATLAB) 转换为 CVXPY (Python):

Ah = [1.0058, -0.0058; 1, 0];
Bh = [-1; 0];
Ch = [1.0058, -0.0058; -0.9829, 0.0056];
Dh = [-1; 1];

M = [0, 1;1, 0];
ni = size(M,1)/2;
n = size(Ah,1);
rho = 0.5;

cvx_begin sdp quiet
    variable P(n,n) semidefinite
    variable lambda(ni) nonnegative
    Mblk = M*kron(diag(lambda),eye(2));
    lambda(ni) == 1  % break homogeneity (many ways to do this...)
    [Ah Bh]'*P*[Ah Bh] - rho^2*blkdiag(P,0) + [Ch Dh]'*Mblk*[Ch Dh] <= 0
cvx_end


switch cvx_status
    case 'Solved' …
Run Code Online (Sandbox Code Playgroud)

python matlab convex-optimization cvx cvxpy

0
推荐指数
1
解决办法
1403
查看次数