Jacob
1
Hello, i’m new here but i found a problem which i can’t resolve.
void Image_To_Map::photo_patch_windows()
{
using namespace cv;
Mat img = imread(F_O.backslashes_to_slashes(pwstr_to_string(LoadFile(1))));
while (1)
{
imshow(“Image”, img);
}
It’s my code, i’m loading .png image with alpha channel. Problem is it doesn’t load RGBA values from image…
Size is corrent, only colors doesn’t.
berak
2
you need a corresponding waitKey(20);
after the imshow()
,
– else nothing gets rendered.
Jacob
3
while (1)
{
namedWindow(“Image”);
imshow(“Image”, img);
waitKey(20);
}
Now it didn’t show a window also, with creating a namedWindow or without.
img.empty()
is that true or not?
Jacob
5
No, array isn’t empty. So img.empty() return false, size of img.total() is 307200 (correct value based on image size 640x480)
that’s a while-true loop with a waitKey. that should have worked. or you’re doing something else. please prepare a Minimal Reproducible Example.
what’s the value of img.shape
?