Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
almost ok z-axis with cv2, bumps.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsofcotton committed Jun 29, 2023
1 parent dd269dc commit b01464d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ Searching the Internet more...
2023/04/29 theoretical fix and their close on bump, afterbump, gettilevec chain.
2023/05/07 add functions around cvstereo.py.
2023/06/24 fix around z-axis scale on afterbump, get...vec, obj, tilt, sbox commands.
2023/06/29 fix same place z-axis with reasonable.

6 changes: 3 additions & 3 deletions goki.hh
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ template <typename T> SimpleMatrix<T> filter(const SimpleMatrix<T>& data, const
resb += flop<T>(filter<T>(flop<T>(result), INTEGRAW_BOTH));
cerr << "i" << flush;
resb += flip<T>(flop<T>(filter<T>(flip<T>(flop<T>(result)), INTEGRAW_BOTH)));
result = - (move(resb) /= T(int(4)));
result = (move(resb) /= T(int(4)));
T m(result(0, 0));
for(int i = 0; i < result.rows(); i ++)
for(int j = 0; j < result.cols(); j ++)
Expand Down Expand Up @@ -1245,7 +1245,7 @@ template <typename T> static inline vector<SimpleVector<int> > mesh2(const vecto
template <typename T> vector<SimpleVector<T> > getTileVec(const SimpleMatrix<T>& in, const int& vbox = 1) {
vector<SimpleVector<T> > geoms;
geoms.reserve((in.rows() / vbox + 1) * (in.cols() / vbox + 1));
const auto diag(sqrt(sqrt(T(in.rows() * in.rows() + in.cols() * in.cols()))));
const auto diag(sqrt(sqrt(T(in.rows() * in.rows() + in.cols() * in.cols()))) );
for(int i = 0; i < in.rows() / vbox + 1; i ++)
for(int j = 0; j < in.cols() / vbox + 1; j ++) {
if(in.rows() < (i + 1) * vbox ||
Expand Down Expand Up @@ -1282,7 +1282,7 @@ template <typename T> vector<SimpleVector<T> > getHesseVec(const SimpleMatrix<T>
const auto xx(in * diff<T>(in.cols()).transpose() * diff<T>(in.cols()).transpose());
const auto xy(diff<T>(in.rows()) * in * diff<T>(in.cols()).transpose());
const auto yy(diff<T>(in.rows()) * diff<T>(in.rows()) * in);
const auto diag(sqrt(sqrt(T(int(in.rows() * in.rows() + in.cols() * in.cols())))));
const auto diag(sqrt(sqrt(T(int(in.rows() * in.rows() + in.cols() * in.cols())))) );
vector<pair<T, pair<int, int> > > score;
score.reserve(in.rows() * in.cols());
for(int i = 0; i < in.rows(); i ++)
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
argv = sys.argv
pixels = 4
psi = 1. / 3.
rot = 6
rot = 0

if(len(argv) < 4):
print("no much argments.")
Expand Down
4 changes: 2 additions & 2 deletions tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ int main(int argc, const char* argv[]) {
if(!loadp2or3<num_t>(data, argv[3]))
return - 1;
auto sd(argv[1][strlen("obj")] == 'r' ?
shrinkd<num_t>(rgb2d<num_t>(data), argv[1][strlen("objr")]) :
shrinkd<num_t>(rgb2d<num_t>(data), argv[1][strlen("objr")]) / num_t(int(2)) :
shrinkd<num_t>(filter<num_t>(rgb2d<num_t>(data), AFTERBUMP, 2, std::atoi(argv[2])), argv[1][strlen("obj")]) );
const auto rows(sd.rows());
const auto cols(sd.cols());
Expand Down Expand Up @@ -260,7 +260,7 @@ int main(int argc, const char* argv[]) {
assert(strlen("tilt" ) == strlen("sbox" ));
assert(strlen("tiltr") == strlen("sboxr"));
bump[0] = argv[1][strlen("tilt")] == 'r' ?
shrinkde<num_t>(rgb2d<num_t>(bump), argv[1][strlen("tiltr")]) :
shrinkde<num_t>(rgb2d<num_t>(bump), argv[1][strlen("tiltr")]) / num_t(int(2)) :
shrinkde<num_t>(filter<num_t>(rgb2d<num_t>(bump), AFTERBUMP), argv[1][strlen("tilt")]);
num_t z0(int(0));
for(int i = 0; i < bump[0].rows(); i ++)
Expand Down

0 comments on commit b01464d

Please sign in to comment.