cscore icon indicating copy to clipboard operation
cscore copied to clipboard

Documentation for extending cscore webpage controls?

Open rtrahms opened this issue 8 years ago • 2 comments

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

rtrahms avatar Nov 14 '17 13:11 rtrahms

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.

ThadHouse avatar Nov 14 '17 18:11 ThadHouse

Works great! Thanks for the tip.
Rob

rtrahms avatar Nov 15 '17 05:11 rtrahms