From Wikipedia, camera resectioning is the process of finding the true parameters of the camera that produced a given photograph or video. Camera resectioning is also known as geometric camera calibration.
Currently I am using Camera Calibration Toolbox for Matlab for my camera calibration. The toolbox returns calibration parameters such as focal length, principle point, skew, and distortion. However, the issue with this method is that it requires an extra step in calibrating the camera by using a special calibration object like a checkerboard. Additionally, it only works for one focus of the camera.
How can I get the calibration parameters without manually calibrating? For example, how does Microsoft's Photosynth perform camera calibration on its images?
Could someone help explain what is going on in this precommit hook? I thought changing files would cause them to be restaged.
http://snipplr.com/view/28523/git-precommit-hook-to-fix-trailing-whitespace/
I asked a question about Currying and closures where mentioned.
What is a closure? How does it relate to currying?
Additional:
Kyle's answer is great but to my poor procedural/OO mind Ben Childs answer is really useful.
What books would you recommend to a CS undergraduate that did mostly web programming all his life, in order to pick up signal processing ?
I am looking for something at a grad level and more geared toward an average (or below average) programmer.
I was wondering what language to use when talking about a function that takes in a specific object, acts on it and returns something else. Clearly they're functions, but I was wondering if there's a more specific term.
A couple examples of Python built-in functions that fit this spec are: 'len', 'dir', 'vars'
I thought it was 'predicate', but apparently that's specific to functions that return a boolean value.
I'm trying to get an image of a blackboard readable by OCR. Naturally, most OCR software doesn't like dirty images. What image processing should I try to put the image through to clean the image up?
Hi,
I believe that some one is running shell commands to my server via my site, Could any one offer any help on how the user could be doing this ?
also how could I stop this?
I don't understand Access Modifiers in OOP. Why do we make for example in Java instance variables private and then use public getter and setter methods to access them? I mean what's the reasoning/logic behind this?
You still get to the instance variable but why use setter and getter methods when you can just make your variables public?
please excuse my ignorance as I am simply trying to understand why?
Thank you in advance. ;-)
Hi,
Can anybody help me writting a regular expression to replace these characters with a empty string. Character list is given below.
public static char[] delimiters = { ' ', '\r', '\n', '?', '!', ';', '.', ',', '`', ':', '(', ')', '{', '}', '[', ']', '|', '\'', '\\', '~', '=', '@', '>', '<', '&', '%', '-', '/', '#' };
Thanks.
Subrat.
Hi folks. On the comment of my old form needing a CAPTHA, I felt I share my problem, perhaps you recognize it and find its time we had better solutions:
FACTUAL PROBLEM
I know most of my clients (typical age= 40~60) hate CAPTCHA things.
Now, I myself always feel like a robot, when I have to sueeze my eyes and fill in the strange letters from the Capcha... Sometimes I fail! Go back etc. Turnoff.
I mean comon its 2011, shouldnt the forms have better A.I. by now?
MY NEW IDEA (please dont laugh)
Ive thought about it and this is my idea's to tell difference between human and robot:
My idea is to give credibility points. 100 points = human 0% = robot.
require real human mouse movements
require mousemovements that dont follow any mathematical pattern
require non-instantaneous reading delays, between load and first input in form
when typing in form, delays are measured between letters and words
approve as human when typical human behaviour measured (deleting, rephrasing etc)
dont allow instant pasting or all fields
give points for real keyboard pressures
retract points for credibility when hyperlinks in form
Test wether fake email field (invisible by human) is populated (suggested by Tomalak)
when more than 75% human cretibility, allow to be sent without captcha
when less than 25% human crecibility, force captcha puzzle to be sure
Could we write a A.I. PHP that replaces the human-annoying capthas, meanwhile stopping most spamservers filing in the data? Not only for the fun of it, but also actually to provide a 99% better alternative than CAPTHCA's.
Imagine the userfriendlyness of your forms!
Your site distinguishing itself from others, showing your audience your sites KNOWS the difference between a robot and a human. Imagine the advangage. I am trying to capture the essense of that distinguishing edge.
PROGRAMMING QUESTION:
1) Are such things possible to programm?
2) If so how would you start such programm?
3) Are there already very good working solutions available elsewhere?
4) If it isn't so hard, your are welcome to share your answer/solutions below.
5) upon completion of hints and new ideas, could this page be the start of a new AI captcha, OR should I forget about it and just go with the flow, forget about the whole AI dream, and use captcha like everyone else.
I'm having a great deal of difficulty trying to figure out the logic behind this problem. I have developed everything else, but I really could use some help, any sort of help, on the part I'm stuck on.
Back story:
*A group of actors waits in a circle. They "count
off" by various amounts. The last few to audition
are thought to have the best chance of getting the
parts and becoming stars.
Instead of actors having names, they are identified
by numbers. The "Audition Order" in the table tells,
reading left-to-right, the "names" of the actors who
will be auditioned in the order they will perform.*
Sample output:
etc, all the way up to 10.
What I have so far:
using System;
using System.Collections;
using System.Text;
namespace The_Last_Survivor
{
class Program
{
static void Main(string[] args)
{
//Declare Variables
int NumOfActors = 0;
System.DateTime dt = System.DateTime.Now;
int interval = 3;
ArrayList Ring = new ArrayList(10);
//Header
Console.Out.WriteLine("Actors\tNumber\tOrder");
//Add Actors
for (int x = 1; x < 11; x++)
{
NumOfActors++;
Ring.Insert((x - 1), new Actor(x));
foreach (Actor i in Ring)
{
Console.Out.WriteLine("{0}\t{1}\t{2}", NumOfActors, i, i.Order(interval, x));
}
Console.Out.WriteLine("\n");
}
Console.In.Read();
}
public class Actor
{
//Variables
protected int Number;
//Constructor
public Actor(int num)
{
Number = num;
}
//Order in circle
public string Order(int inter, int num)
{
//Variable
string result = "";
ArrayList myArray = new ArrayList(num);
//Filling Array
for (int i = 0; i < num; i++)
myArray.Add(i + 1);
//Formula
foreach (int element in myArray)
{
if (element == inter)
{
result += String.Format(" {0}", element);
myArray.RemoveAt(element);
}
}
return result;
}
//String override
public override string ToString()
{
return String.Format("{0}", Number);
}
}
}
}
The part I'm stuck on is getting some math going that does this:
Can anyone offer some guidance and/or sample code?
I want to do this:
foo.com/xxx= foo.com/somepage.php?id=xxx
This is how I do it:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^([^/]+)$ http://foo.com/somepage.php?id=$1 [L]
the problem now, is that foo.com doesn't work any more.
I can't see foo.com neither foo.com/index.php
help me! :)
I've just tried to create the smallest possible language interpreter. Would you like to join and try?
Rules of the game:
You should specify a programming language you're interpreting. If it's a language you invented, it should come with a list of commands in the comments.
Your code should start with example program and data assigned to your code and data variables.
Your code should end with output of your result. It's preferable that there are debug statements at every intermediate step.
Your code should be runnable as written.
You can assume that data are 0 and 1s (int, string or boolean, your choice) and output is a single bit.
The language should be Turing-complete in the sense that for any algorithm written on a standard model, such as Turing machine, Markov chains, or similar of your choice, it's reasonably obvious (or explained) how to write a program that after being executred by your interpreter performs the algorithm.
The length of the code is defined as the length of the code after removal of input part, output part, debug statements and non-necessary whitespaces. Please add the resulting code and its length to the post.
You can't use functions that make compiler execute code for you, such as eval(), exec() or similar.
This is a Community Wiki, meaning neither the question nor answers get the reputation points from votes. But vote anyway!
i cant seem to get my avd built and i dont understand why i got all the tools i even have GIT but when i try to do the command avd devices it will say no such command can any on help me please and thank you
I'm trying to create this script that will check the computer host name then search a master list for the value to return a corresponding value in the csv file. Then open another file and do a find an replace. I know this should be easy but haven't done so much in python before. Here is what I have so far...
masterlist.txt (tab delimited)
Name UID
Bob-Smith.local bobs
Carmen-Jackson.local carmenj
David-Kathman.local davidk
Jenn-Roberts.local jennr
Here is the script that I have created thus far
#GET CLIENT HOST NAME
import socket
host = socket.gethostname()
print host
#IMPORT MASTER DATA
import csv, sys
filename = "masterlist.txt"
reader = csv.reader(open(filename, "rU"))
#PRINT MASTER DATA
for row in reader:
print row
#SEARCH ON HOSTNAME AND RETURN UID
#REPLACE VALUE IN FILE WITH UID
#import fileinput
#for line in fileinput.FileInput("filetoreplace",inplace=1):
# line = line.replace("replacethistext","UID")
# print line
Right now, it's just set to print the master list. I'm not sure if the list needs to be parsed and placed into a dictionary or what. I really need to figure out how to search the first field for the hostname and then return the field in the second column.
Thanks in advance for your help,
Aaron
Hello!
I am learning about recursion tree's and trying to figure out how the height of the tree is log b of n where n = 2 and one has 10 elements as input size. I am working with Merge sort.
The number of times the split is done is the height of the tree as far as I understood, and the number of levels in the tree is height + 1.
But if you take (for merge sort) log2 of 10 you get 1, where if you draw the tree you get at least 2 times that the recursion occurs.
Where have I gone wrong? (I hope I am making sense here)
NOTE: I am doing a self study, this is not homework!
Please recommend me software engineering/methodology/practices paper. So far I have enjoyed:
1968 Dijkstra : Go To Statement Considered Harmful
Nikalus Wirth : Program Development by Stepwise Refinement
1971 David Parnas : Information Distribution Aspects of Design Methodology
1972 Liskov : Design Methodology for Reliable Software Systems
Extensible Language : Schuman and P Jourrand R. Balzer
Structured Programming :
Dahl - Hierarchical Program StructuresImplementation Patterns
1971 Jim Morris
Protection in Programming Languages
1973 Bill Wulf and Mary Shaw
Global Variable Considered Harmful
1974 : Lisko and Zilles
ADTs
One of my custom developed ASP.NET sites was hacked today: "Hacked By Swan (Please Stop Wars !.. )"
It is using ASP.NET and SQL Server 2005 and IIS 6.0 and Windows 2003 server.
I am not using Ajax and I think I am using stored procedures everywhere I am connecting to the database so I dont think it is SQL injection.
I have now removed the write permission on the folders.
How can I find out what they did to hack the site and what to do to prevent it from happening again?
The server is up to date with all Windows updates.
What they have done is uploading 6 files (index.asp, index.html, index.htm,...) to the main directory for the website.
What log files should I upload?
I have log files for IIS from this folder: c:\winnt\system32\LogFiles\W3SVC1.
I am willing to show it to some of you but don't think it is good to post on the Internet. Anyone willing to take a look at it?
I have already searched on Google but the only thing I find there are other sites that have been hacked - I haven't been able to see any discussion about it.
I know this is not strictly related to programming but this is still an important thing for programmers and a lot of programmers have been hacked like this.
How can I construct a grammar that generates this language?
Construct a grammar that generates L:
L = {a^n b^m c^k|k>n, k>m}
I believe my productions should go along this lines:
S-> ABCC
A-> a|aBC|BC
B-> b|bBC
C-> c|Cc
CB->BC
The idea is to start with 2 c and keep always one more c, and then with C-c|Cc ad as much c as i want.
How can my production for C remember the numbers of m and n.