Search Results

Search found 11448 results on 458 pages for 'video camera'.

Page 1/458 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • WebGL First Person Camera - Matrix issues

    - by Ryan Welsh
    I have been trying to make a WebGL FPS camera.I have all the inputs working correctly (I think) but when it comes to applying the position and rotation data to the view matrix I am a little lost. The results can be viewed here http://thistlestaffing.net/masters/camera/index.html and the code here var camera = { yaw: 0.0, pitch: 0.0, moveVelocity: 1.0, position: [0.0, 0.0, -70.0] }; var viewMatrix = mat4.create(); var rotSpeed = 0.1; camera.init = function(canvas){ var ratio = canvas.clientWidth / canvas.clientHeight; var left = -1; var right = 1; var bottom = -1.0; var top = 1.0; var near = 1.0; var far = 1000.0; mat4.frustum(projectionMatrix, left, right, bottom, top, near, far); viewMatrix = mat4.create(); mat4.rotateY(viewMatrix, viewMatrix, camera.yaw); mat4.rotateX(viewMatrix, viewMatrix, camera.pitch); mat4.translate(viewMatrix, viewMatrix, camera.position); } camera.update = function(){ viewMatrix = mat4.create(); mat4.rotateY(viewMatrix, viewMatrix, camera.yaw); mat4.rotateX(viewMatrix, viewMatrix, camera.pitch); mat4.translate(viewMatrix, viewMatrix, camera.position); } //prevent camera pitch from going above 90 and reset yaw when it goes over 360 camera.lockCamera = function(){ if(camera.pitch > 90.0){ camera.pitch = 90; } if(camera.pitch < -90){ camera.pitch = -90; } if(camera.yaw <0.0){ camera.yaw = camera.yaw + 360; } if(camera.yaw >360.0){ camera.yaw = camera.yaw - 0.0; } } camera.translateCamera = function(distance, direction){ //calculate where we are looking at in radians and add the direction we want to go in ie WASD keys var radian = glMatrix.toRadian(camera.yaw + direction); //console.log(camera.position[3], radian, distance, direction); //calc X coord camera.position[0] = camera.position[0] - Math.sin(radian) * distance; //calc Z coord camera.position[2] = camera.position [2] - Math.cos(radian) * distance; console.log(camera.position [2] - (Math.cos(radian) * distance)); } camera.rotateUp = function(distance, direction){ var radian = glMatrix.toRadian(camera.pitch + direction); //calc Y coord camera.position[1] = camera.position[1] + Math.sin(radian) * distance; } camera.moveForward = function(){ if(camera.pitch!=90 && camera.pitch!=-90){ camera.translateCamera(-camera.moveVelocity, 0.0); } camera.rotateUp(camera.moveVelocity, 0.0); } camera.moveBack = function(){ if(camera.pitch!=90 && camera.pitch!=-90){ camera.translateCamera(-camera.moveVelocity, 180.0); } camera.rotateUp(camera.moveVelocity, 180.0); } camera.moveLeft = function(){ camera.translateCamera(-camera.moveVelocity, 270.0); } camera.moveRight = function(){ camera.translateCamera(-camera.moveVelocity, 90.0); } camera.lookUp = function(){ camera.pitch = camera.pitch + rotSpeed; camera.lockCamera(); } camera.lookDown = function(){ camera.pitch = camera.pitch - rotSpeed; camera.lockCamera(); } camera.lookLeft = function(){ camera.yaw= camera.yaw - rotSpeed; camera.lockCamera(); } camera.lookRight = function(){ camera.yaw = camera.yaw + rotSpeed; camera.lockCamera(); } . If there is no problem with my camera then I am doing some matrix calculations within my draw function where a problem might be. //position cube 1 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.translate(worldMatrix, worldMatrix, [-20.0, 0.0, -30.0]); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); setShaderMatrix(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.vertexAttribPointer(shaderProgram.attPosition, 3, gl.FLOAT, false, 8*4,0); gl.vertexAttribPointer(shaderProgram.attTexCoord, 2, gl.FLOAT, false, 8*4, 3*4); gl.vertexAttribPointer(shaderProgram.attNormal, 3, gl.FLOAT, false, 8*4, 5*4); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, myTexture); gl.uniform1i(shaderProgram.uniSampler, 0); gl.useProgram(shaderProgram); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); //position cube 2 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); mat4.translate(worldMatrix, worldMatrix, [40.0, 0.0, -30.0]); setShaderMatrix(); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); //position cube 3 worldMatrix = mat4.create(); mvMatrix = mat4.create(); mat4.multiply(mvMatrix, worldMatrix, viewMatrix); mat4.translate(worldMatrix, worldMatrix, [20.0, 0.0, -100.0]); setShaderMatrix(); gl.drawArrays(gl.TRIANGLES, 0, vertexBuffer.numItems); camera.update();

    Read the article

  • Best WordPress Video Themes for a Video Blog

    - by Matt
    WordPress has made blogging so easy & fun, there are plenty of video blog themes that you can pick from. However there is always rarity in quality. We at JustSkins have gathered some high quality, tested, tried video themes list. We tried to find some WordPress themes for vloggers, we knew all along that there are very few yet some of them are just brilliant premium wordpress themes. More on that later, let’s find out some themes which you can install on your vlog right now. On Demand 2.0 A fully featured video WordPress premium theme from Press75. Includes  theme options panel for personal customization and content management options, post thumbnails, drop down navigation menu, custom widgets and lots more. Demo | Price: $75 | DOWNLOAD VideoZoom An outstanding premium WordPress video theme from WPZoom featuring standard video integration plus additionally it lets you play any video from all the popular video websites. VideoZoom theme also includes a featured video slider on the homepage, multiple post layout options, theme options panel, WordPress 3.0 menus, backgrounds etc. Demo | Price Single: $69, Developer: $149 | DOWNLOAD Vidley Press75′s easy to use premium WordPress video theme. This theme is full of great features, it can be a perfect choice if you intend to make it a portal someday..it is scalable to shape like a news portal or portfolios. The Theme is widget ready. It has ability to place Featured Content and Featured Category section on homepage. The drop down menus on this theme are nifty! Demo | Price $75 |  DOWNLOAD Live A video premium WordPress theme designed for streaming video, and live event broadcasting. You can embed live video broadcasts from third party services like Ustream etc, and features a prominent timer counting down to the next broadcast, rotating bumper images, Facebook and twitter integration for viewer interaction, theme admin options panel and more make this theme one of its kind. Demo | Price: $99, Support License: $149| DOWNLOAD Groovy Video Woo Themes is pioneer in making beautiful wordpress themes,  One such theme that is built by keeping the video blogger in mind. The Groovy Theme is very colourful video blog premium WordPress theme. Creating video posts is quick and easy with just a copy / paste of the video’s embed code. The theme enables automatic video resizing, plenty of widgets. Also allows you to pick color of your choice. Price: Single Use $70, Developer Price : $150 | DOWNLOAD Video Flick Another exciting Video blogging theme by Press75 is the Video Flick theme. Video Flick is compatible with any video service that provides embed code, or if you want to host your own videos, Video Flick is also compatible with FLV (Flash Video) and Quicktime formats. This theme allows you to either keep standard Blog and/or have Video posts. You can pick a light or dark color option. Demo | Price : $75 | DOWNLOAD Woo Tube An excellent video premium WordPress theme from Woothemes, the WooTube theme is a very easy video blog platform, as it comes with  automatic video resizing, a completely widgetised sidebar and 7 different colour schemes to choose from. The theme  has the ability to be used as a normal blog or a gallery. A very wise choice! Price: Single Use $70, Developer Price : $150 | DOWNLOAD eVid Theme One of the nicest WordPress theme designed specifically for the video bloggers. Simple to integrate videos from video hosts such as Youtube, Vimeo, Veoh, MetaCafe etc. Demo | Price: $19 | DOWNLOAD Tubular A video premium WordPress theme from StudioPress which can also be used as a used a simple website or a blog. The theme is also available in a light color version. Demo | Price: $59.95 | DOWNLOAD Video Elements 2.0 Another beautiful video premium WordPress theme from Press75. Video Elements 2.0 has been re-designed to include the features you need to easily run and maintain a video blog on WordPress. Demo | Price: $75 | DOWNLOAD TV Elements 3.0 The theme includes a featured video carousel on the homepage which can display any number of videos, a featured category section which displays up to 12 channels, creates automatic thumbnails and a lots more… Demo | Price: $75 | DOWNLOAD Wave A beautiful premium video wordpress theme, Flexible & Super cool looking. The Design has very earthy feel to it. The theme has featured video area & latest listing on the homepage. All in all a simple design no fancy features. Demo | Price: $35 | Download

    Read the article

  • DIY Camera Carrier Turns any Bag into a Camera Bag

    - by Jason Fitzpatrick
    The biggest problem with camera bags is that they look like camera bags and thus become a perfect target for thieves. This DIY camera carrier lets you slip a lens and camera holder into any bag to help conceal and protect your gear. The project comes to us courtesy of Joy, a designer and crafter, and her adventures in making a DIY camera carrier to help protect her camera while carrying it discretely in her purse. You’ll need some basic sewing skills and access to a sewing machine; to follow along check out the link below and adjust the dimensions of her design to fit your bag. Camera Carrier Insert Tutorial [via Apartment Therapy] HTG Explains: Is ReadyBoost Worth Using? HTG Explains: What The Windows Event Viewer Is and How You Can Use It HTG Explains: How Windows Uses The Task Scheduler for System Tasks

    Read the article

  • Smithsonian Showcases Video Game History with The Art of Video Games [Video]

    - by Jason Fitzpatrick
    The Art of Video Games is the Smithsonian’s look at the history of video games; check out this video trailer to see what the exhibition is all about and hear from some notable folks. From the Smithsonian listing for the exhibition: The Art of Video Games is one of the first exhibitions to explore the forty-year evolution of video games as an artistic medium, with a focus on striking visual effects and the creative use of new technologies. It features some of the most influential artists and designers during five eras of game technology, from early pioneers to contemporary designers. The exhibition focuses on the interplay of graphics, technology and storytelling through some of the best games for twenty gaming systems ranging from the Atari VCS to the PlayStation 3. The exhibit will be at the Smithsonian until the end of September and will then begin touring the country. Hit up the link below for more information. The Art of Video Games Tour [via Neatorama] How To Properly Scan a Photograph (And Get An Even Better Image) The HTG Guide to Hiding Your Data in a TrueCrypt Hidden Volume Make Your Own Windows 8 Start Button with Zero Memory Usage

    Read the article

  • Improving first person camera and implementing third person camera

    - by brainydexter
    I want to improve upon my first person camera implementation and extend it to, so the user can toggle between third person/first person view. My current setup: draw():: glPushMatrix(); m_pCamera->ApplyCameraTransform(); // Render gameObjects glPopMatrix(); Camera is strongly coupled to the player, so much so, that it is a friend of player. This is what the Camera::ApplyCameraTransform looks like: glm::mat4 l_TransformationMatrix; m_pPlayer->m_pTransformation->GetTransformation(l_TransformationMatrix, false); l_TransformationMatrix = glm::core::function::matrix::inverse(l_TransformationMatrix); glMultMatrixf(glm::value_ptr(l_TransformationMatrix)); So, I take the player's transformation matrix and invert it to yield First person camera view. Since, Third person camera view is just a 'translated' first person view behind the player; what would be a good way to improve upon this (keeping in mind that I will be extending it to Third person camera as well. Thanks

    Read the article

  • Ten Benefits to Video Game Play [Video]

    - by Jason Fitzpatrick
    Want to justify spending the whole weekend playing video games? We’re here to help. Courtesy of AllTime10, this video rounds up ten benefits to playing video games ranging from improved dexterity to pain relief. Want to highlight a benefit not listed in the video? Sound off in the comments. [via Geeks Are Sexy] Why Does 64-Bit Windows Need a Separate “Program Files (x86)” Folder? Why Your Android Phone Isn’t Getting Operating System Updates and What You Can Do About It How To Delete, Move, or Rename Locked Files in Windows

    Read the article

  • Arcball 3D camera - how to convert from camera to object coordinates

    - by user38873
    I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up until now, like lookat etc. http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball So i can rotate with the click and drag of the mouse, but when i rotate 90º degrees around Y and then move the mouse upwards or donwwards, it rotates on the wrong axis, this problem is demonstrated on this part of the tutorial An extra trick is converting the rotation axis from camera coordinates to object coordinates. It's useful when the camera and object are placed differently. For instace, if you rotate the object by 90° on the Y axis ("turn its head" to the right), then perform a vertical move with your mouse, you make a rotation on the camera X axis, but it should become a rotation on the Z axis (plane barrel roll) for the object. By converting the axis in object coordinates, the rotation will respect that the user work in camera coordinates (WYSIWYG). To transform from camera to object coordinates, we take the inverse of the MV matrix (from the MVP matrix triplet). What i have to do acording to the tutorial is convert my axis_in_camera_coordinates to object coordinates, and the rotation is done well, but im confused on what matrix i use to do just that. The tutorial talks about converting the axis from camera to object coordinates by using the inverse of the MV. Then it shows these 3 lines of code witch i havent been able to understand. glm::mat3 camera2object = glm::inverse(glm::mat3(transforms[MODE_CAMERA]) * glm::mat3(mesh.object2world)); glm::vec3 axis_in_object_coord = camera2object * axis_in_camera_coord; So what do i aply to my calculated axis?, the inverse of what, i supose the inverse of the model view? So my question is how do you transform camera axis to object axis. Do i apply the inverse of the lookat matrix? My code: if (cur_mx != last_mx || cur_my != last_my) { va = get_arcball_vector(last_mx, last_my); vb = get_arcball_vector( cur_mx, cur_my); angle = acos(min(1.0f, dotProduct(va, vb)))*20; axis_in_camera_coord = crossProduct(va, vb); axis.x = axis_in_camera_coord[0]; axis.y = axis_in_camera_coord[1]; axis.z = axis_in_camera_coord[2]; axis.w = 1.0f; last_mx = cur_mx; last_my = cur_my; } Quaternion q = qFromAngleAxis(angle, axis); Matrix m; qGLMatrix(q,m); vi = mMultiply(m, vi); up = mMultiply(m, up); ViewMatrix = ogLookAt(vi.x, vi.y, vi.z,0,0,0,up.x,up.y,up.z);

    Read the article

  • A Brief History of Video Games [Video]

    - by Asian Angel
    Are you ready to take a trip down nostalgia lane? This compilation of video game footage provides a brief but interesting look at some of our favorite games over the years and how much the look and feel of them has changed. A Brief History of Video Games [via Neatorama] HTG Explains: What Is RSS and How Can I Benefit From Using It? HTG Explains: Why You Only Have to Wipe a Disk Once to Erase It HTG Explains: Learn How Websites Are Tracking You Online

    Read the article

  • Moving camera, or camera with discrete "screens"?

    - by Jacob Millward
    I'm making a game with a friend, but having trouble deciding on a camera style. The basic idea for the game, is having a randomly generated 2-dimensional world, with settlements in it. These settlements would have access to different resources, and it would be the job of the player to create bridges and ladders and links between these villages so they can trade. The player would advance personally by getting better gear, fighting monsters and looking for materials in the world, in order to craft and trade them at the settlements. My friend wants to use an old-style camera, where the world is split into a discrete number of screens that the player moves between. Similar to early Zelda dungeons, or Knytt Stories. This is opposite to me, as I want a standard camera that follows the player around as I feel the split-screen style camera limits the game. Can anyone argue the case either way? We've hit a massive roadblock here and can't seem to get past it.

    Read the article

  • How to create 1280x720 music video with static pic

    - by monov
    I wanna upload a song to youtube, and put a static 1280x720 pic as the video. I'd like the format to be one of the recommended ones. I tried Windows Movie Maker 2.6 but it only generated a 640x480 video. I also tried Windows Live Movie Maker but it put a big black margin around my pic (and unexplicably, produced a video with a slightly lower volume). Do you know any way to do what I need?

    Read the article

  • The Citroen GT – An Awesome Video Game Car Brought to Life [Video]

    - by Asian Angel
    If you are familiar with the Gran Turismo 5 video game releases, then you will definitely recognize the Citroen GT. French automaker Citroen and Japanese racing simulation developer Polyphony Digital decided to take things one step further and collaborated to bring this awesome car to life. Then they turned it loose on the streets of London! Citroen GT on the Streets of London (HD) [via BoingBoing] You can learn more about the Citroen GT, car show appearances, and more at Wikipedia: GT by Citroen Latest Features How-To Geek ETC How to Enable User-Specific Wireless Networks in Windows 7 How to Use Google Chrome as Your Default PDF Reader (the Easy Way) How To Remove People and Objects From Photographs In Photoshop Ask How-To Geek: How Can I Monitor My Bandwidth Usage? Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware The Citroen GT – An Awesome Video Game Car Brought to Life [Video] Final Man vs. Machine Round of Jeopardy Unfolds; Watson Dominates Give Chromium-Based Browser Desktop Notifications a Native System Look in Ubuntu Chrome Time Track Is a Simple Task Time Tracker Google Sky Map Turns Your Android Phone into a Digital Telescope Walking Through a Seaside Village Wallpaper

    Read the article

  • First Person Camera strafing at angle

    - by Linkandzelda
    I have a simple camera class working in directx 11 allowing moving forward and rotating left and right. I'm trying to implement strafing into it but having some problems. The strafing works when there's no camera rotation, so when the camera starts at 0, 0, 0. But after rotating the camera in either direction it seems to strafe at an angle or inverted or just some odd stuff. Here is a video uploaded to Dropbox showing this behavior. https://dl.dropboxusercontent.com/u/2873587/IncorrectStrafing.mp4 And here is my camera class. I have a hunch that it's related to the calculation for camera position. I tried various different calculations in strafe and they all seem to follow the same pattern and same behavior. Also the m_camera_rotation represents the Y rotation, as pitching isn't implemented yet. #include "camera.h" camera::camera(float x, float y, float z, float initial_rotation) { m_x = x; m_y = y; m_z = z; m_camera_rotation = initial_rotation; updateDXZ(); } camera::~camera(void) { } void camera::updateDXZ() { m_dx = sin(m_camera_rotation * (XM_PI/180.0)); m_dz = cos(m_camera_rotation * (XM_PI/180.0)); } void camera::Rotate(float amount) { m_camera_rotation += amount; updateDXZ(); } void camera::Forward(float step) { m_x += step * m_dx; m_z += step * m_dz; } void camera::strafe(float amount) { float yaw = (XM_PI/180.0) * m_camera_rotation; m_x += cosf( yaw ) * amount; m_z += sinf( yaw ) * amount; } XMMATRIX camera::getViewMatrix() { updatePosition(); return XMMatrixLookAtLH(m_position, m_lookat, m_up); } void camera::updatePosition() { m_position = XMVectorSet(m_x, m_y, m_z, 0.0); m_lookat = XMVectorSet(m_x + m_dx, m_y, m_z + m_dz, 0.0); m_up = XMVectorSet(0.0, 1.0, 0.0, 0.0); }

    Read the article

  • When Your Favorite Video Game Characters go Trick-or-Treating [Video]

    - by Asian Angel
    Halloween has arrived and all of your favorite video game characters are out and about collecting lots of candy goodness. The question is whether or not all will be successful in collecting treats or if the tricks will be on them! Note: Video contains some language that may be considered inappropriate. Videogame Trick-or-Treating [Dorkly] 6 Start Menu Replacements for Windows 8 What Is the Purpose of the “Do Not Cover This Hole” Hole on Hard Drives? How To Log Into The Desktop, Add a Start Menu, and Disable Hot Corners in Windows 8

    Read the article

  • Properties!Details (run-time length)

    - by user33666
    When you take clips and turn them into computer playable files, whether .TS or .MOV or .MPG, .MP4, .VOB, etc., do you as the producer actually manually write into some field in a "Details" section of your video editor what the video length is, so that it can be read by the eventual user's video player? Or is this activity performed automatically by the video editor? I'm asking because: when a mouse is passed over a file line item in Windows 7 Shell (Windows Explorer) a little box is displayed where the mouse meets the file line item and provides simple name and size properties, one of which (if it's a media file) is run length. How does that figure get there into the file (later to be read be Windows or OS X)? Thanks for any info.

    Read the article

  • Automating video generation by adding an intro and a trailing video to the main video

    - by DevDewboy
    I have a video project I am trying to compile. Here is the overview: I have many videos which are 5 minute training sessions - Main video. The Intro Video will be a standard 5 second video that will have the Video title and Author. This will be concatenated to the main video. The Trailing Video will pretty much be a stock video that will be concatenated to the main video and have all the legaleze etc. The Intro Vid will smoothly fade into the main vid as well as when you get to end of the main video it will fade into the Trailing video nicely. The product is a new video with a Intro, Main & Trailer video all in one! The concept is really that simple. In fact I found an example of a person who has solved this and is doing exactly what I want. This solution is a Bash script that takes a config file that has the title, author, etc. and generates the Intro, the Ending and creates the resulting video with them concatenated. I am using Ubuntu 12.04 Server. I have been trying to take this as a sample and just running it with no luck because of incompatibility errors. I even attempted to convert it using .MP4 containers or .MKV. I am running into error after error or incompatibility issues. I went as far as changing out the ffmpeg binary using the 25 Oct 2013 version from http://ffmpeg.gusari.org/static/64bit/ which I like as I don't have to worry about rebuilding the binary. Almost successful but again I have some error which I cannot solve. I know part of the problem is the fact that video production, codecs, formats is a completely new field for me so I am attempting to work through this new territory. Perhaps an expert here has something similar that I can use as a guideline that uses MP4 or h.264 format. Or take the solution above from the URL and make it work with a more up-to-date version of ffmpeg. I will include the script and its parameter file and the output (abbreviated because of limitation) below. Basically as the script stands right now, when run I get the error [matroska,webm @ 0x27bbee0] Read error. This error is return from the 'reasembleVideo' routine from the first ffmpeg command. The following is the Parameter File: #!/bin/bash INPUTFILE="ssh_main.mp4" LOGO="logo.png" LOGOLENGTH="1" SPEAKER="Jason" TITLE="Basic SSH Video" DATE="October 28, 2013" SCENESTART="00:00:01" SCENEDURATION="00:00:09" OUTPUTFILE="ssh_basic_1" } The following is the script I am running. The ${OUTPUTFILE} being used is a small 2 minute video I create in screen-o-matic in MP4 format. Script on PasteBin (too long for Super User post)

    Read the article

  • Camera lookAt target changes when rotating parent node

    - by Michael IV
    have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , the camera lookAt changes too.That is nor what I want to achieve.I need it to work like in Adobe AE when you parent camera to a null object:when null object is rotated the camera starts orbiting around the target while still looking at the target.What I do currently is multiplying parent's model matrix with camera model matrix which is calculated from lookAt() method.I am sure I need to decompose (or recompose ) one of the matrices before multiplying them .Parent model or camera model ? Anyone here can show the right way doing it ? UPDATE: The parent is just a node .The child is the camera.The parented camera in AfterEffects works like this: If you rotate the parent node while camera looks at the target , the camera actually starts orbiting around the target based on the parent rotation.In my case the parent rotation changes also Camera's lookAt direction which IS NOT what I want.Hope now it is clear .

    Read the article

  • Beginner video capture and processing/Camera selection

    - by mattbauch
    I'll soon be undertaking a research project in real-time event recognition but have no experience with the programming aspect of video capture (I'm an upperclassman undergraduate in computer engineering). I want to start off on the right foot so advice from anyone with experience would be great. The ultimate goal is to track events such as a person standing up/sitting down, entering/leaving a room, possibly even shrugging/slumping in posture, etc. from a security camera-like vantage point. First of all, which cameras/companies would you recommend? I'm looking to spend ~$100, more if necessary but not much. Great resolution isn't a must, but is desirable if affordable. What about IP network cameras vs. a USB type webcam? Webcams are less expensive, but IP cameras seem like they'd be much less work to deal with in software. What features should I look for in the camera? Once I've selected a camera, what does converting its output to a series of RGB bitmaps entail? I've never dealt with video encoding/decoding so a starting point or a tutorial that will guide me up to this point would be great if anyone has suggestions. Finally, what is the best (least complicated/most efficient) way to display video from the camera plus my own superimposed images (boxes around events in progress, for instance) in a GUI application? I can work on any operating system in any language. I have some experience with win32 GUIs and Java GUIs. The focus of the project is on the algorithm and so I'm trying to get the video capture/display portion of the app done cleanly and quickly. Thanks for any responses!!

    Read the article

  • Removing broken packages on distro update (13.04 to 13.10)

    - by user203974
    i'm kinda new to linux. last night i tried upgrading from 13.04 to 13.10 but i got the "could not calculate" error. i read this question and found this error in the main log: Dist-upgrade failed: 'E:Unable to correct problems, you have held broken packages.' and here's a list of my broken packages : Broken libwayland-client0:amd64 Conflicts on libwayland0 [ amd64 ] < 1.0.5-0ubuntu1 > ( libs ) (< 1.1.0) Broken libpam-systemd:amd64 Conflicts on libpam-xdg-support [ amd64 ] < 0.2-0ubuntu2 > ( admin ) Broken cups-filters:amd64 Conflicts on ghostscript-cups [ amd64 ] < 9.07~dfsg2-0ubuntu3.1 > ( text ) Broken libharfbuzz0a:amd64 Breaks on libharfbuzz0 [ amd64 ] < 0.9.13-1 > ( libs ) Broken libunity-scopes-json-def-desktop:amd64 Conflicts on libunity-common [ amd64 ] < 6.90.2daily13.04.05-0ubuntu1 > ( gnome ) (< 7.0.7) Broken libunity-scopes-json-def-desktop:amd64 Conflicts on libunity-common [ i386 ] < none > ( none ) (< 7.0.7) Broken libaccount-plugin-generic-oauth:amd64 Conflicts on account-plugin-generic-oauth [ amd64 ] < 0.10bzr13.03.26-0ubuntu1.1 > ( gnome ) (< 0.10bzr13.04.30) Broken libaccount-plugin-generic-oauth:amd64 Breaks on account-plugin-generic-oauth [ amd64 ] < 0.10bzr13.03.26-0ubuntu1.1 > ( gnome ) (< 0.10bzr13.04.30) Broken python3-aptdaemon.pkcompat:amd64 Breaks on libpackagekit-glib2-14 [ amd64 ] < 0.7.6-3ubuntu1 > ( libs ) (<= 0.7.6-4) Broken libsnmp-base:amd64 Breaks on libsnmp15 [ amd64 ] < 5.4.3~dfsg-2.7ubuntu1 > ( libs ) (< 5.7.2~dfsg-5) Broken libunity-core-6.0-8:amd64 Conflicts on unity-common [ amd64 ] < 7.0.0daily13.06.19~13.04-0ubuntu1 > ( gnome ) Broken python3-uno:amd64 Conflicts on python-uno [ amd64 ] < 1:4.0.4-0ubuntu1 > ( python ) Broken unity-scope-home:amd64 Conflicts on unity-lens-shopping [ amd64 ] < 6.8.0daily13.03.04-0ubuntu1 > ( gnome ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken usb-modeswitch-data:amd64 Breaks on usb-modeswitch [ amd64 ] < 1.2.3+repack0-1ubuntu3 > ( comm ) (< 1.2.6) Broken unity-gtk2-module:amd64 Conflicts on appmenu-gtk [ amd64 ] < 12.10.3daily13.04.03-0ubuntu1 > ( libs ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken unity-gtk3-module:amd64 Conflicts on appmenu-gtk3 [ amd64 ] < 12.10.3daily13.04.03-0ubuntu1 > ( libs ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken libbamf3-1:amd64 Depends on bamfdaemon [ amd64 ] < 0.4.0daily13.06.19~13.04-0ubuntu1 -> 0.5.1+13.10.20131011-0ubuntu1 > ( libs ) (= 0.4.0daily13.06.19~13.04-0ubuntu1) Broken bzr-gtk:amd64 Depends on bzr [ amd64 ] < 2.6.0~bzr6571-4ubuntu2 -> 2.6.0-3ubuntu1 > ( devel ) (< 2.6.0) Broken libgphoto2-6-dev:amd64 Conflicts on libgphoto2-2-dev [ amd64 ] < 2.4.14-2 > ( libdevel ) Broken activity-log-manager:amd64 Conflicts on activity-log-manager-common [ amd64 ] < 0.9.4-0ubuntu6.2 > ( utils ) Broken libgjs0d:amd64 Conflicts on libgjs0c [ amd64 ] < 1.34.0-0ubuntu1 > ( libs ) Broken libgtksourceview-3.0-0:amd64 Depends on libgtksourceview-3.0-common [ amd64 ] < 3.6.3-0ubuntu1 -> 3.8.2-0ubuntu1 > ( libs ) (< 3.7) Broken gnome-pie:amd64 Depends on libbamf3-1 [ amd64 ] < 0.4.0daily13.06.19~13.04-0ubuntu1 > ( libs ) Broken libunity-core-6.0-5:amd64 Depends on unity-services [ amd64 ] < 7.0.0daily13.06.19~13.04-0ubuntu1 -> 7.1.2+13.10.20131014.1-0ubuntu1 > ( gnome ) (= 7.0.0daily13.06.19~13.04-0ubuntu1) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-r128 [ amd64 ] < 6.9.1+git20130104.24f28a78-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-mach64 [ amd64 ] < 6.9.4+git20130104.80e62cc1-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-r128 [ amd64 ] < 6.9.1+git20130104.24f28a78-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-mach64 [ amd64 ] < 6.9.4+git20130104.80e62cc1-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-r128 [ amd64 ] < 6.9.1+git20130104.24f28a78-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-r128 [ amd64 ] < 6.9.1+git20130104.24f28a78-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-mach64 [ amd64 ] < 6.9.4+git20130104.80e62cc1-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-r128 [ amd64 ] < 6.9.1+git20130104.24f28a78-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-mach64 [ amd64 ] < 6.9.4+git20130104.80e62cc1-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-mach64:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken libxi6:amd64 Breaks on xserver-xorg-core [ amd64 ] < 2:1.13.4~git20130508+server-1.13-branch.10c42f57-0ubuntu0ricotz~raring -> 2:1.14.3-3ubuntu2 > ( x11 ) (< 2:1.14) Broken xserver-xorg-video-ati:amd64 Depends on xserver-xorg-video-mach64 [ amd64 ] < 6.9.4+git20130104.80e62cc1-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-intel:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-r128:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-nouveau:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-cirrus:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-ati [ amd64 ] < 1:7.1.99+git20130730.6a278369-0ubuntu0sarvatt~raring -> 1:7.2.0-0ubuntu10 > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-ati:amd64 Depends on xorg-video-abi-13 [ amd64 ] < none > ( none ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-ati [ amd64 ] < 1:7.1.99+git20130730.6a278369-0ubuntu0sarvatt~raring -> 1:7.2.0-0ubuntu10 > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-cirrus [ amd64 ] < 1:1.5.2+git20130108.e2bf5b25-0ubuntu0sarvatt > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-intel [ amd64 ] < 2:2.99.904+git20131009.b9ad5b62-0ubuntu0sarvatt~raring > ( x11 ) Broken xserver-xorg-video-all:amd64 Depends on xserver-xorg-video-nouveau [ amd64 ] < 1:1.0.9+git20130730.300c5a32-0ubuntu0sarvatt~raring > ( x11 ) thats a lot of stuff ... do i have to remove them one by one ? will removing them caues any issue ? do i have to install them one by one again after the upgrade ?

    Read the article

  • xna orbit camera troubles

    - by user17753
    I have a Model named cube to which I load in LoadContent(): cube = Content.Load<Model>("untitled");. In the Draw Method I call DrawModel: private void DrawModel(Model m, Matrix world) { foreach (ModelMesh mesh in m.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.View = camera.View; effect.Projection = camera.Projection; effect.World = world; } mesh.Draw(); } } camera is of the Camera type, a class I've setup. Right now it is instantiated in the initialization section with the graphics aspect ratio and the translation (world) vector of the model, and the Draw loop calls the camera.UpdateCamera(); before drawing the models. class Camera { #region Fields private Matrix view; // View Matrix for Camera private Matrix projection; // Projection Matrix for Camera private Vector3 position; // Position of Camera private Vector3 target; // Point camera is "aimed" at private float aspectRatio; //Aspect Ratio for projection private float speed; //Speed of camera private Vector3 camup = Vector3.Up; #endregion #region Accessors /// <summary> /// View Matrix of the Camera -- Read Only /// </summary> public Matrix View { get { return view; } } /// <summary> /// Projection Matrix of the Camera -- Read Only /// </summary> public Matrix Projection { get { return projection; } } #endregion /// <summary> /// Creates a new Camera. /// </summary> /// <param name="AspectRatio">Aspect Ratio to use for the projection.</param> /// <param name="Position">Target coord to aim camera at.</param> public Camera(float AspectRatio, Vector3 Target) { target = Target; aspectRatio = AspectRatio; ResetCamera(); } private void Rotate(Vector3 Axis, float Amount) { position = Vector3.Transform(position - target, Matrix.CreateFromAxisAngle(Axis, Amount)) + target; } /// <summary> /// Resets Default Values of the Camera /// </summary> private void ResetCamera() { speed = 0.05f; position = target + new Vector3(0f, 20f, 20f); projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspectRatio, 0.5f, 100f); CalculateViewMatrix(); } /// <summary> /// Updates the Camera. Should be first thing done in Draw loop /// </summary> public void UpdateCamera() { Rotate(Vector3.Right, speed); CalculateViewMatrix(); } /// <summary> /// Calculates the View Matrix for the camera /// </summary> private void CalculateViewMatrix() { view = Matrix.CreateLookAt(position,target, camup); } I'm trying to create the camera so that it can orbit the center of the model. For a test I am calling Rotate(Vector3.Right, speed); but it rotates almost right but gets to a point where it "flips." If I rotate along a different axis Rotate(Vector3.Up, speed); everything seems OK in that direction. So I guess, can someone tell me what I'm not accounting for in the above code I wrote? Or point me to an example of an orbiting camera that can be fixed on an arbitrary point?

    Read the article

  • Cisco PrecisionHD USB Camera (Detected but no video)

    - by Marcel Bissonnette
    I'm having an issue with my Cisco PrecisionHD USB Camera. It is detected but does not show video (using "Cheese Webcam Booth"). Any ideas? (I'm a newbie with ubuntu) Specs: Ubuntu 12.10 32bit Dell Latitude E6400 Cisco PrecisionHD USB Camera (USB 2.0) connected directly into laptop (no docking station) Troubleshooting: Using the command lsusb, I find the following device: Bus 002 Device 003: ID 1f82:0001 TANDBERG PrecisionHD Camera '+ more devices like audio, finger swipe, Linux foundation 2.0, 1.1 So what now? Thanks. MB

    Read the article

  • Camera Preview App in Android throwing many errors (Nexus 4)

    - by Jagatheesan Jack
    I am trying to develop a camera app that takes a picture and saves it in a SQLite database. I get a lot of errors when executing the application. My code is as below. Any idea? CameraActivity.java private Camera mCamera; private CameraPreview mPreview; private int CAMERA_RETURN_CODE=100; private static final String TAG = "Take_Picture"; public static final int MEDIA_TYPE_IMAGE = 1; public static final int MEDIA_TYPE_VIDEO = 2; private Bitmap cameraBmp; private int MAX_FACES = 1; private Face[] faceList; public RectF[] rects; private Canvas canvas; private Drawable pictureDataDrawable; private MySQLiteHelper database; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera_activity); //this.requestWindowFeature(Window.FEATURE_NO_TITLE); //Create an instance of Camera mCamera = getCameraInstance(); setCameraDisplayOrientation(this, 0, mCamera); // Create our Preview view and set it as the content of our activity. mPreview = new CameraPreview(this, mCamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview); preview.addView(mPreview); database = new MySQLiteHelper(getApplicationContext()); Button captureButton = (Button) findViewById(R.id.button_capture); captureButton.setOnClickListener( new View.OnClickListener() { private PictureCallback mPicture; @Override public void onClick(View v) { //mCamera.startPreview(); // get an image from the camera mCamera.takePicture(null, null, mPicture); PictureCallback mPicture = new PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { try{ if (data != null) database.addEntry(data); //mCamera.startPreview(); } catch(Exception e){ Log.d(TAG, e.getMessage()); } } } ); } /** A safe way to get an instance of the Camera object. */ public static Camera getCameraInstance(){ Camera c = null; try { c = Camera.open(c.getNumberOfCameras()-1); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable } public static void setCameraDisplayOrientation(Activity activity, int cameraId, android.hardware.Camera camera) { android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo(); android.hardware.Camera.getCameraInfo(cameraId, info); int rotation = activity.getWindowManager().getDefaultDisplay() .getRotation(); int degrees = 360; /*switch (rotation) { case Surface.ROTATION_0: degrees = 0; break; case Surface.ROTATION_90: degrees = 90; break; case Surface.ROTATION_180: degrees = 180; break; case Surface.ROTATION_270: degrees = 270; break; }*/ int result; if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { result = (info.orientation + degrees) % 360; result = (360 - result) % 360; // compensate the mirror } else { // back-facing result = (info.orientation - degrees + 360) % 360; } camera.setDisplayOrientation(result); } @Override protected void onPause() { super.onPause(); //releaseMediaRecorder(); // if you are using MediaRecorder, release it first releaseCamera(); // release the camera immediately on pause event } private void releaseCamera(){ if (mCamera != null){ mCamera.release(); // release the camera for other applications mCamera = null; } } public void startFaceDetection(){ // Try starting Face Detection Camera.Parameters params = mCamera.getParameters(); // start face detection only *after* preview has started if (params.getMaxNumDetectedFaces() > 0){ // camera supports face detection, so can start it: mCamera.startFaceDetection(); } } CameraPreview.java public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; private String TAG; private List<Size> mSupportedPreviewSizes; public CameraPreview(Context context, Camera camera) { super(context); mCamera = camera; // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); // deprecated setting, but required on Android versions prior to 3.0 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // The Surface has been created, now tell the camera where to draw the preview. try { mCamera.setPreviewDisplay(holder); mCamera.setDisplayOrientation(90); mCamera.startPreview(); } catch (IOException e) { Log.d(TAG, "Error setting camera preview: " + e.getMessage()); } } public void surfaceDestroyed(SurfaceHolder holder) { // empty. Take care of releasing the Camera preview in your activity. } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // If your preview can change or rotate, take care of those events here. // Make sure to stop the preview before resizing or reformatting it. if (mHolder.getSurface() == null){ // preview surface does not exist return; } // stop preview before making changes try { mCamera.stopPreview(); } catch (Exception e){ // ignore: tried to stop a non-existent preview } try { mCamera.setPreviewDisplay(mHolder); mCamera.startPreview(); } catch (Exception e){ Log.d(TAG, "Error starting camera preview: " + e.getMessage()); } } public void setCamera(Camera camera) { if (mCamera == camera) { return; } mCamera = camera; if (mCamera != null) { List<Size> localSizes = mCamera.getParameters().getSupportedPreviewSizes(); mSupportedPreviewSizes = localSizes; requestLayout(); try { mCamera.setPreviewDisplay(mHolder); } catch (IOException e) { e.printStackTrace(); } /* Important: Call startPreview() to start updating the preview surface. Preview must be started before you can take a picture. */ mCamera.startPreview(); } } MySQLiteHelper.java private static final int count = 0; public static final String TABLE_IMAGE = "images"; public static final String COLUMN_ID = "_id"; public static final String PICTURE_DATA = "picture"; public static final String DATABASE_NAME = "images.db"; public static final int DATABASE_VERSION = 1; public static final String DATABASE_CREATE = "create table " + TABLE_IMAGE + "(" + COLUMN_ID + " integer primary key autoincrement, " + PICTURE_DATA + " blob not null);"; public static SQLiteDatabase database; private static String TAG = "test"; public MySQLiteHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); // TODO Auto-generated constructor stub } public MySQLiteHelper(Context context, String name, CursorFactory factory, int version, DatabaseErrorHandler errorHandler) { super(context, name, factory, version, errorHandler); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase database) { database.execSQL(DATABASE_CREATE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(MySQLiteHelper.class.getName(), "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS " + TABLE_IMAGE); onCreate(db); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub } public void addEntry(byte [] array) throws SQLiteException{ ContentValues cv = new ContentValues(); //cv.put(KEY_NAME, name); cv.put(PICTURE_DATA, array); database.insert( TABLE_IMAGE, null, cv ); Log.w(TAG , "added " +count+ "images"); database.close(); } Errors 11-07 23:28:39.050: E/mm-libcamera2(176): PROFILE HAL: stopPreview(): E: 1383838119.067589459 11-07 23:28:39.050: E/mm-camera(201): config_MSG_ID_STOP_ACK: streamon_mask is not clear. Should not call PP_Release_HW 11-07 23:28:39.090: E/QCameraHWI(176): android::status_t android::QCameraHardwareInterface::setPreviewWindow(preview_stream_ops_t*):Received Setting NULL preview window 11-07 23:28:39.090: E/QCameraHWI(176): android::status_t android::QCameraHardwareInterface::setPreviewWindow(preview_stream_ops_t*): mPreviewWindow = 0x0x0, mStreamDisplay = 0x0xb8a9df90 11-07 23:28:39.090: E/mm-camera(201): config_shutdown_pp Camera not in streaming mode. Returning. 11-07 23:28:39.090: E/mm-camera(201): vfe_ops_deinit: E 11-07 23:28:39.120: E/qcom_sensors_hal(533): hal_process_report_ind: Bad item quality: 11 11-07 23:28:39.310: E/qcom_sensors_hal(533): hal_process_report_ind: Bad item quality: 11 11-07 23:28:39.330: E/mm-camera(201): sensor_load_chromatix: libchromatix_imx119_preview.so: 30 11-07 23:28:39.340: E/mm-camera(201): vfe_ops_init: E 11-07 23:28:39.360: E/mm-camera(201): vfe_legacy_stats_buffer_init: AEC_STATS_BUFNUM 11-07 23:28:39.360: E/mm-camera(201): vfe_legacy_stats_buffer_init: AEC_STATS_BUFNUM 11-07 23:28:39.360: E/mm-camera(201): mctl_init_stats_proc_info: snap_max_line_cnt =25776 11-07 23:28:39.440: E/QCameraHWI(176): android::status_t android::QCameraHardwareInterface::setPreviewWindow(preview_stream_ops_t*): mPreviewWindow = 0x0xb8aa1780, mStreamDisplay = 0x0xb8a9df90 11-07 23:28:39.440: E/mm-camera(201): config_proc_CAMERA_SET_INFORM_STARTPREVIEW 11-07 23:28:39.450: E/mm-camera(201): config_update_stream_info Storing stream parameters for video inst 1 as : width = 640, height 480, format = 1 inst_handle = 810081 cid = 0 11-07 23:28:39.490: E/mm-camera(201): config_update_stream_info Storing stream parameters for video inst 3 as : width = 640, height 480, format = 1 inst_handle = 830083 cid = 0 11-07 23:28:39.490: E/mm-camera(201): config_update_stream_info Storing stream parameters for video inst 4 as : width = 512, height 384, format = 1 inst_handle = 840084 cid = 0 11-07 23:28:39.500: E/mm-camera(201): config_decide_vfe_outputs: Ports Used 3, Op mode 1 11-07 23:28:39.500: E/mm-camera(201): config_decide_vfe_outputs Current mode 0 Full size streaming : Disabled 11-07 23:28:39.500: E/mm-camera(201): config_decide_vfe_outputs: Primary: 640x480, extra_pad: 0x0, Fmt: 1, Type: 1, Path: 1 11-07 23:28:39.500: E/mm-camera(201): config_decide_vfe_outputs: Secondary: 640x480, extra_pad: 0x0, Fmt: 1, Type: 3, Path: 4 11-07 23:28:39.510: E/mm-camera(201): config_update_inst_handles Updated the inst handles as 810081, 830083, 0, 0 11-07 23:28:39.631: E/mm-camera(201): sensor_load_chromatix: libchromatix_imx119_preview.so: 30 11-07 23:28:39.631: E/mm-camera(201): camif_client_set_params: camif has associated with obj mask 0x1 11-07 23:28:39.631: E/mm-camera(201): config_v2_CAMERA_START_common CAMIF_PARAMS_ADD_OBJ_ID failed -1 11-07 23:28:39.641: E/mm-camera(201): vfe_operation_config: format 3 11-07 23:28:39.641: E/mm-camera(201): vfe_operation_config:vfe_op_mode=5 11-07 23:28:39.641: E/mm-camera(201): Invalid ASD Set Params Type 11-07 23:28:39.641: E/mm-camera(201): vfe_set_bestshot: Bestshot mode not changed

    Read the article

  • How to prevent 2D camera rotation if it would violate the bounds of the camera?

    - by Andrew Price
    I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its bounds. However, I'm a bit confused on how to do the same for rotation. Currently I allow rotating of the camera's Z-axis. However, if sufficiently zoomed out, upon rotating the camera, areas of the screen outside the camera's bounds can be shown. I'd like to deny the rotation assuming it meant that the newly rotated camera would expose areas outside the camera's bounds, but I'm not quite sure how. I'm still new to Matrix and Vector math and I'm not quite sure how to model if the newly rotated camera sees outside of its bounds, undo the rotation. Here's an image showing the problem: http://i.stack.imgur.com/NqprC.png The red is out of bounds and as a result, the camera should never be allowed to rotate itself like this. This seems like it would be a problem with all rotated values, but this is not the case when the camera is zoomed in enough. Here are the current member variables for the Camera class: private Vector2 _position = Vector2.Zero; private Vector2 _origin = Vector2.Zero; private Rectangle? _bounds = Rectangle.Empty; private float _rotation = 0.0f; private float _zoom = 1.0f; Is this possible to do? If so, could someone give me some guidance on how to accomplish this? Thanks. EDIT: I forgot to mention I am using a transformation matrix style camera that I input in to SpriteBatch.Begin. I am using the same transformation matrix from this tutorial.

    Read the article

  • How to fix issue with my 3D first person camera?

    - by dxCUDA
    My camera moves and rotates, but relative to the worlds origin, instead of the players. I am having difficulty rotating the camera and then translating the camera in the direction relative to the camera facing angle. I have been able to translate the camera and rotate relative to the players origin, but not then rotate and translate in the direction relative to the cameras facing direction. My goal is to have a standard FPS-style camera. float yaw, pitch, roll; D3DXMATRIX rotationMatrix; D3DXVECTOR3 Direction; D3DXMATRIX matRotAxis,matRotZ; D3DXVECTOR3 RotAxis; // Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians. pitch = m_rotationX * 0.0174532925f; yaw = m_rotationY * 0.0174532925f; roll = m_rotationZ * 0.0174532925f; up = D3DXVECTOR3(0.0f, 1.0f, 0.0f);//Create the up vector //Build eye ,lookat and rotation vectors from player input data eye = D3DXVECTOR3(m_fCameraX, m_fCameraY, m_fCameraZ); lookat = D3DXVECTOR3(m_fLookatX, m_fLookatY, m_fLookatZ); rotation = D3DXVECTOR3(m_rotationX, m_rotationY, m_rotationZ); D3DXVECTOR3 camera[3] = {eye,//Eye lookat,//LookAt up };//Up RotAxis.x = pitch; RotAxis.y = yaw; RotAxis.z = roll; D3DXVec3Normalize(&Direction, &(camera[1] - camera[0]));//Direction vector D3DXVec3Cross(&RotAxis, &Direction, &camera[2]);//Strafe vector D3DXVec3Normalize(&RotAxis, &RotAxis); // Create the rotation matrix from the yaw, pitch, and roll values. D3DXMatrixRotationYawPitchRoll(&matRotAxis, pitch,yaw, roll); //rotate direction D3DXVec3TransformCoord(&Direction,&Direction,&matRotAxis); //Translate up vector D3DXVec3TransformCoord(&camera[2], &camera[2], &matRotAxis); //Translate in the direction of player rotation D3DXVec3TransformCoord(&camera[0], &camera[0], &matRotAxis); camera[1] = Direction + camera[0];//Avoid gimble locking D3DXMatrixLookAtLH(&in_viewMatrix, &camera[0], &camera[1], &camera[2]);

    Read the article

  • Android camera AVD error 100

    - by Cristian Voina
    I am trying to learn how to make a simple app in android. As background information I have only programmed in C language, no OOP. Currently I am trying turn on the camera using the indications from Android Developer site but some minor changes: - no button for capturing image. - no new activity. What I am trying to do is jut preview the camera. I will post the Code that I am using, the manifest and the LogCat. Main Activity: package com.example.camera_display; import android.app.Activity; import android.hardware.Camera; import android.os.Bundle; import android.view.Menu; import android.widget.FrameLayout; import android.widget.TextView; public class MainActivity extends Activity { private Camera mcamera; private CameraPreview mCameraPreview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mcamera = getCameraInstance(); mCameraPreview = new CameraPreview(this, mcamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview); preview.addView(mCameraPreview); } public static Camera getCameraInstance(){ Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } CameraPreview Class: package com.example.camera_display; import java.io.IOException; import android.content.Context; import android.hardware.Camera; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; /** A basic Camera preview class */ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private static final String TAG = "MyActivity"; private SurfaceHolder mHolder; private Camera mCamera; public CameraPreview(Context context, Camera camera) { super(context); mCamera = camera; // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); // deprecated setting, but required on Android versions prior to 3.0 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // The Surface has been created, now tell the camera where to draw the preview. try { mCamera.setPreviewDisplay(holder); mCamera.startPreview(); } catch (IOException e) { Log.d(TAG, "Error setting camera preview: " + e.getMessage()); } } public void surfaceDestroyed(SurfaceHolder holder) { // empty. Take care of releasing the Camera preview in your activity. } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // If your preview can change or rotate, take care of those events here. // Make sure to stop the preview before resizing or reformatting it. if (mHolder.getSurface() == null){ // preview surface does not exist return; } // stop preview before making changes try { mCamera.stopPreview(); } catch (Exception e){ // ignore: tried to stop a non-existent preview } // set preview size and make any resize, rotate or // reformatting changes here // start preview with new settings try { mCamera.setPreviewDisplay(mHolder); mCamera.startPreview(); } catch (Exception e){ Log.d(TAG, "Error starting camera preview: " + e.getMessage()); } } } Manifest: <uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera"/> LOG CAT: 06-30 15:58:35.075: D/libEGL(1153): loaded /system/lib/egl/libEGL_emulation.so 06-30 15:58:35.147: D/(1153): HostConnection::get() New Host Connection established 0x2a156060, tid 1153 06-30 15:58:35.478: D/libEGL(1153): loaded /system/lib/egl/libGLESv1_CM_emulation.so 06-30 15:58:35.515: D/libEGL(1153): loaded /system/lib/egl/libGLESv2_emulation.so 06-30 15:58:36.334: W/EGL_emulation(1153): eglSurfaceAttrib not implemented 06-30 15:58:36.685: D/OpenGLRenderer(1153): Enabling debug mode 0 06-30 15:58:36.935: D/MyActivity(1153): Error starting camera preview: startPreview failed 06-30 15:58:36.965: I/Choreographer(1153): Skipped 125 frames! The application may be doing too much work on its main thread. 06-30 15:58:38.455: W/Camera(1153): Camera server died! 06-30 15:58:38.455: W/Camera(1153): ICamera died 06-30 15:58:38.476: E/Camera(1153): Error 100 So If anyone could tell me what I am doing wrong (and explain why it should be done different) that would be great :) Thanks!

    Read the article

  • Camera wont stay behind model after pitch, then rotation

    - by ChocoMan
    I have a camera position behind a model. Currently, if I push the left thumbstick making my model move forward, backward, or strafe, the camera stays with the model. If I push the right thumbstick left or right, the model rotates in those directions fine along with the camera rotating while maintaining its position relatively behind the model. But when I pitch the model up or down, then rotate the model afterwards, the camera moves slightly rotates in a clock-like fashion behind the model. If I do a few rotations of the model and try to pitch the camera, the camera will eventually be looking at the side, then eventually the front of the model while also rotating in a clock-like fashion. My question is, how do I keep the camera to pitch up and down behind the model no matter how much the model has rotated? Here is what I got: // Rotates model and pitches camera on its own axis public void modelRotMovement(GamePadState pController) { // Rotates Camera with model Yaw = pController.ThumbSticks.Right.X * MathHelper.ToRadians(angularSpeed); // Pitches Camera around model Pitch = pController.ThumbSticks.Right.Y * MathHelper.ToRadians(angularSpeed); AddRotation = Quaternion.CreateFromYawPitchRoll(Yaw, 0, 0); ModelLoad.MRotation *= AddRotation; MOrientation = Matrix.CreateFromQuaternion(ModelLoad.MRotation); } // Orbit (yaw) Camera around with model (only seeing back of model) public void cameraYaw(Vector3 axisYaw, float yaw) { ModelLoad.CameraPos = Vector3.Transform(ModelLoad.CameraPos - ModelLoad.camTarget, Matrix.CreateFromAxisAngle(axisYaw, yaw)) + ModelLoad.camTarget; } // Raise camera above or below model's shoulders public void cameraPitch(Vector3 axisPitch, float pitch) { ModelLoad.CameraPos = Vector3.Transform(ModelLoad.CameraPos - ModelLoad.camTarget, Matrix.CreateFromAxisAngle(axisPitch, pitch)) + ModelLoad.camTarget; } // Call in update method public void updateCamera() { cameraYaw(Vector3.Up, Yaw); cameraPitch(Vector3.Right, Pitch); } NOTE: I tried to use addPitch just like addRotation but it didn't work...

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >