# Iskall

Member Since 15 Aug 2011
Offline Last Active Jun 03 2012 12:57 AM

### In Topic: Windows Forms in Game maker

24 May 2012 - 04:23 PM

Ah, 48 hours. Very well sir shall not happen again.

And thank you, MaxWinAPI 2 is definately what I am looking for, but it was one of the extensions I tried to download previously but has a broken link. If you try to download it, you will be linked to a page with a lot of corrupted text and no actual file to be downloaded. Do you know of any others?

### In Topic: Stereo Camera

24 May 2012 - 03:32 PM

First, let's list what we assume. I assume that both cameras have the same position and orientation, except one is moved to the side (along a row of pixels) a bit. We can also assume that there is a maximum distance (in pixels) to check (This will be from the closest point).

Given that assumption, I can assume that the pattern offset works in only one direction. (Specifically, the camera on the left will have pixels further to the right than the camera on the right)

Okay. We're starting at a given point from the right camera and want to find a point to the right of this one from the left camera that is close in position and close in value to the current point. Of course, the area AROUND the current point might also be taken into consideration. Here's a thought: Let's check offsets as we go until we find one that minimizes the (approximated) integral of the difference between the offset signal and the signal from the left camera divided by the square of the distance to the offset pixel we wish to compute. That probably made no sense. I should put it in code.

```//  Pixel quality test:
var pixel_x, offset_x, n, integral;
pixel_x = argument0;  // Position of tested pixel in the RIGHT camera's view
offset_x = argument1;
integral = 0;
for (n = 0; n < image_width; n += 1) {
integral += pixel_difference(camera_right_pixel[n], camera_left_pixel[clamp(0, image_width, n + offset_x)]) / (1 + sqr(n - pixel_x)); //  pixel_difference returns a positive value representing how different two colors are.
}
return integral;```

I know it's not the BEST way to do it, but finding an offset within a small range that minimizes that should give you good results.

NOTE: In mathematical terms, you've given two functions f(x) and g(x) and want to find a function h(x) such that f(x + h(x)) - g(x) is minimized for some norm.

Your assumptions are 100% correct. I will have a look at your code and try to understand it!

EDIT
I've been reading the code over and over, and the thing's I'm not 100% sure about are:

Where did you get the code from? Was it all you or is there some more history to this kind of "solution"?

the "return integral", is that simply a number which becomes higher the more likely pixel_x is to n?

I feel like a monkey when I look at this code, you've used so many different functions(I understand them all, not how you came to understand to put them in that order that you've done it. And that makes me having problem understanding how this code works and what I am looking for and what I shall make with the return value etc)

besides, the "offset_x" is kind of something that has to be calculated aswell because the distance between the    V      V  can be either 5 mm or 20 mm.. in other words, it's not always the same. It's kind of the thing that I'm looking for most because when I do have that information I can mimic the integral of one easily onto the other one.

### In Topic: Capture text from screen

23 August 2011 - 02:10 AM

After doing some research and testing, tesseract was quite awful with the font used. However I did find some french stuff which was alot better (Though their program did cost) http://www.intelliant.fr/en/index.php

### In Topic: Capture text from screen

22 August 2011 - 04:51 AM

@Robert Colton
I was not sure what I was supposed to search for:/

@IceMetalPunk
If this work I shall be your slave for eternity!

### In Topic: Any Way To Take a Screenshot with an alpha channel

19 August 2011 - 04:41 PM

I am making a game that requires you to draw things to help you get past certain situations so i was wonder how would i implement the painting system i mean i got the painting in a sepereate window down but i need to figure out how would i export the object i just drew into an bmp file with an alpha channel? so i dont get a white background behind the object.

bmp files don't support alpha channels, so my advice to you is to use a surface without any background and use it instead