Visual C++ :: Placing Image In Kinect Color Frame?

Dec 10, 2012

I m trying to place an image on the colour frame of the Kinect live video. I m able to overlay the image using alpha blending mechanism.

The image used is a bitmap image of dimension 128*128.

The Kinect has a resolution of 640*480.

IDE used is Visual studio 2010 and I m developing using c++.

The Kinect has a render target whose size is taken as 640*480 so that it stretches for the complete window. So when I try to overlay the image it appears 5 times because of this stretching.
If I increase the image size to 640*128 i get a single image that is stretched horizontally across the window with dimension 640*480.

I have created a function that will create a render target with bitmap properties and size equal to 640*480. This is used to store the data from the Kinect, frame by frame, and draw it on to the screen

So I think when I overlay the image, it gets replicated 5 times to meet the render target size.By default the image is placed at the left top position.

My doubts are

- How can I use different functions to specify the size of render target for Kinect as 640*480 and the size of render target for bitmap image as 128*128.

- How to I give overlay or place the image on the live video at a specific location.

View 2 Replies


ADVERTISEMENT

C++ :: Output String Depending On Color Detected In A Frame Video Feed

Jul 18, 2014

what I'm trying to do is output a certain string depending on the color I see in the video feed. For right now, what I've done is threshold the feed so that everything above a certain brightness shows up as Red. Now I want to have something that says if there's any red in the feed, then I output a "1" to a text box on my user interface that's showing the feed. If there is no red, then I output a "0" to the text box.

I'm using Emgu CV C ++ with VS2010.

This is the code I have so far that isn't working correctly, it's giving me a compiler error.

cvConvertScaleAbs(frameFromCamera->Ptr.ToPointer(),frameDisplay->Ptr.ToPointer(),double(1)/16,0);
cvCvtColor(frameDisplay->Ptr.ToPointer(),frameColorDisplay->Ptr.ToPointer(),CV_GRAY2BGR);
cvThreshold(frameDisplay->Ptr.ToPointer(),maskSaturated->Ptr.ToPointer(),200,255,CV_THRESH_BINARY);

[Code] .....

and the error it's giving me

BAOTFISInterface.cpp(1010): error C2664: 'Emgu::CV::Image<TColor,TDepth> ^Emgu::CV::Image<TColor,TDepth>::InRange(Emgu::CV::Image<TColor,TDepth>
^,Emgu::CV::Image<TColor,TDepth> ^)' : cannot convert parameter 1 from 'Emgu::CV::Structure::Bgr *' to 'Emgu::CV::Image<TColor,TDepth> ^'

[Code] .....

Build FAILED.

View 1 Replies View Related

C/C++ :: Read Video Frame By Frame Through Program

May 1, 2012

I m trying to read a video frame by frame through a c program for which i need to know the format of .wmv (native video file for windows) file,can i get it??

View 6 Replies View Related

Visual C++ :: How To Lock In A Single Skeleton In Microsoft Kinect SDK V 1.7

Mar 25, 2013

I m trying to lock a single skeleton using Microsoft Kinect SDK v 1.7 . My requirements are

•First lock a single skeleton.
•Check the tracking state of the of the locked skeleton.
•If the tracking state of the locked skeleton is NOT Tracked,then
• ----->check for the next closest skeleton
•----->lock this skeleton.

How do I do this using vc++2010. The code which i tried is given below.

Code:
TrackSingleSkeleton(NUI_SKELETON_FRAME* pSkeletonFrame) {
DWORD dwTrackingIDs[NUI_SKELETON_MAX_TRACKED_COUNT]={0, 0};
m_pNuiSensor->NuiSkeletonTrackingEnable(m_hNextSkeletonEvent,NUI_SKELETON_TRACKING_FLAG_TITLE_SETS_TRACKED_SKELETONS);

[Code]....

View 1 Replies View Related

Visual C++ :: Detect And Find Rotation Angle If Skeleton Tracked Turned 180 Degree To Kinect

Sep 25, 2013

I m developing an application using kinect.The IDE I use is Visual studio 2012 and kinect SDK 1.8.I m developing using vc++

I want to overlay an image on the person tracked when the person turns 180 degress to kinect. ie the person is not facing the kinect.

how do i track the rotation angle of the person as he/she turns away from kinect.

View 7 Replies View Related

C++ :: PPM Image File Magic Number And Max Color Value

Feb 28, 2015

When reading a PPM Image file, how would I find the magic number and the max color value?

int main() {
string imageFileName;
ifstream image;

imageFileName = "C:UsersDesktopdrink.ppm";
image.open(imageFileName.c_str(), ifstream::binary);

[Code] ....

The code gives me seemingly logical integer values for size, width and height. But how would I find the max color value and so called "magic number" for this PPM image file?

View 1 Replies View Related

C/C++ :: Convert 256 Color BMP Image To TXT File Of Array Of 0 - 255

Feb 5, 2015

I am working on a program which turns a 256 color bmp image to a txt file of a array of 0-255. I wrote this:

#include<iostream>
#include<fstream>
// if 1 , see bmp file header info
#if 1
#define SEE_INFO
#endif
using namespace std;

[Code] ....

Something weird happened. When I use it on simple.bmp (Attachment), it works fine. But when I use it on flower.bmp , it just give me zeros.

Attached File(s)

 simple.bmp (3.39K)
 simple.txt (8.47K)
 flower.bmp (76.05K)
 flower.txt (150.49K)

View 3 Replies View Related

C :: Blurring PPM Image By Averaging Components Of Color Within Certain Reach Of Specific Pixel

Mar 13, 2014

I'm trying to blur a ppm image by averaging the components of the color(r, g, b) within a certain reach of a specific pixel. This is a picture and description:

In this diagram, we are trying to compute the color for the pixel in the center (the red element). Its neighbors (within a reach of 4) are all of the green elements. The pixels outside of this 9x9 square are not considered in the blurring calculation for this pixel. To compute the color for the center pixel, average the red, green, and blue components (independently) of every pixel in the 9x9 square (including the pixel itself; the red element in this diagram).

I have some code, but it is not working correctly. The function "computed_color" on line 52 is shown in the next block of code.

Code:
#include <stdlib.h>
#include <stdio.h>
#include "blur_calculations.h"
#define NOT_ENOUGH_ARGS 2
#define MIN_ARGS 3
#define PICTURE_FILE 1
#define REACH_NUMBER 4
#define OUTPUT_FILE "blurred.ppm"
#define PPM_NUMBER "P3"
#define MAX_ROWS 500
#define MAX_COLS 500

void solve(FILE *in_picture, FILE *out_picture, char *argv[]) {

[Code] ....

Here is my code to calculate the average, which I use in my "solve" function:

Code:
#include "blur_calculations.h"
struct color create_color(int r, int g, int b) {
struct color colors;
colors.r = r;
colors.g = g;
colors.b = b;
return colors;

[Code] ....

View 4 Replies View Related

Visual C++ :: Assignment Is Recursive Call And Placing Strings In Link List Notes?

Oct 30, 2013

You need to write a permute class that will take first and second strings to rearrange letters in first, followed by second. For example, if the first is “CAT” string and second is “MAN” string, then the program would print the strings TACMAN, ATCMAN, CTAMAN, TCAMAN, ACTMAN, and CATMAN. The first and second strings can be any length of string or a null.

The permute class uses a Note class as link list note to link all letters arrangement. The permute class has Note pointers, firstNote and lastNote, to point to the beginning and ending Notes of the link list as private data members. There are three other private data members (total, firstString and secondString) to store the total possible number of arrangements and strings pass into the class.

Write a driver to test the permute class to pass in any two strings of any sizes.

Other than mention in the following, you can add more classes, functions, and private data members to this program.

Note class:The Note class needs to have two private data members and a constructor. The two private data members are data and p pointer. The data’s data type is string and p pointer is Note. The Note class constructor has two parameters, one is string and the other is Note pointer.

Permute class:The Permute class has five private data members (*firstNote, *lastNote, total, firstString and secondString). The firstNote and lastNote pointers are point to Note. The total has integer data type. The firstString and secondString have string data type.

There should have at least three public member functions, Permute, permutation and print. The Permute function is the constructor which takes strings to initialize the private data members. The permutation function does the recursive call to arrange the strings and setup the link list. The print function will print out the private data member information.

Driver file:The driver file should declare a Permute eight elements pointer array. Instantiate eight Permute object with the following eight set of data and assign the object to the pointer array. Use a repetition to call the object’s print function to print out the private data member information. If the total of the permute private data member is less than 100 then print out the permutated letters four in a row, otherwise print out 9 in a row.

first = "", second="",

first = "", second ="CATMAN",

first = "C", second ="ATMAN",

first = "CA", second ="TMAN",

first = "CAT", second ="MAN",

first = "CATM", second ="AN",

first = "CATMA", second ="N",

first 1 = "CATMAN", second ="";

View 3 Replies View Related

C# :: Compare The Image Of A Button To Another Image In Visual Studio

Jul 3, 2014

Im trying to compare the image of a button to another image in Visual Studio like so...

//variables
Image active = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\active.png");
Image stunned = Image.FromFile("C:\Users\Ethan\Desktop\StarWars Status\stunned.png");

[Code]...

btnStatusPlr1.Image SHOULD come back as True.Then I realized it might not be the same as setting the buttons image in the properties (Which is what i did to get the original image (the one being compared to))

I do have a feeling ive done something wrong here (Yes im a noob /> )

Variable active, is the same image as the buttons default (Well should be)

View 1 Replies View Related

Visual C++ :: Change Frame Window Size According To Increase In Font Size

Nov 27, 2012

Change the frame window size according to font size increases.

View 3 Replies View Related

Visual C++ :: Convert HSB Color To RGB And RGB To HSB?

Jun 11, 2014

I am trying to make this code working and to remake it to work also for RGB to HSB? This code is for C and I need to make it working in Visual Studio C++ .

Code:
// mask1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
typedef struct RGB_t { unsigned char red, green, blue; } RGB;
typedef struct HSB_t { float hue, saturation, brightness; } HSB;

[code]....

Error I got is error C3861: 'fmaxf': identifier not found

What file or namespace should I include. Do I need to add some library into linker?

View 14 Replies View Related

C# :: WPF Using Color Resource In Rectangle Stroke Color

Sep 7, 2014

Trying to define some global colors so I can use the one instance though-out my application. Here is my color code:

<Color x:Key="GlobalTextColor">#E0E0E0</Color>

But this color doesn't display in the list when I start to type {StaticResource ...}

This is the code where I'm trying to reference the color, see Stroke="{StaticResource GlobalTextColor}". GlobalTextColor doesn't actually come up in the list so won't work.

<Style x:Key="InputButton" TargetType="Button">
<Setter Property="Background" Value="#FF141414" />
<Setter Property="HorizontalAlignment" Value="Left" />

[Code].....

View 2 Replies View Related

Visual C++ :: How To Change Background Color Of Messagebox

Jan 5, 2015

Here is what I did,

Code:
oldHook = ::SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, NULL, ::GetCurrentThreadId());

MessageBox(...);

UnhookWindowsHookEx(oldHook);

Then within the callback function CallWndRetProc, I tried to change the background color of the dialog,

Code:
PAINTSTRUCT ps;
HDC hdc = BeginPaint(msg->hwnd, &ps);
::SetBkColor(hdc, RGB(255, 0, 0));
EndPaint(msg->hwnd, &ps);

But it doesn't change the background color of the dialog. I wonder what is the right way to do that?

View 14 Replies View Related

Visual C++ :: Changing Background Color Of Control?

Aug 10, 2014

ON_WM_CTLCOLOR(...) works for all the other controls but not the tab control.

Code:
void CEasyWebStoreUploaderDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB_CTRL, m_tabCtrl);
DDX_Text(pDX, IDC_EDIT_STATUS, m_strServerStatus);
DDX_Text(pDX, IDC_EDIT_UPLOAD_RESULTS, m_strUploadResults);
}

View 8 Replies View Related

Visual C++ :: How To Color Background Of Excel Cell

Aug 6, 2013

I am saving my data in Excel File Format.

I am using CDataBase class and its methods like OpenEx ,ExecuteSQL etc. The program is working fine.

Now I need to change back-ground color of some data base records.

How to do this in MFC ?

View 3 Replies View Related

Visual C++ :: Change Back Color Of Cell In ListView

Apr 2, 2013

I know how to change the back color of text in th ListView for all the View, but if I only want to change the back color of one cell i don`t find any way. Is it possible?

View 1 Replies View Related

Visual C++ :: Change Text And Background Color Of CComboBox?

Nov 26, 2014

I have a derived CComboBox class, where I tried to change text and background of edit from CComboBox, just like this:

Code:
HBRUSH CMyComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
//if(CTLCOLOR_EDIT == nCtlColor || CTLCOLOR_MSGBOX == nCtlColor) {

[Code] ......

but is not working if CComboBox has CBS_DROPDOWNLIST style ... is working only for CBS_DROPDOWN style ... why ?

View 10 Replies View Related

Visual C++ :: How To Change Color Of MS Windows Button Control

Feb 20, 2013

I am writing a GUI application with C++ Visual component Libraries and Win32API under windows OS.

As part of this app, I have to change color of the MS Windows button control depending on the external state.

I understood, Win32 will not support changing button control color directly as it will not support for this.

how to change the button color?

View 2 Replies View Related

Visual C++ :: Set Background Color For Controls And Dialog - Resource Exception

Jan 5, 2013

I used onctlcolor() method to set the background color for the controls & Dialog. I run my application, working good but after 15 mins the below error occured,

Application Error:

The Required Resource Was --------> Shown message box

Program Error:

First-chance exception at 0x7c81eb33 in XRay.exe: Microsoft C++ exception: CResourceException @ 0x001274f8.
First-chance exception at 0x7c81eb33 in XRay.exe: Microsoft C++ exception: CResourceException @ 0x001259d0.
First-chance exception at 0x7c81eb33 in XRay.exe: Microsoft C++ exception: CResourceException @ 0x00123ea8.
First-chance exception at 0x7c81eb33 in XRay.exe: Microsoft C++ exception: CResourceException @ 0x00122380.
First-chance exception at 0x7c81eb33 in XRay.exe: Microsoft C++ exception: CResourceException @ 0x00120858.
Warning: Uncaught exception in WindowProc (returning 0).

what is the reason for that? How can i prevent my project from this problem.

View 12 Replies View Related

Visual C++ :: How To Draw Pixel-level Color Gradients In CScrollView

Oct 6, 2012

i wish to plot a mathematical function on a 2-dimensional grid. The function will be represented by 3 sets of floats, x-values, y-values, and z-values. Obviously, it is impossible to plot 3 such data sets on a 2D grid, so one approach is to use pixel coloration to represent the z-values.

Those examples (and there are many to be found) show something like the function of the complex variable z, f(z) = exp(z). I have attached a exp(z).jpg example of the imaginary part of the plot exp(z).

My question is: How to accomplish such a gradient colorization, assuming one already has the data?

I have experimented with Gdiplus SetPixel, but I have not figured out how to produce a smooth gradient.

Here's my attempt to create a simple gradient:

Code:
CDC * pDC = GetDC();
Graphics graphics(pDC->m_hDC);
CRect r;
GetWindowRect(&r);
ScreenToClient(&r);

[Code] ....

View 1 Replies View Related

Visual C++ :: Change Default Text Attributes (font And Color)

Nov 12, 2013

I needed to change Default Text attributes (font and color) . So I wrote following code , UnicodeTextOut function. I called this function once in each 55ms to update the display screen. but I observed that my Screen used to become grey like a crash after sometime . If I use Minimize an Maximize window , the screen was restoring back for some time.

When I thought over the code , I got my mistake that CreateFont initialization should be done once in the program and probably outside the function.

void UnicodeTextOut(int x, int y, CString s, UINT justify,int GreyScaleFlag) {
HFONT hFontUnicode;
HFONT hfOld ;
hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial"));

[Code] ....

Then I shifted the line hFontUnicode = CreateFont(16, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, _T("Aerial")); in my screen class constructor and made hFontUnicode global .

This solved my problem as expected. Why a system crash after certain no of CreateFont calls ?

View 2 Replies View Related

Visual C++ :: Basic Settings - How To Configure Color Of Selected Text

May 4, 2014

How to configurate color of selected text. I am not sure why, but in Visual C++ it is not displayed as in other programs like notepad, which should be harder color. So I cannot find the selected text. Where can I configurate it or where to search it in desktop theme settings?

View 3 Replies View Related

Visual C++ :: Fill Color In Shapes Using FLTK Doesn't Work For Circles

Aug 28, 2014

I installed FLTK 1.3.X from [URL] on my visual studio 2012 compiler and use PPP book for C++ programming [URL]. My problem is about filling a Shape in.

Code:
#include <Simple_window.h>
using namespace Graph_lib;
int main() {
Simple_window win(Point(100,100), 1000, 600, "Binary_tree");
Graph_lib::Circle c(Point(200,200),50);
c.set_color(Color::red);

[code]....

When I run the program, All three Shapes are drawn on window but only the Rectangle is filled in! Why? set_color works for the three and apparently the set_fill_color is defined for all Shapes and it too should work but why it doesn't for Circle and Ellipse?

This [URL] is the .CPP and .h files ( )

View 6 Replies View Related

C++ :: Frame Per Second Algorithm?

Aug 27, 2013

i was trying to achieve a better way of game looping. so i have a game loop algrithm. but i dont think its quite good. i want it to be better.

here is my algorithm

bool quit = false;
while(quit == false) {
while(blah blah events)//here we hold events {
if(the user want to quits) {
quit = true;

[code]....

View 2 Replies View Related

C# :: How To Show A Frame Of Gif

Jan 10, 2015

I want to show a frame of a gif image. I searched and found that the following code should work, but it doesn't work. it detects the number of frames correctly but it shows the whole frames of gif instead of the specified frame.

Image[] frames = new Image[36];
Image GG = Image.FromFile(@"C:UsersAdministratorTEST C#TEST2frame2chef.gif");
FrameDimension dimension = new FrameDimension(GG.FrameDimensionsList[0]);
// Number of frames
int frameCount = GG.GetFrameCount(dimension);
label1.Text = frameCount.ToString();
// Return an Image at a certain index
GG.SelectActiveFrame(dimension, 1);
frames[1] = ((Image)GG.Clone());
pictureBox1.Image = frames[1];

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved