I get horizontal black lines in the saved picture

Hi,
for some unknown reason I sometimes get black horizontal lines in the picture. These do not always appear, only sometimes. I use Python and the slightly modified example function to capture the images then I save them with function below.


from PIL import Image
#from example Python script
image = stream.pop_buffer ()
print ("Stop acquisition")
camera.stop_acquisition ()
if image:
		stream.push_buffer (image)
#new from here
		dataFromBuffer = image.get_data()
	else:
		return("error")
	Picture = Image.frombytes('RGB',(3072, 2048),dataFromBuffer)
	archive = "/home/pi/Pictures/"
	Picture.save(archive + "image_"+ cameraname +".jpg")

Is there a common way to save images? I’m not sure if Aravis is the problem here.

Thanks for the help!

Edit: Using Raspberry Pi4 with Hikrobot Machine Vision Camera MV-CA060-10GC and no Jumboframes due to limit of Rpi4.

Hi,

You may want to check the buffer status and verify if it is always success. If not, may be some packets were lost during the transfer.

You also can have some indication about the transfer issues by using ARV_DEBUG:

ARV_DEBUG=stream ./your-application

Emmanuel.

Hey Emmanuel,

thanks the help. May I ask if you could take a look at the output?

[07:46:22.364] 🅸 stream>     bins    ;frame_retent; packet_time;inter_packet
                                    0;           0;         107;       12516
                                 2000;           0;         107;           2
                                 4000;           0;         105;           0
                                 6000;           0;          90;           7
                                 8000;           0;         102;           6
                                10000;           0;         129;           4
                                12000;           0;         107;           0
                                14000;           0;          72;           0
                                16000;           0;         141;           1
                                18000;           0;         107;           1
                                20000;           0;         107;           0
                                22000;           0;         107;           1
                                24000;           0;         106;           2
                                26000;           0;         108;           1
                                28000;           0;         106;           2
                                30000;           0;         107;           7
                                32000;           0;         105;           0
                                34000;           0;         108;           0
                                36000;           0;         108;           1
                                38000;           0;         106;           0
                                40000;           0;         107;           0
                                42000;           0;         105;           0
                                44000;           0;         109;           0
                                46000;           0;         107;           0
                                48000;           0;         106;           0
                                50000;           0;         106;           0
                                52000;           0;         107;           0
                                54000;           0;         107;           0
                                56000;           0;         107;           0
                                58000;           0;         107;           0
                                60000;           0;         106;           0
                                62000;           0;         107;           0
                                64000;           0;         107;           0
                                66000;           0;         107;           0
                                68000;           0;         106;           0
                                70000;           0;         107;           0
                                72000;           0;         107;           0
                                74000;           0;          83;           0
                                76000;           0;         105;           0
                                78000;           0;         128;           0
                                80000;           0;         111;           0
                                82000;           0;          77;           0
                                84000;           0;         122;           0
                                86000;           0;          72;           0
                                88000;           0;          64;           0
                                90000;           0;          64;           0
                                92000;           0;          61;           0
                                94000;           0;          64;           0
                                96000;           0;          60;           0
                                98000;           0;          64;           0
                               100000;           0;          64;           0
                               102000;           0;          63;           0
                               104000;           0;          61;           0
                               106000;           0;          64;           0
                               108000;           0;          56;           0
                               110000;           0;          48;           0
                               112000;           0;          48;           0
                               114000;           0;          47;           0
                               116000;           0;          47;           0
                               118000;           0;          47;           0
                               120000;           0;          47;           0
                               122000;           0;          38;           0
                               124000;           0;          39;           0
                               126000;           0;          45;           0
                               128000;           0;          39;           0
                               130000;           0;          37;           0
                               132000;           0;          36;           0
                               134000;           0;          22;           0
                               136000;           0;          24;           0
                               138000;           0;          35;           0
                               140000;           0;          30;           0
                               142000;           0;          29;           0
                               144000;           0;          12;           0
                               146000;           0;          35;           0
                               148000;           0;          31;           0
                               150000;           0;          29;           0
                               152000;           0;          30;           0
                               154000;           0;          29;           0
                               156000;           0;          31;           0
                               158000;           0;          31;           0
                               160000;           0;          26;           0
                               162000;           0;          23;           0
                               164000;           0;          25;           0
                               166000;           0;          28;           0
                               168000;           0;          21;           0
                               170000;           0;          26;           0
                               172000;           0;          23;           0
                               174000;           0;          18;           0
                               176000;           0;          27;           0
                               178000;           0;          22;           0
                               180000;           0;          23;           0
                               182000;           0;          21;           0
                               184000;           0;          23;           0
                               186000;           0;          29;           0
                               188000;           0;          18;           0
                               190000;           0;          18;           0
                               192000;           0;          18;           0
                               194000;           0;          17;           0
                               196000;           0;          20;           0
                               198000;           0;          17;           0
                         -------------
                         >=    200000;           1;        5890;           0
                         <          0;           0;           0;           0
                         min         : 1.61926e+06;           0;          11
                         max         : 1.61926e+06; 1.51892e+06;       36518
                         last max at :           0;       12551;       11769
                         counter     :           1:       12552:       12551
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_completed_buffers    = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_failures             = 1
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_underruns            = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_timeouts             = 1
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_aborteds             = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_missing_frames       = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_size_mismatch_errors = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_received_packets     = 12552
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_missing_packets      = 3888
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_error_packets        = 1
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_ignored_packets      = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_resend_requests      = 147707
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_resent_packets       = 6097
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_resend_ratio_reached = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_resend_disabled      = 1
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_duplicated_packets   = 0
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_transferred_bytes    = 17870340
[07:46:22.366] 🅸 stream> [GvStream::finalize] n_ignored_bytes        = 0
[07:46:22.367] 🅸 stream> [Stream::finalize] Flush 1 buffer[s] in input queue
[07:46:22.367] 🅸 stream> [Stream::finalize] Flush 0 buffer[s] in output queue

It looks like some packages got lost. Not sure what I can do against it.
And an other quesiton: how do I check if the buffer status is always success? And is it possible to simply transfer the image again in case of not success buffer stauts?

Thank you very much!

Have a look at the ethernet performance tip page: Aravis – 0.10: Ethernet Devices

arv_buffer_get_status(buffer) gives you the buffer status. It is not possible to ask for a resend of a whole image, but there is a packet resend feature in the GigeVision protocol that helps to improve the reliability of the image transfer on the network. This feature is available on your camera, confirmed by the non null n_resent_packets value in the debug output.

Cheers.