Ask Your Question
0

changing pixel values for a group of pixels

asked 2017-05-31 02:23:40 -0600

Hello! I performed SVM classification (2 classes) based on a) raw pixels and b) histograms and now would like to change pixels values of one class into black and other onto white and see the results ( I am not sure if simple dataset_name.show() will work out). As I am new to python and openCV I appreciate any help. Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-31 03:38:14 -0600

Well it depends what your SVM is outputting. If it is pure binary labels, then it is simply checking which values are returned by your model and replace the corresponding pixels with black or white value. If the class output is a range, between -1 and +1 for example, then you will need to threshold.

If I am correct, for SVM it is the second case. So basically if you have the classification results in a matrix, apply a threshold on the matrix, using the middle value (for example 0) as threshold on the resulting scores. This will result in a binary mask image, where white pixels present one class and black pixels the other.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-05-31 02:23:40 -0600

Seen: 377 times

Last updated: May 31 '17