0
\$\begingroup\$

[Scene:]

I am working on a game project.In a part of my project,I have to do following things.

1.Read a image

2.Detect face(I am using opencv)

3.view in my imgui window using ImGUi::image()

I already have abstracted my texture object working fail~safe(without any runtime error).I also abstracted a class integerating use of opencv.That part is also fail~safe.

Opencv reads imagefile and detects face and return its unsigned char*(format demanded by opengl)which later fed to my texture object..creating Opengl texture

ImGui requires opengl texture id to render an image using ImGui::image()function..After all my texture is ready,so no problem in calling the function

[Problem:]

I tried drawing two different image

1.Whole image(512x512)

2.The facial part of Whole image(173x173)

Whole image is rendered quite well.but when i render facial part image seems to shear or say disort..why?i mean it is not rendered correctly...

whole image

This the first part i did...I read lena.jpg and rendered whole image in imgui window...this was the result

And then in second part i detected face using opencv and fed to gl texture the face ROI and rendered the image.But result was this

face ROI

both imageg are square matrix..one is rendered well while other is not..How shall i fix this

\$\endgroup\$
5
  • \$\begingroup\$ Can you show the code you're using to draw the image/image segment in each case? \$\endgroup\$ Commented Jul 2, 2018 at 17:06
  • \$\begingroup\$ That part is fine... \$\endgroup\$ Commented Jul 3, 2018 at 6:49
  • \$\begingroup\$ If it's not giving you the correct result, then there's a problem somewhere. Without seeing your code it's very hard for us to help you diagnose where that problem is. \$\endgroup\$ Commented Jul 3, 2018 at 10:16
  • \$\begingroup\$ What part of code are you asking?Texture part or imgui image implementation ??or both \$\endgroup\$ Commented Jul 4, 2018 at 12:11
  • \$\begingroup\$ That's a good question: what parts of your code are required to reproduce this issue? Try boiling down the simplest sample of code that demonstrates the problem — what we call a Minimal Complete Verifiable Example — this will both help you narrow down the cause of the issue, and make it easy for other users to get up to speed with your implementation and help you with it. \$\endgroup\$ Commented Jul 4, 2018 at 12:19

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.