Android摄像头:设置测光点位置

时间:2017-08-04 07:56:57

标签: android camera android-camera

我试图将tap专注于三星Xcover4,用于工业应用(特定于此设备)。 我们的想法是将设备塞进一个带有摄像头孔的盒子里,然后用它来扫描带有qr码的卡片。

所以"扫描区"始终是相同的,应该在应用程序以点按开始时设置。一旦完成,相机应始终专注于该区域并计算该位置的曝光

我正在使用Xzing库,因此我稍微攻击了CameraManager管理器类,它可以用于固定焦点区域。

我找到了" spot"通过倾倒原生相机参数来计量值,但有一点我无法弄清楚如何设置它的位置。我想它可以做到,因为三星在原生相机应用程序中做到了。

ArrayList<Camera.Area> focusAreas = new ArrayList<Camera.Area>();
focusAreas.add(new Camera.Area(focusArea, 1000));

cameraParameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
cameraParameters.setFocusAreas(focusAreas);
cameraParameters.setMeteringAreas(focusAreas);
cameraParameters.setZoom(0);
cameraParameters.set("metering", "spot");
camera.setParameters(cameraParameters);
camera.autoFocus(autoFocusManager);

以下是natvie相机参数列表。

3dnr=false;
Infinity=Infinity;
antibanding=50hz;
antibanding-values=auto,50hz;
auto-exposure-lock-supported=true;
auto-whitebalance-lock-supported=true;
best-capture=0;
brightness=0;
brightness-max=2;
brightness-min=-2;
burst-capture=0;
burstshot-fps-values=(4,4);
constant-growth-rate-zoom-supported=true;
contrast=auto;
drc=false;
dual_mode=-1;
dualrecording-hint=-1;
dynamic-range-control=off;
effect=none;
effect-available-fps-values=(10000,15000);
effect-values=none,mono,negative,sepia,posterize;
effectrecording-hint=0;
exposure-compensation=0;
exposure-compensation-step=0.1;
fast-fps-mode=-1;
flash-mode=off;
flash-mode-values=off,auto,on,torch;
fnumber-value-denominator=10;
fnumber-value-numerator=19;
focal-length=3.70;
focallength-35mm-value=28;
focallength-value-denominator=100;
focallength-value-numerator=370;
focus-areas=(257,416,263,422,1000);
focus-distances=0.10,1.20,Infinity;
focus-mode=auto;
focus-mode-values=auto,macro,continuous-video,continuous-picture;
hdr-mode=0;
horizontal-view-angle=62.2;
hue=0;
hue-max=2;
hue-min=-2;
imageuniqueid-value=V13LLIA02PM V13LLKB16SA
;
intelligent-mode=-1;
iso=auto;
iso-values=auto,100,200,400,800;
jpeg-quality=96;
jpeg-thumbnail-height=384;
jpeg-thumbnail-quality=100;
jpeg-thumbnail-size-values=512x384,512x288,384x384,320x240,0x0;
jpeg-thumbnail-width=512;
max-exposure-compensation=20;
max-num-detected-faces-hw=16;
max-num-detected-faces-sw=0;
max-num-focus-areas=1;
max-num-metering-areas=0;
max-zoom=30;
maxaperture-value-denominator=100;
maxaperture-value-numerator=185;
metering=center;
metering-areas=;
metering-values=matrix,center,spot;
min-exposure-compensation=-20;
odc=false;
phase-af=off;
phase-af-values=off;
picture-format=jpeg;
picture-format-values=jpeg;
picture-size=4128x3096;
picture-size-values=4128x3096,4128x2322,3264x2448,3264x1836,3088x3088,2160x2160,2048x1536,2048x1152,1920x1080,1440x1080,1280x720,960x720,640x480,320x240;
preferred-preview-size-for-video=1280x720;
preview-format=yuv420sp;
preview-format-values=yuv420sp,yuv420p;
preview-fps-range=15000,30000;
preview-fps-range-values=(15000,15000),(24000,24000),(15000,30000),(30000,30000);
preview-frame-rate=30;
preview-frame-rate-values=15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30;
preview-size=1280x720;
preview-size-values=1280x720,1056x704,960x720,880x720,720x720,720x480,640x480,352x288,320x240,176x144;
rotation=0;
rt-hdr=off;
rt-hdr-values=off;
saturation=0;
saturation-max=2;
saturation-min=-2;
scene-mode=auto;
scene-mode-values=auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight;
sharpness=0;
sharpness-max=2;
sharpness-min=-2;
smooth-zoom-supported=false;
vertical-view-angle=39.4;
video-frame-format=nv21;
video-size=1920x1080;
video-size-values=1920x1080,1440x1080,1072x1072,1280x720,960x720,800x450,720x480,640x480,480x320,352x288,320x240,176x144;
video-snapshot-supported=true;
video-stabilization-supported=false;
vrmode=-1;
wdr=0;
whitebalance=auto;
whitebalance-values=auto,incandescent,fluorescent,daylight,cloudy-daylight;
zoom=0;
zoom-ratios=100,104,109,114,120,125,131,138,144,151,158,166,174,182,190,200,209,219,229,240,251,263,276,289,303,317,332,348,364,381,400;
zoom-supported=true

谢谢。

0 个答案:

没有答案