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

How to Store Coordinates only once? #146

Open
fdkssdks opened this issue Aug 31, 2018 · 0 comments
Open

How to Store Coordinates only once? #146

fdkssdks opened this issue Aug 31, 2018 · 0 comments

Comments

@fdkssdks
Copy link

Hello, I am interested to know if there's a way to store the coordinates of the detected object only once?

So, when the detection is running it keeps on detecting the object and keeps on appending the coordinate of the same objects again and again(I am using CSV file to write the coordinates). Though there's a slight delta in the coordinates that doesn't matter for now since the object is stationary.

This is what I've now.

	for box in y_pred_thresh[0]:
		# Transform the predicted bounding boxes for the 300x300 image to the original image dimensions.
		xmin = box[2] * 300 / img_width
		ymin = box[3] * 300 / img_height
		xmax = box[4] * 300 / img_width
		ymax = box[5] * 300 / img_height
		cv2.rectangle(smallFrame, (int(xmin),int(ymin)),(int(xmax),int(ymax)),(0,250,0), thickness=1,lineType=8)
		xcenter=((xmin+xmax)/2) #For center X
		ycenter=((ymin+ymax)/2) #For center Y
		csv.write(round(xcenter)+ ' , ' + round(ycenter))
		csv.write('\n')
		csv.close()
		cv2.waitKey(0)
	return (y_pred_thresh)			

Any help is appreciated.
Thanks

* Operating System Ubuntu 16.04
* Which commit of this repository you're on: Latest
* Keras version: 2.2.0
* TensorFlow version: 1.9.0

If someone knows what kind of coordinates do we get? Is it pixel coordinate or something else?
How can I convert it to Robot Coordinate that is in X Y Z?

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

1 participant