문제

I have some manually annotated ground truth images color-coding some object. When I resize them (to have X and Y as training images with lower resolution i.e. faster processing time), something changes the label color inside the ground truth.

from PIL import Image   
  ground_truth=Image.open(//location)
  ground_truth_resized = ground_truth.resize(size, Image.ANTIALIAS)
  ground_truth_resized.save(//destination folder)

I presume the antialias is doing something to change the color (i.e. label ) I am going from 1024x768 to 640x480, essentially preserving the aspect ratio

How can I reduce resolution but keep labels?

도움이 되었습니까?

해결책

Removing the ANTIALIAS solves the problem

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top