face

“Decoding error, image format unsupported” in Microsoft Face API

一世执手 提交于 2019-12-11 11:06:18
问题 I'm trying to use Microsoft Face API. For that I have the following code that was given by Microsoft as a sample (at the end of this page https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236): HttpClient httpclient = HttpClients.createDefault(); try { URIBuilder builder = new URIBuilder("https://api.projectoxford.ai/face/v1.0/detect"); builder.setParameter("returnFaceId", "false"); builder.setParameter("returnFaceLandmarks", "false"); builder

Paint cube faces as a whole, not the triangles that make up the face - three.js

杀马特。学长 韩版系。学妹 提交于 2019-12-06 10:25:39
问题 Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces.length; i++) { geometry.faces[i].color.setHex(Math.random() * 0xffffff); } var material = new THREE.MeshBasicMaterial({ color: 0xffffff, vertexColors: THREE.FaceColors }); But with three.js r86, I get the following result: Got the triangles that make up each face, painted individually. To achieve the

Paint cube faces as a whole, not the triangles that make up the face - three.js

末鹿安然 提交于 2019-12-04 16:50:38
Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces.length; i++) { geometry.faces[i].color.setHex(Math.random() * 0xffffff); } var material = new THREE.MeshBasicMaterial({ color: 0xffffff, vertexColors: THREE.FaceColors }); But with three.js r86, I get the following result: Got the triangles that make up each face, painted individually. To achieve the desirable effect, I used the following adaptation of the above code: var geometry = new THREE.BoxGeometry(5

Three.js - Merge multiple geometries/meshes removing common areas

拜拜、爱过 提交于 2019-12-04 13:51:27
问题 I´m trying to merge two geometries/meshes (red and blue) into a unique one. But after creating a new geometry and applying geometry.merge() I found that all the inner vertices and faces are still there (the green area). I would like to remove all that extra information, as it generates visual glitches on the rendered faces and also I cannot calculate the merged volume correctly.. I need something like on the last picture, a single mesh that only includes the minimal external/outer faces and

Cut rounded image with the face from CIDetector and CIFaceFeature

青春壹個敷衍的年華 提交于 2019-12-04 09:12:50
问题 How to cut the frame that I receive as faceViewBounds to make a big circle around the face? It's like a badge with the face of the person. Maybe I should get the center of faceViewBounds then I have to find this center in theImageView.image and draw a circle with big diameter and then cut the rest outside of the circle by logic, but with code I don't know how to do it.. Any suggestions? func detectFaceFrom(ImageView theImageView: UIImageView) { guard let personImage = CIImage(image:

Three.js - Merge multiple geometries/meshes removing common areas

流过昼夜 提交于 2019-12-03 08:57:12
I´m trying to merge two geometries/meshes (red and blue) into a unique one. But after creating a new geometry and applying geometry.merge() I found that all the inner vertices and faces are still there (the green area). I would like to remove all that extra information, as it generates visual glitches on the rendered faces and also I cannot calculate the merged volume correctly.. I need something like on the last picture, a single mesh that only includes the minimal external/outer faces and vertices, removing the inner ones. I tried applying ThreeCSG to subtract meshes but I´m founding that it

Three.js: Convert face normal from local space to world space

梦想与她 提交于 2019-11-30 23:10:15
I have a THREE.PlaneGeometry , with ComputeFaceNormals() . I create two meshes using this geometry, with different rotations applied to them. I want to compute the two angles between the camera and the two meshes central face normal. It should be : vLocalCamera = vCamera.position - mesh1.position; mesh1.normal() . vLocalCamera = cos(angle); The problem is that I don't know how to get the mesh normal in world coordinate (from geometry and mesh rotation) with three.js API If you want to convert a face or vertex normal, normal , from local space to world space, you do it like so: var normalMatrix

Change the colors of a cube's faces

孤街醉人 提交于 2019-11-28 13:28:01
I actually found this question, but it says material.color doesn't exist. I need to know how to change the colors of the various faces of a cube I'm drawing: var newCube = new THREE.Mesh(new three.CubeGeometry(size, size, size), new three.MeshNormalMaterial({ vertexColors: three.FaceColors })); Here is how you set and change the colors of a cube's faces: var geometry = new THREE.BoxGeometry( size, size, size ); for ( var i = 0; i < geometry.faces.length; i ++ ) { geometry.faces[ i ].color.setHex( Math.random() * 0xffffff ); } var material = new THREE.MeshBasicMaterial( { color: 0xffffff,

人脸识别

こ雲淡風輕ζ 提交于 2019-11-28 05:39:25
from flask import Flask,request,render_template,redirect,url_for import cv2,face_recognition,re,json,uuid,pymysql from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.debug = True # 调试模式 pymysql.install_as_MySQLdb() app.config["SQLALCHEMY_DATABASE_URI"]="mysql://root:123@127.0.0.1:3306/face" app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False db = SQLAlchemy(app) class Face(db.Model): __tablename__ = "face" id = db.Column(db.Integer,primary_key=True) name = db.Column(db.String(32),doc="文件名",unique=True) path = db.Column(db.VARCHAR(255),doc="路径",unique=True) def __init__(self,name

Change the colors of a cube's faces

折月煮酒 提交于 2019-11-27 06:44:39
问题 I actually found this question, but it says material.color doesn't exist. I need to know how to change the colors of the various faces of a cube I'm drawing: var newCube = new THREE.Mesh(new three.CubeGeometry(size, size, size), new three.MeshNormalMaterial({ vertexColors: three.FaceColors })); 回答1: Here is how you set and change the colors of a cube's faces: var geometry = new THREE.BoxGeometry( size, size, size ); for ( var i = 0; i < geometry.faces.length; i ++ ) { geometry.faces[ i ]