0
$\begingroup$

I have a dataset that contain both black and white images and a grayscale images (some of them are scnned by printer and other by camera and changes into gray)

how can make or scale my dataset so I can use it to feed a model ?

$\endgroup$
1
$\begingroup$

$\hat{p}=2\big(\frac{p}{p_{max}}\big)-1$ so that $\hat{p}\in [-1,1]$ where $p\in[0,p_{max}]$

E.g. with 8-bit channels, $p_{max}=255$, black/white correspond to $-1$ and $1$ respectively, and grayscale is linearly mapped in $[-1,1]$.

$\endgroup$
1
  • $\begingroup$ Thanks, I'm changing the gray scale into threshold black and white abd it worked--- using ---- cv2.threshold(grayImage, 127, 255, cv2.THRESH_BINARY) $\endgroup$ Oct 9 '20 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.