[1.1.1] VNC: Region capture not correct: vnc.capture(someRegion) --- fixed 1.1.2 2018-03-06 build#120

Bug #1740421 reported by Julian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

problem: image is elongated or even turned up-side down

----------------- workaround
from comment #4
I have found a way to bypass this issue:
BufferedImage croppedImage = vnc.capture().getImage().getSubimage(xAxis, yAxis, width, height);
ImageIO.write(croppedImage, "png", new File("tempRead.png"));

... or some other means, that crops the needed region image from a fullscreen capture.
------------------------------------
Sikuli 1.1.2-20171218.172518-66
OS: Windows Embeded

Hi,

I'm trying to read the text from a specified region, but what I've noticed is that, when I'm trying to see what's in that actual region, and capture that image, it becomes distorted.

If the region is higher than 185px, the image is elongated (second image in the screenshot).
If the region has the hight lower than around 185px, the whole text is messed up, and upside down too (the last image in the screenshot).

This is the code I've used:

Region tLocked = vnc.set(new Region(9, 170, 240, 185));
ImageIO.write(vnc.capture(tLocked).getImage(), "png", new File("terminal.png"));
System.out.println(tLocked.text());

Therefore, when trying to read text from the first scenario, I get nothing, and from the second scenario I get:
xfaaucxscs‘}5en:s_1_1:en: :

Revision history for this message
Julian (kj88) wrote :
Revision history for this message
RaiMan (raimund-hocke) wrote :

debug and have a look at the BufferedImage returned by
vnc.capture(tLocked).getImage()

... any differences?

What about something like:
tlocked.find(someImage)

does it work?

Revision history for this message
Julian (kj88) wrote :

The BufferedImage looks the same as the second image in the attached distorted.png

I tried to do a find:

tLocked.find("loc.png");

But it didn't worked

FindFailed: loc.png: (118x8) in R[9,170 240x185]@S(0) E:Y, T:3.0
  Line 2782, in file Region.java

Revision history for this message
Julian (kj88) wrote :

I have found a way to bypass this issue:

BufferedImage croppedImage = vnc.capture().getImage().getSubimage(xAxis, yAxis, width, height);
ImageIO.write(croppedImage, "png", new File("tempRead.png"));
String text = TextRecognizer.getInstance().recognize(ImageIO.read(new File("tempRead.png")));

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.2
summary: - Region not captured correctly in VNC session
+ [1.1.1] Region capture not correct: vnc.capture(someRegion) ---
+ workaround
RaiMan (raimund-hocke)
description: updated
Revision history for this message
RaiMan (raimund-hocke) wrote :

@Julian
Could you give it a test?

Changed in sikuli:
status: In Progress → Fix Committed
importance: High → Critical
summary: - [1.1.1] Region capture not correct: vnc.capture(someRegion) ---
- workaround
+ [1.1.1] VNC: Region capture not correct: vnc.capture(someRegion) ---
+ fixed 1.1.2 2018-03-06 build#120
Revision history for this message
Julian (kj88) wrote :

Verified in 1.1.2 2018-03-10
The issue has been fixed, I can no longer reproduce it.

Thank you very much!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.