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

Documentation for extending cscore webpage controls? #107

Open
rtrahms opened this issue Nov 14, 2017 · 2 comments
Open

Documentation for extending cscore webpage controls? #107

rtrahms opened this issue Nov 14, 2017 · 2 comments

Comments

@rtrahms
Copy link

rtrahms commented Nov 14, 2017

Hi -
I am pretty impressed with the cscore implementation running on our Raspberry Pi.
We are successfully serving a webpage from our RPi at port 8081. I am also able to add OpenCV image operations and view the results on port 8082 (the usbcvstream example).

Part of the use of our camera streams has been for autonomous, which involves OpenCV thresholding of H, S and V around a particular color (mainly green) to focus on targets. I was interested in extending the existing webpage controls by adding min and max sliders for H, S and V. I have found some of the HTML page construction code in mjpegserverImpl.cpp. Is there any documentation you can point me to to add controls to the webpage?

Thanks!
Rob

@ThadHouse
Copy link
Member

We need to work on some of the documentation. However, the way to add them is pretty straight forward. On the CvSource object, there is an CreateProperty function

https://github.com/wpilibsuite/cscore/blob/master/src/main/native/include/cscore_oo.h#L410

Call that to create new properties, and those will be displayed on the webpage. The returned object is a handle to the property. Call Get() on that to get the current value of that property.

@rtrahms
Copy link
Author

rtrahms commented Nov 15, 2017

Works great! Thanks for the tip.
Rob

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

2 participants