Comments (4)
Thanks for your answer as always ! :D
I've already tried with a rectangle as your solution describe, and it was the same. It's I in my code I removed it to try without.
But I found a way more logical two calculate the exact distance between two point without using SpatialLocationCalculator.
So I'll continue with that instead of troubleshooting my problem.
from depthai_blazepose.
Is your code visible somewhere so that I can have a look ?
from depthai_blazepose.
I can put the add I've made in your library here :
In create_pipeline
I've add :
xoutSpatialData = pipeline.create(dai.node.XLinkOut)
xinSpatialCalcConfig = pipeline.create(dai.node.XLinkIn)
xoutSpatialData.setStreamName("spatialData")
xinSpatialCalcConfig.setStreamName("spatialCalcConfig")
spatial_location_calculator.out.link(xoutSpatialData.input)
xinSpatialCalcConfig.out.link(spatial_location_calculator.inputConfig)
stereo.depth.link(spatial_location_calculator.inputDepth)
Then I've created two queue
self.q_spatial_calc = self.device.getOutputQueue(name="spatialData", maxSize=4, blocking=False)
self.q_spatial_conf = self.device.getInputQueue("spatialCalcConfig")
And then create this function :
def roi_data(self, point):
top_left = dai.Point2f(point[0], point[1])
bottom_right = dai.Point2f(point[0], point[1])
config = dai.SpatialLocationCalculatorConfigData()
config.depthThresholds.lowerThreshold = 100
config.depthThresholds.upperThreshold = 10000
config.roi = dai.Rect(top_left, bottom_right)
config.calculationAlgorithm = dai.SpatialLocationCalculatorAlgorithm.AVERAGE
cfg = dai.SpatialLocationCalculatorConfig()
cfg.addROI(config)
self.q_spatial_conf.send(cfg)
spatial_data = self.q_spatial_calc.get().getSpatialLocations()
xyz = spatial_data[0].spatialCoordinates
return [float(xyz.x), float(xyz.y), float(xyz.z)]
# for depth_data in spatial_data:
# return [depth_data.spatialCoordinates.x,
# depth_data.spatialCoordinates.y,
# depth_data.spatialCoordinates.z]
And that's the output of roi_data that give me the point printed in the first comment. And I observe too that sometimes he blocked all x y and z value at 0.0
from depthai_blazepose.
Your top_left is the same as bottom_right. I am not sure how the SpatialLocationCalculator behaves in that case, but usually we use a square zone, something like:
top_left = dai.Point2f(point[0]-d, point[1]-d)
bottom_right = dai.Point2f(point[0]+d, point[1]+d)
And d
is chosen such that the square zone belongs only to the object (here the body part) we are interested in. If the zone is a mix of body pixels and background pixels and you use the AVERAGE algorithm, the z will probably be not accurate. So you don't want the zone to be too large.
Yet I don't think that explains the wrong x and y you observe. I can't see other problem in the code you shared. Without seeing the whole code, I can't say more.
from depthai_blazepose.
Related Issues (20)
- how to specify IP address of OAK-D Pro HOT 7
- using IR LED and mono cameras for skeleton detection HOT 15
- run as standalone network device on OAK-D Pro POE HOT 3
- [ImageManip(7)] [error] Invalid configuration or input image -skipping frame HOT 21
- Input for landmark regression too small HOT 2
- How to replace ColorCamera with XLinkIn node? HOT 1
- AttributeError: 'depthai.node.Script' object has no attribute 'setScriptData' HOT 1
- align the person HOT 9
- RuntimeError: No available devices HOT 6
- Error in the edge mode HOT 3
- 'Couldn't read data from stream: 'manager_out' (X_LINK_ERROR)'
- What is the max FPS for real time pose estimation? HOT 1
- 'Couldn't read data from stream: 'manager_out' (X_LINK_ERROR)' on OAK-D S2, M1 Mac
- glitchiness HOT 1
- Renderer Argument -3 World Attribute Error
- Out of Memory Error
- requirements.txt update for RPi4
- Device not recognized for OAK-D W OV9782
- Wrong 3d hand pose
- Question about getting spatial data of each landmark
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 depthai_blazepose.