C# :: EMGU - Small Symbol Detection
Sep 16, 2014
I am trying to find the best way to detect a small symbol such as :
Just for testing features I tried to load these into SURF example that comes with EMGU and it does not pick it up... And I think the technology used for SURF is better for objects with more details and color gradients...
View 8 Replies
ADVERTISEMENT
Jan 3, 2014
Code:
char buffer1[10];
char buffer2[10] = "something";
sprintf(buffer1, "with %s", buffer2);
In a statement like the one above, is there a threat/leak or does it only truncate the string that is loaded into buffer1?
View 5 Replies
View Related
Dec 4, 2013
I am trying to add a small function to allow me to pause the game I am making. I measure the time elapsed using the following algorithm:
1. USE ""clock_t begin=clock();"" FOR SYSTEM TIME OF GAME BEGINNING.
2. USE ""cout<<(clock()-begin)/CLOCKS_PER_SEC;"" TO DISPLAY TIME ELAPSED IN SECONDS.
Now, if I want to pause, I would want to subtract the 'paused' time from the total time elapsed.Say,
clock_t pause, resume;
{
pause=clock();
.
.
.
resume=clock();
}
Then I would do cout<<(clock()-begin-(resume-pause))/CLOCKS_PER_SEC;
This, though is what I want, works only once(I can pause only once). I can use arrays of resume and pause, but it would still limit the number of times I can pause.
What I am looking for is a way to pause any number of times.
View 3 Replies
View Related
May 16, 2013
Suppose my file a.txt has "ABC" written in it. Now I want to write a small b before capital B in the file. How will I do it. I've tried to do it but i'm having problems.
1. When opened in app mode seekp doesn't work.
2. When opened normally previous written data is erased.
View 5 Replies
View Related
Mar 24, 2013
I am having difficulty with arrays because of the limitation of the size of the arrays that I can declare. I need sizes that are very large and windows or C# does not allow me to create bigger than the following for example:
public static int[] gaPoints = new int[20000000000000000000 + 1];
I get an error message saying that "integral size is too large".
I need to be able to declare sizes that are even much larger than the abovementioned size.
How can I circumvent this problem?
Do I have to use something other than arrays?
View 5 Replies
View Related
Feb 9, 2013
I want to store a very small number - too small for even a long double. However, I don't need the number to be stored very precisely - in fact, all I really need is the order of magnitude of the number. For example, the number 5.205849034425 X 10^-381 can just be stored as an integer of -381 for my purposes. I don't really care about the precision of the 5.205849034425 part.
The reason I get this very small number, is because I am multiplying together thousands of numbers, all of which are around 0.0001 in value. So, one way to do this would be to store all these individual values as simply their order of magnitude (e.g. -4) and then instead of multiplying the numbers, I would just add up their orders of magnitude. However, I am wondering whether there is a way in C++ to do this without me having to change the way I store my data - I still would like to keep the original values if possible.
View 2 Replies
View Related
Apr 10, 2013
Whenever I try to call merge sort on large numbers say n=10000000. It gives an error. It works fine for small numbers, even though I have declared my Lists on the heap.
The below code is just the divde part.
List<long>* Merge(List<long> *ParentList) {
if((ParentList)->Length==1) {
return ParentList;
[Code] .....
View 1 Replies
View Related
Apr 4, 2015
Im trying to do a small program that will create multiples of the previous line *2, and spit out the anwser in seperate lines (as many times as the user wants)
Example if i wrote it in a bad way
2
4
8
16
32
etc.
At this time my code looks likes this, now im planing to get my hands on the IF statment
using System;
using System.Collections.Generic;
using System.Linq;
[Code].....
View 6 Replies
View Related
May 16, 2014
take a look at this project : [URL] i want to change this project for this purpose : when a USB PRINTER is connected show a message that tell us -> hey this is a printer. which part of this project should i change and how can i separate printer devices from the others?
note: if you are using visual studio 2010 or higher and get error for this line after conversion :
#define _WIN32_WINNT 0x403
just replace all of such these lines to stdafx.cpp file. means stdafx.cpp at last should be like this :
// stdafx.cpp : source file that includes just the standard includes
// HWDetect.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#define _WIN32_WINNT 0x403
#include "stdafx.h"
View 1 Replies
View Related
Apr 10, 2014
I've finished my series of tutorials and built a investment calculator with QT, now that's finished and I wanted to create a small radio that allows to retrieve audio from an URL. I wanted to use Juce but I'm clueless about it, I know how to program but I've never touched external libraries?
View 2 Replies
View Related
May 21, 2012
I have been writing a program to generate pairs of RSA keys using small prime numbers. I have been using mpz_invert() to get a value for d for the private key. On small prime numbers it calculates the correct value, but on larger primes it calculates incorrect values.
I'm assuming there must be an upper limit to the values the mpz_invert() function can handle? If so, what is this limit to avoid erroneous values?
View 1 Replies
View Related
Jan 20, 2015
Still working with SDL2 and c++ my map collision is messed up since I implemented my Camera.
I do understand that everything has a relative Position on the Screen, depending on the camera.
Problem No. 1: The camera is not moving as fast as the Player, despite having the absolutly same velocity (4/-4)??? How can this be O_o
Problem No. 2: My tile collision is totally messed now. Probably its because of the difference between the Player Position and the camera :/ So if you can solve Problem no. 1, Problem number 2 might work out on its own :)
I will upload the code to github [URL] .....
View 11 Replies
View Related
Mar 21, 2015
I actually want some latest algorithms, methods or techniques which can be used in plagiarism detection software for detecting the text plagiarism offline.
View 4 Replies
View Related
Jun 23, 2013
i am having trouble finding a way to detect integers from an external text file. i currently have this code:
while(inputfile.get(wc))
{
char character = inputfile.get(wc);
if (character + 1 != NULL)
{
cout << character << endl;
}
}
this does not work as if (character + 1 != NULL) comes up with errors.
is there a way to detect ints?
View 3 Replies
View Related
May 4, 2013
I've been working on my 2D platformer for a while, and I'm running into a couple of problems. It seems to become laggy even when only about 25 entities need to do collision detection with the 8 walls in the area.
Only one thing to note: the BOOST_FOREACH(const Edge& edge, this->GetCollisonBoxEdges()) { sections actually aren't a loop, all players and enemies are basically a vertical line for purposes of hitting walls, so that's why there is some weird stuff in there (like assuming the edge is oriented a certain way, etc).
Asset::WallCollision Asset::GetClosestWallCollision(const std::vector<const Room::Wall*>& walls) const {
typedef std::pair< sf::Vector2<CoordT>, sf::Vector2<CoordT> > Edge;
const Room::Wall* wall_hit = NULL, * landing_wall = NULL;
util::intersect_ret temp, closest;
VelocityT para_vel;
if(this->m_StandingOn) para_vel = this->m_StandingOn->get_unit_parallel_vector() * this->mVelocity.x;
else para_vel = this->mVelocity;
[code].....
View 3 Replies
View Related
Jun 21, 2013
Why the size of a process grows larger in size for lots of small memory allocations. For example, say I have this struct, which is 16 bytes (for a 32 bit build):
Code:
struct Person {
int iID;
int iAge;
char * pForeName;
char * pSurName;
};
If I allocate memory like this:
Code:
LPBYTE lpB = new BYTE[sizeof(Person) * 1000000];
Then my process grows to 16,48KB in size, which is what I expected. However if I allocate memory like this:
Code:
Person * lpPerson;
for(int i = 0; i < 1000000; ++i)
lpPerson = new Person;
Then the process grows to 78,656KB, which I don't understand.
Additionally, I was surprised to find a vector acts more similarly to the first example. This code:
Code:
Person temp = { 0 };
std::vector<Person> people;
for(int i = 0; i < 1000000; ++i)
people.push_back(temp);
Only increases the process memory to 16,892.
View 5 Replies
View Related
Mar 6, 2015
In the C++ book Programming: Principles and Practice Using C++, there's an example code like this for detecting repeated words:
Code:
#include "std_lib_facilities.h"
int main() {
int number_of_words = 0;
string previous = " "; // previous word; initialized to "not a word"
string current; // current word
while (cin >> current) // read a stream of words
[Code].....
The header file in there is sort of like a set of training-wheels for students who are complete beginners to the language; the function keep_window_open() is defined in there and it does just that on Windows systems where the output window closes too fast (in the case of the function, it's just like cin.ignore(), except it waits for you enter a character, like 'j', before it exits); programs on my Windows laptop work fine on Code::Blocks, but when I create a .exe file for them and double-click that file, it does actually close too quickly for me to be able to see the output (if it's a program like the generic "Hello World!" program that just outputs text to the screen and then exits - so all I see is the output window just flash-by really fast in those cases).
Anyway, as for the problem I'm having with the code: there are no error and compile- or link-time, but it does behave strangely at runtime, where the part inside the curly-braces of the while-loop doesn't execute at all.
View 3 Replies
View Related
May 1, 2013
I'm trying to write a program that detects deadlock. Some of the code I already tested in an earlier stage but at this point when I run the code it somehow gets stuck. I believe that it has something to do with a negative integer value. Anyhow, the program should still work if a negative integer comes up. Here's my code so far.
Code:
#include <stdio.h>
#define FALSE 0
#define TRUE 1
int ALLOC[5][5], REQ[5][5], TOT_RES[5], process, resource, NUMB_RES=5, NUMB_PRO=5;
int TMP[5]={0}, AVAIL[5], CNTR=0, FIN[5]={FALSE}, FLAG;
}
[code]....
The program usually gets stuck after producing output displaying the "Available: " text. After that a list of tabbed numbers should appear, but it doesn't.
View 4 Replies
View Related
Nov 30, 2014
I don't think my processes are being created the way I want. I'm trying to create a fan of process (i.e. one parent with multiple children).
I want the parent to put together the final output image, and the children are supposed to do the edge detection on various regions of the image. Here is what I have:
Code:
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "iplib2New.c"
#define FILTER_SIZE 3
//Function prototypes
[Code] ......
View 10 Replies
View Related
Oct 14, 2014
I'm still working on my Project and the next Problem has occured: How do I detect collisions on a tilebased map? My tiles are 16x16 and the map is based on the tutorial of [URL] ..... I really like this Approach because I can define for each tile of what type it should be (so a earth tile can be walkable and lead to a secret passage).
The first Number stands for what Kind of tile it should be (e.g. Grass, Earth, Water, Blank,...) and the number after ":" stands for the type of the tile (e.g. solid, walkable, do dmg to the Player,...).
e.g.
0:0 0:0 0:0 0:0 0:0 //No tile and walkable
0:0 0:0 0:0 0:0 0:0
0:0 0:0 0:0 0:0 0:0
1:1 1:1 1:1 1:1 1:1 //Grass tile and solid
2:1 2:1 2:1 2:1 2:1 //Earth tile and solid
It's working just fine with loading the Images, but i've got no clue about the collision. I've already read a lot of stuff on the Internet but I don't get how to Combine it the structure from above. For example lazyfoo describes the collision with one object like one wall. So how can I check the Player Position with each tile?
For now there's no camera, but I plan to implement one later...
I'm trying to make a 2D platformer
View 5 Replies
View Related
Sep 10, 2014
I'm making a 2D Terraria-like (side-scrolling RPG with destroyable blocks) game with SFML 2.1, and I have no clue how to correctly implement collision detection. Meaning that I have been successful at making it work, but it's not clean and definitely not dynamic.
By example, I mean design wise. What parameters should collision functions take? Where should these functions be located? The same 2 questions for collision reaction. Since I have multiple things that need to collide with each other (player with enemy, player with items, enemy with items, enemy with enemy, player with player, etc...), and the world has to be treated differently, things get complicated. There is no block class, just a vertex array, so collision with the world is based purely on coordinates taken from that array in the world class, which, considering it's the world and not something like a player or an enemy, doesn't inherit from the same base class that they do.
View 7 Replies
View Related
Oct 29, 2014
I need to distinguish between number (float) and other non number characters. I was trying to use this:
Code:
#include <stdio.h>
#include <ctype.h>
float Ax;
...
scanf("%f
",&Ax);
if (isdigit(Ax)) {....}
And whatever I type I receive "Segmentation fault". How can I detect that the float input is correct? Is there any built in function?
View 7 Replies
View Related
Mar 24, 2015
I'm receiving a char array consist of 8 characters, what I want to do is find the number of set bits in that array and then send it(total number) as a character to the transmitter so he can check, data is transmitted using serial port(RS232), where processing of data is done by DE0 FPGA.I've tried to use TestBit but the compiler doesn't know this function(I added #include "bit-manipulation.h" but it doesn't recognize this either) ...
-- the code of my project:
filed = open( "/dev/uart_0", O_RDWR );
if (filed < 0){
printf("the port can't be opened
");
[Code] .....
View 1 Replies
View Related
Oct 24, 2012
How do I get the printer connected with my computer physically using cables?
View 2 Replies
View Related
Mar 13, 2014
I am writing an software that should be able to detect all keyboard inputs by the user. i.e., both hardware and software/on-screen keyboard.
This software is going to be written in a platform independent way and supposed to run on Windows, Linux, Android & iOS.
The idea is to capture the keyboard inputs from a low level, there by making sure that it doesn't miss any inputs even if it's a on-screen keyboard like in a mobile device.
I am looking at possible open source libraries that can be used.
View 1 Replies
View Related
Jul 28, 2013
I have made a simple 2d shooter (bird eye view) and want implementing the collision detection between the monsters and bullets. The problem is as follows
Each monster has locationX, locationY as coordinates.
Each monster has a Rectangle representing its collision box, (if bullet inside rectangle then its a collision).
Each bullet has locationX, locationY as coordinates as well.
pretty standard up till now.
each frame I need to check if some bullet collided with some monster.
the brutal force is to keep a list of all the bullets and monsters and to check the possibility of collision between all of them which takes O(#bullets * #monsters).
View 2 Replies
View Related