hed icon indicating copy to clipboard operation
hed copied to clipboard

How to process images in real time

Open peiyunju opened this issue 2 years ago • 5 comments

Hello, I would like to ask, for this algorithm, can I process some of my own pictures in real time, and from which aspects to improve it

peiyunju avatar Nov 02 '22 02:11 peiyunju

Yes, it is possible. You may need to modify the test function (see: https://github.com/xwjabc/hed/blob/master/hed.py#L257) and use your own image as input.

xwjabc avatar Nov 02 '22 03:11 xwjabc

Excuse me, if I use the canny edge processing algorithm, how do I get ODS and OIS? Because I want to use ODS and OIS to compare canny and HED algorithms to compare their gaps in processing at the edge.

peiyunju avatar Nov 04 '22 04:11 peiyunju

The current edge evaluation process in HED is: (1) Generate probabilistic edge maps w/ HED network (i.e., .mat files in mat folder and png images in png folder) -> (2) NMS process to convert the probabilistic edge maps to thinned edge maps (i.e., png images in the nms folder) -> (3) Evaluate the thinned edge maps.

For Canny edge detection algorithm, I think the outputted edge maps are already processed after NMS. Thus, you may directly evaluate such edge maps using step (3). You can refer to this part for the evaluation of the thinned edge maps.

xwjabc avatar Nov 04 '22 22:11 xwjabc

After taking a look at your test code, I would like to know how to generate a MATAT file from a PNG image of Canny

peiyunju avatar Nov 06 '22 13:11 peiyunju

I think you do no need to generate MAT file for the step (3) since its input format is png. You can directly feed the generated png files from Canny edge detector into the evaluation step.

If you still need to save images as MAT files, you can use savemat() function in scipy.io. See this line for an example.

xwjabc avatar Nov 06 '22 19:11 xwjabc