Ask Your Question
0

image_view for ubuntu server 20.04

asked 2021-07-27 01:39:18 -0500

kartiki gravatar image

hello i am new to ROS , i am trying to view camera output which is publish by a topic and can be view using following command

            rosrun image_view image_view image:=/camera

however i am getting error as following

     Unable to init server: Could not connect: Connection refused
     (camera:5432): Gtk-WARNING **: 11:53:30.098: cannot open display:
      Segmentation fault (core dumped)

i am using rapsberry pi 3 b+ with picamera , ros version: noetic installed on ubuntu server 20.04. i am not sure whether image_view command pop up a new window to show the camera output bec i am not using desktop version .do i need to intstall ubuntu desktop version to view the output?

edit retag flag offensive close merge delete

Comments

image_view opens a window, so yes, you'd need a desktop environment. Or at least something which supports opening X windows (or perhaps wayland).

If you have another machine, you could start image_view there.

Alternatively: install a VNC server.

Or, as you already mention: install a DE on the machine you're trying to start image_view on.

gvdhoorn gravatar image gvdhoorn  ( 2021-07-29 03:35:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-28 03:17:36 -0500

Ranjit Kathiriya gravatar image

Hello,

Did you check using your normal computer vision code, your camera is working? I think that this is a problem with your OS.

For troubleshooting, try this:

Can you confirm that you are able to see a video of your camera using this code?

import cv2
import numpy as np

cap = cv2.VideoCapture(0)

if (cap.isOpened()== False): 
  print("Error opening video stream or file")

while(cap.isOpened()):
  ret, frame = cap.read()
  if ret == True:
    cv2.imshow('Frame',frame)
    if cv2.waitKey(25) & 0xFF == ord('q'):
      break
  else: 
    break
cap.release()
cv2.destroyAllWindows()

If no, then you should raise your question to https://raspberrypi.stackexchange.com/. It's an OS issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-07-27 01:39:18 -0500

Seen: 30 times

Last updated: Jul 28