
Val


Fotogrammeetria on protsess, kus me teeme hunniku järjestikuseid pilte mingist objektist ja laseme arvutil neist rekonstrueerida kolmemõõtmelise objekti. Nagu panoraamfoto tegemisel peab ka siin iga järgmine foto katma osaliselt sama ala, mis eelmine. Seejärel targad programmid ja algoritmid analüüsivad pilte ja proovivad tuvastada, mis on esiplaanil (teravamad) või tagaplaanil (udusemad), mis osad liiguvad rohkem.vähem jne
Pildistamine:


Ei sobi:

Head on:



















The last few days I’ve been trying to make photogrammetric 3d models.
Software: Meshroom and MeshLab.





I have identical bubble sort algorithm in C and C++. Same data and same computer. Experiment shows that C is twice as slow as C ++.
In C it takes 124 processor clicks or 0.000124 sec.
In C++ it takes 66 processor clicks or 0.000066 sec.
#include <stdio.h>
#include <time.h>
int arry_size = 0;
int numbers[] = { 8, 1, 5, 2, 4, 0, 3, 7, 9, 6, 99, 55, 44, 21, 12,
34, 5, 68, 19, 71, 70, 82, 65, 41, 72, 11, 36, 18, 27, 14, 15, 13 };
void print_array(int numbers[], int arry_size) {
for (int i = 0; i < arry_size; i++) {
printf("%d ", numbers[i]);
if (i == arry_size - 1) {
printf("\n");
}
}
}
void bubble_sort(int numbers[], int numbers_size) {
int n, i;
for (n = numbers_size - 1; n > 0; n--) {
for (i = 1; i <= n; i++) {
int left = numbers[i - 1];
int right = numbers[i];
if (left > right) {
numbers[i - 1] = right;
numbers[i] = left;
}
}
}
}
int main ()
{
clock_t execution_time;
execution_time = clock();
arry_size = sizeof(numbers)/sizeof(numbers[0]);
printf("Before: ");
print_array(numbers, arry_size);
bubble_sort(numbers, arry_size);
printf("After: ");
print_array(numbers, arry_size);
execution_time = clock() - execution_time;
printf ("Processor time: %ld clicks (%f sec.)\n",
execution_time, ((float)execution_time) / CLOCKS_PER_SEC);
return 0;
}

#include <iostream>
#include <time.h>
int arry_size = 0;
int numbers[] = { 8, 1, 5, 2, 4, 0, 3, 7, 9, 6, 99, 55, 44, 21, 12,
34, 5, 68, 19, 71, 70, 82, 65, 41, 72, 11, 36, 18, 27, 14, 15, 13 };
void print_array(int numbers[], int arry_size) {
for (int i = 0; i < arry_size; i++) {
std::cout << numbers[i] << " ";
if (i == arry_size - 1) {
std::cout << '\n';
}
}
}
void bubble_sort(int numbers[], int numbers_size) {
int n, i;
for (n = numbers_size - 1; n > 0; n--) {
for (i = 1; i <= n; i++) {
int left = numbers[i - 1];
int right = numbers[i];
if (left > right) {
numbers[i - 1] = right;
numbers[i] = left;
}
}
}
}
int main () {
clock_t execution_time;
execution_time = clock();
arry_size = sizeof(numbers)/sizeof(numbers[0]);
std::cout << "Before: ";
print_array(numbers, arry_size);
bubble_sort(numbers, arry_size);
std::cout << "After: ";
print_array(numbers, arry_size);
execution_time = clock() - execution_time;
std::cout << "Processor time:" << execution_time
<< "clicks (" << ((float)execution_time) / CLOCKS_PER_SEC
<< " sec.)" << '\n';
return 0;
}

https://github.com/taunoe/cpp-examples/tree/master/Sorting-algorithms/Bubble-sort





