我已经开发了一个WebApplication,它基本上允许用户注册和上传照片,但是由于它是可移动的Web应用程序,因此用户可以捕获实时照片并上传。现在,我被要求检查是否可以在捕获图片时提供类似人的叠加的功能,换句话说,当用户尝试捕获时,他可以在屏幕上看到带有头部轮廓的肩部,因此他可以将自己匹配到轮廓和捕获它..
我正在使用HTML5,但确实知道它将通过某个插件或NATIVE APP(在这种情况下对我没有帮助)。
那么,外面有人尝试过这种事情还是知道我们是否可以这样做?(请参阅附件以了解更多信息) 在此处输入图片描述
先感谢您。
可以解释一下我应该如何向用户许可解释
我使用Camera2API,我实现了这样的代码片段,以恐怖的方式询问permishion
private void openCamera(int width, int height) {
setUpCameraOutputs(width, height);
CameraHelper.configureTransform(width, height, textureView, previewSize, getActivity());
CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
try {
if (!cameraOpenCloseLock.tryAcquire(2500, TimeUnit.MILLISECONDS)) {
throw new RuntimeException("Time out waiting to lock camera opening.");
}
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=
PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try …Run Code Online (Sandbox Code Playgroud) 我正在创建一个带有自定义相机的Android应用程序,我正在切换到新的camera2 API.我有一个按钮,可以在后置摄像头开启时打开和关闭闪光灯(不停止摄像头,就像任何经典的相机应用程序一样).
当我点击闪存图标时,没有任何反应,这就是logcat返回的内容:
D/ViewRootImpl: ViewPostImeInputStage processPointer 0
D/ViewRootImpl: ViewPostImeInputStage processPointer 1
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它不起作用.这是代码:
我有一个RecordVideoActivity使用RecordVideoFragment.这是片段的XML部分,其中包含flash按钮代码:
<ImageButton
android:id="@+id/button_flash"
android:src="@drawable/ic_flash_off"
android:layout_alignParentLeft="true"
style="@style/actions_icons_camera"
android:onClick="actionFlash"/>
Run Code Online (Sandbox Code Playgroud)
和Java代码:
ImageButton flashButton;
private boolean hasFlash;
private boolean isFlashOn = false;
Run Code Online (Sandbox Code Playgroud)
随着onViewCreated:
@Override
public void onViewCreated(final View view, Bundle savedInstanceState) {
...
[some code]
...
// Flash on/off button
flashButton = (ImageButton) view.findViewById(R.id.button_flash);
// Listener for Flash on/off button
flashButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
actionFlash();
}
});
Run Code Online (Sandbox Code Playgroud)
这是actionFlash()函数定义:
private …Run Code Online (Sandbox Code Playgroud) 我有一个Raspberry Pi Camera v2.1版本,能够以3280x2464的分辨率拍照。
我已经使用raspistill命令进行了测试,这似乎可以正常工作:
raspistill -o 8mp.png -w 3280 -h 2464
Run Code Online (Sandbox Code Playgroud)
返回信息:
8mp.png JPEG 3280x2464 3280x2464+0+0 8-bit sRGB 4.524MB 0.010u 0:00.010
Run Code Online (Sandbox Code Playgroud)
但是,当我使用Python代码拍照时,它会拒绝它。这是我正在使用的代码:
#!/usr/bin/python
import picamera
camera = picamera.PiCamera()
camera.resolution = (3280,2464)
camera.capture("test.png")
camera.close()
Run Code Online (Sandbox Code Playgroud)
这是错误:
mmal: mmal_vc_port_enable: failed to enable port vc.ril.image_encode:out:0(PNG ): ENOSPC
mmal: mmal_port_enable: failed to enable port vc.ril.image_encode:out:0(PNG )(0x700090) (ENOSPC)
Traceback (most recent call last):
File "pic.py", line 6, in <module>
camera.capture("test.png")
File "/usr/local/lib/python2.7/dist-packages/picamera/camera.py", line 1383, in capture
encoder.start(output)
File "/usr/local/lib/python2.7/dist-packages/picamera/encoders.py", line 1024, in start
super(PiCookedOneImageEncoder, self).start(output) …Run Code Online (Sandbox Code Playgroud) 这一切都在标题中,但在现已弃用的Android Camera API中,有两种方法:Camera.Parameters.getHorizontalViewAngle()和Camera.Parameters.getVerticalViewAngle().
现在,使用当前的Camera2 API,似乎在文档中没有相应的内容.我假设这是因为FOV角度比简单的水平和垂直值更复杂和细微,但我在网上找不到有关如何使用较新的Camera2 API计算Android设备的总视野的任何信息.
这个问题再问一次,但我找不到ios 10
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)
{
self.imagePicker.delegate = self
self.imagePicker.sourceType = UIImagePickerControllerSourceType.camera;
self.imagePicker.allowsEditing = false
self.imagePicker.cameraCaptureMode = .photo
//self.imagePicker.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
self.present(self.imagePicker, animated: true, completion: nil)
self.imagePicked.isUserInteractionEnabled = true
}
else
{
print("No Camera")
}
Run Code Online (Sandbox Code Playgroud)
对未渲染的视图进行快照会导致快照为空。请确保在快照之前至少对视图进行一次渲染或在屏幕更新后进行快照。
当我旋转相机拍摄照片时,会发生此错误。
我需要找到一个摄像头正在注视哪个方向,例如,如果它的望着Z+,Z-,X+,或X-.
我已经尝试过使用了eulerAngles,但偏航的范围是0- > 90- > 0- > -90- > 0这意味着我只能检测相机是否正在朝向,Z或者X不是在向这些轴的正方向或负方向看.
我希望有人可以在这里提供帮助。我有这个Xcode / Unity项目,每次尝试构建它时,都会出现此错误:
该应用已崩溃,因为它尝试访问没有使用说明的隐私敏感数据。该应用程序的Info.plist必须包含一个NSPhotoLibraryAddUsageDescription键,该键具有字符串值,该字符串值向用户说明该应用程序如何使用此数据。
我了解在info.plist中,我需要使用相机,资料库等的描述,但据我所知,我有吗?
这是我的info.plist:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>MyGame</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>AppIcon57x57@2x.png</string>
<string>AppIcon60x60@2x.png</string>
<string>AppIcon72x72@2x~ipad.png</string>
<string>AppIcon72x72~ipad.png</string>
<string>AppIcon76x76@2x~ipad.png</string>
<string>AppIcon76x76~ipad.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.mycompany.${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true />
</dict>
<key>UIApplicationExitsOnSuspend</key>
<false />
<key>UILaunchStoryboardName~ipad</key>
<string>LaunchScreen-iPad</string>
<key>UILaunchStoryboardName~iphone</key>
<string>LaunchScreen-iPhone</string>
<key>UILaunchStoryboardName~ipod</key>
<string>LaunchScreen-iPhone</string>
<key>UIPrerenderedIcon</key>
<false />
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true />
<key>UIRequiresPersistentWiFi</key>
<false />
<key>UIStatusBarHidden</key>
<true …Run Code Online (Sandbox Code Playgroud) 背景:
为简单起见,我有3台相机。其中每个都由其自己校准(其间隙参数是已知且足够准确的)
他们都有几乎相同的观点。我想使用3台摄像机的系统进行3D重建。我已经分别校准了每对(1和2、2和3以及1和3)。从而产生3个变换矩阵。从理论上讲,这三个变换矩阵应具有以下适当性:
T13 = T12 * T23
Run Code Online (Sandbox Code Playgroud)
或采用其他公式:
T31 * T12 * T23 = Identity
Run Code Online (Sandbox Code Playgroud)
但是,实际上,这是不正确的。由于校准误差,结果与相同的矩阵有一点点偏移。
Error = [T31 * T12 * T23] - [Identity] Eq.3
Run Code Online (Sandbox Code Playgroud)
问题:
我觉得单独校准每对相机是一个坏主意。通过应用某种将三对全部融合在一起的全局优化,尝试使方程式(3)的误差最小,应该会得到更好的结果。
我的问题是:
关于此问题是否有任何已知的先前工作。任何想法如何使用OpenCV来实现我的目标,因此我不再赘述。
camera opencv computer-vision 3d-reconstruction camera-calibration
开始使用前置摄像头玩MLKit面部检测器,但是在处理面部时确实很慢
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
print("Picture at ", Date())
let visionImage = VisionImage(buffer: sampleBuffer)
visionImage.metadata = metadata
faceDetector?.detect(in: visionImage) { (faces, error) in
guard error == nil, let faces = faces, !faces.isEmpty else {
// Error. You should also check the console for error messages.
let errorString = error?.localizedDescription
print("Face detection failed with error: \(errorString)")
return
}
}
Run Code Online (Sandbox Code Playgroud)
我要去哪里错了?