Comments (3)
how to:
# copies in a static manner the values of a framecontainer into a new one
def deepcopy_framecontainer(fc, fc2):
fc2.camId = fc.camId
fc2.init('dataSources', len(fc.dataSources))
for i, datasource in enumerate(fc.dataSources):
fc2.dataSources[i] = fc.dataSources[i]
fc2.fromTimestamp = fc.fromTimestamp
fc2.hiveId = fc.hiveId
fc2.id = fc.id
fc2.toTimestamp = fc.toTimestamp
fc2.init('transformationMatrix', len(fc.transformationMatrix))
for i, tm in enumerate(fc.transformationMatrix):
fc2.transformationMatrix[i] = fc.transformationMatrix[i]
fc2.init('frames', len(fc.frames))
for i, frame in enumerate(fc.frames):
fc2.frames[i] = fc.frames[i]
from bb_binary import Repository, FrameContainer
repo = Repository('data/1h_09-25-15/')
repo_fixed = Repository('data/1h_09-25-15_fixed2/')
for fname in repo.iter_fnames():
fc = load_frame_container(fname)
fc2 = FrameContainer.new_message()
deepcopy_framecontainer(fc, fc2)
for frame in fc2.frames:
for detection in frame.detectionsUnion.detectionsDP:
detection.x, detection.y = detection.y, detection.x
repo_fixed.add(fc2)
from bb_binary.
If all DetectionDP.xpos
and DetectionDP.ypos
in the whole repro are swapped, i think it is faster to just change the bb_binary_schema.capnp.
From:
struct DetectionDP {
...
xpos @1 :UInt16; # x coordinate of the grid center wrt. the image
ypos @2 :UInt16; # y coordinate of the grid center wrt. the image
...
}
To:
struct DetectionDP {
...
ypos @1 :UInt16; # x coordinate of the grid center wrt. the image
xpos @2 :UInt16; # y coordinate of the grid center wrt. the image
...
}
But then we have to fix the output of DP simultaneous, otherwise we produce multiple inconsistent data, where xpos
and ypos
are sometimes swapped and sometimes not.
If I am not mistaken, the swap of the coordinates in the DP was happening in bb_pipeline-processing.py at line L107
.
positions = peak_local_max(im, min_distance=dist)
peak_local_max returns the row (y-Axis) first and then the column(x-Axis).
from bb_binary.
See also BioroboticsLab/bb_pipeline@c8f8942
Thanks for the suggestion @gitmirgut
from bb_binary.
Related Issues (20)
- Capnp Schema Review HOT 6
- Use Python Version with Windows HOT 1
- Shorten the return value of __repr__ in a FrameContainer HOT 1
- repo.iter_frames throws error HOT 3
- Improve quality of comments inside the capnp schema
- capnp schema needs better hive coordinates support HOT 1
- capnp schema needs version control coupled with tags on this repo
- iter_frames not returning frames in sorted order when cam is None
- iter_frames returns nothing if time period between start and end is too small (?) HOT 1
- Iter_frames raises AssertionError if begin and end are outside of Repository limits
- iter_frames raises AssertionError, when 00,20,40 folders are missing.
- Parameters start and end HOT 2
- New requirement: iter_frames HOT 3
- Fix C++ converter tool
- New timestamp format for 2016
- Move gt_to_hdf5 script to another repo HOT 1
- New function to convert the decodedId array to integer
- Possible confusing use of Repository Class
- Interval problem with Repository.iter_fnames() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bb_binary.