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

extract of boxes #6

Closed
bbidong opened this issue Jul 1, 2019 · 13 comments
Closed

extract of boxes #6

bbidong opened this issue Jul 1, 2019 · 13 comments

Comments

@bbidong
Copy link

bbidong commented Jul 1, 2019

the Problem Formulation part in paper says "Based on the coordinates, we can automatically extract their bounding boxes" . I wonder how to get it in eth/ucy dataset? Especially how to get the box of human target because the coordinates provided by eth/ucy dataset is in world plane
Thanks for your repo!

@JunweiLiang
Copy link
Contributor

Hi,

The ETH/UCY dataset comes with the homography matrices so we could use that to map world coordinates to pixel coordinates. Example pseudo code for Hotel:

# input: H.txt & biwi_hotel.txt
# 1. load the homography matrix
# 2. _, h = cv2.invert(np.array(h)) # invert the matrix for meter to pixel
# 3. pixel_points = cv2.perspectiveTransform(np.array([[[x_meter,y_meter]]]), h)
# x_pixel,y_pixel = np.squeeze(pixel_points)

Then, we resize all videos (and the pixel coordinates) to 720x576. The person boxes are extracted based on average size of people in the videos:

# point_pos means where the trajectory points are located.
video2box = {
	"seq_eth":lambda xy: make_box(xy,w=20,h=40,point_pos="head"),
	"seq_hotel":lambda xy:make_box(xy,w=80,h=50,point_pos="head"),
	"crowds_zara01":lambda xy:make_box(xy,w=50,h=80,point_pos="feet"),
	"crowds_zara02":lambda xy:make_box(xy,w=50,h=80,point_pos="head"),
	"students003":lambda xy:make_box(xy,w=50,h=80,point_pos="feet")
}

@jagmonroy
Copy link

Hi! I'm working with zara2, I understand that is part of the ETH/UCY dataset. You comment previously that are homography matrices available, is there any place where I can find them?

Regards!

@JunweiLiang
Copy link
Contributor

They are in the rar files.

https://graphics.cs.ucy.ac.cy/research/downloads/crowd-data

@bbidong
Copy link
Author

bbidong commented Aug 14, 2019

It is saved in H.txt

@jagmonroy
Copy link

I get some rar files, but they only contain splines ):

@MZ82020
Copy link

MZ82020 commented Apr 26, 2022

Hello @JunweiLiang,

For the perspective transform function: pixel_points = cv2.perspectiveTransform(np.array([[[x_meter,y_meter]]]), h)
what refers x_meter and y_meter please?
I have always errors in this function.

@JunweiLiang
Copy link
Contributor

The x_meter and y_meter are the original coordinates of the ETH/UCY dataset files, which are world coordinates in meters.

@MZ82020
Copy link

MZ82020 commented Apr 26, 2022

The x_meter and y_meter are the original coordinates of the ETH/UCY dataset files, which are world coordinates in meters.

where can I find them please?

@JunweiLiang
Copy link
Contributor

They are in the rar files.

https://graphics.cs.ucy.ac.cy/research/downloads/crowd-data

@MZ82020
Copy link

MZ82020 commented Apr 26, 2022

For my case, I want to visualize the observed, predicted and groundtruth trajectories after the test.
How can I do that please?

@JunweiLiang
Copy link
Contributor

#4

@MZ82020
Copy link

MZ82020 commented Apr 26, 2022

in my case, it's different. I have x_obs & y_obs for time 0 to 7 and x_pred & y_pred for time 0 to 11.
I want to do the visualization of the trajectories; do I have to do the conversion with the perspective transform too?
or how can I do it please? do you have an idea

Thanks

@JunweiLiang
Copy link
Contributor

If your model is trained with pixel coordinates, then you do not need to convert them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants