화상관련 질문인데요... 화면이 이상하게 나와서요.. 고치는법좀

gimelove의 이미지

QT를 사용해서 화상채팅프로그램을 만들고 있습니다.

그런데 화면이 잡히기는 하는데... 좀 이상하게 나오네요...

큐티문제는 아니고 v4l 로 어떤 설정이 더 필요한데 안한듯한데 잘 모르겠네요..

-----------------------------------------
---------- 이미지 크기 세팅하는 부분 ---------------

QImage _image;           


_image.reset();
_image.create(176,144,32);
_image.setAlphaBuffer(true);
                                                                                                                            

-----------------------------------------
-----  정보를 받아옴 --------------------------

  int i;
  struct video_clip vid_clips[32];
                                                                                                                            
  ioctl(camera->dev, VIDIOCGCAP, &camera->vid_caps);
  ioctl(camera->dev, VIDIOCGWIN, &camera->vid_win);
  ioctl(camera->dev, VIDIOCGPICT, &camera->vid_pic);
                                                                                                                            
  for (i = 0; i < 32; i++) {
    vid_clips[i].x      = 0;
    vid_clips[i].y      = 0;
    vid_clips[i].width  = 0;
    vid_clips[i].height = 0;
  }
  camera->vid_win.clips = vid_clips;
  camera->vid_win.clipcount = 0;



-----------------------------------------
--  이미지를 세팅  아무래도 이부분에 다른 정보들을 더 넣어주어야 하는게 아닌지...  --

  if (ioctl (camera->dev, VIDIOCSPICT, &camera->vid_pic) == -1) {
    perror ("ioctl (VIDIOCSPICT)");
  }
  if (ioctl (camera->dev, VIDIOCSWIN, &camera->vid_win) == -1) {
    perror ("ioctl (VIDIOCSWIN)");
  }


------------------------------------------
-----------이미지를 읽어오는 부분 -----------------

 len = read (camera.dev,camera.picbuff,camera.vid_win.width*camera.vid_win.height*3);


------------------------------------------
-----------화면에 뿌리는 부분 --------------------

 memcpy(_image.bits(), buf, length);
                                                                               
 QPainter p(this);
 p.drawImage(0,0,_image);

그림과 같이 176 * 144 로 잡았는데 화면이 4개로 나옵니다 게다가

밑부분에 8개 조각으로 다시 나오는데요...

--- --- --- ---
; ; ; ; ; ; ; ;
--- --- --- ---
ㅁ ㅁ ㅁ ㅁ ㅁ ㅁ ㅁ ㅁ

이런식으로 말이죠... 어떻게해야 해결할수 있나요~~~

File attachments: 
첨부파일 크기
Image icon Test.png18.19 KB
gimelove의 이미지

비디오 4 리눅스를 쓸때 카메라에 어떤 설정을 더해줘야하는데 빼먹은 듯하거든요... 먼지 잘모르겠어서요... 설상가상으로 화면이 흑백으로 나오네요.. ㅡㅡ;;;

My way

gimelove의 이미지

추가적으로 정보를 한번 찍어봤는데 이렇게 나오더군요....


Channels: 1
Audios: 1
Maxwidth: 640
Maxheight: 480
Minwidth: 160
Minheight: 120
---------
X: 0
Y: 0
Width: 176
Height: 144
Chromakey: 0
Flags: 655360
---------
Brightness:     32256 
Hue:            65535 
Color:          32768 
Contrast:       31744 
Whiteness:      30720 
Depth:          24
Palette:        15

My way

hongwoo의 이미지

------------------------------------------ 
-----------이미지를 읽어오는 부분 ----------------- 

 len = read (camera.dev,camera.picbuff,camera.vid_win.width*camera.vid_win.height*3); 


------------------------------------------ 
-----------화면에 뿌리는 부분 -------------------- 

 memcpy(_image.bits(), buf, length); 

len 과 length는 같은 값인거지요 ?
제가 비슷한 프로젝트를 할때는 먼저 프레임 버퍼에다가 확인했었던 기억이 나네요.., 그리고 스트라이드 문제 때문에 이미지가 깨진다거나 겹쳐졌던 문제가 있었던거 같습니다....

-----------------------------
in the real-time scheduler !

gimelove의 이미지

같은 값입니다. ^^
전에는 어떻게 해결하셨는지....

My way

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.